mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Caio Novais <caionovais@usp.br>
To: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org
Cc: "Alex Deucher" <alexander.deucher@amd.com>,
	"Christian König" <christian.koenig@amd.com>,
	"Pan, Xinhui" <Xinhui.Pan@amd.com>,
	"David Airlie" <airlied@gmail.com>,
	"Daniel Vetter" <daniel@ffwll.ch>,
	"Harry Wentland" <harry.wentland@amd.com>,
	"Leo Li" <sunpeng.li@amd.com>,
	"Rodrigo Siqueira" <Rodrigo.Siqueira@amd.com>,
	"Jack Xiao" <Jack.Xiao@amd.com>,
	"Hawking Zhang" <Hawking.Zhang@amd.com>, "Le Ma" <le.ma@amd.com>,
	"Mario Limonciello" <mario.limonciello@amd.com>,
	"Yifan Zhang" <yifan1.zhang@amd.com>,
	"Mukul Joshi" <mukul.joshi@amd.com>, "Jun Lei" <Jun.Lei@amd.com>,
	"Wenjing Liu" <wenjing.liu@amd.com>,
	"Alan Liu" <HaoPing.Liu@amd.com>,
	"Caio Novais" <caionovais@usp.br>,
	"Joshua Ashton" <joshua@froggi.es>,
	"Guo Zhengkui" <guozhengkui@vivo.com>,
	"Nicholas Kazlauskas" <Nicholas.Kazlauskas@amd.com>,
	"Zhan Liu" <zhan.liu@amd.com>, "Wayne Lin" <wayne.lin@amd.com>,
	"Charlene Liu" <Charlene.Liu@amd.com>,
	"Martin Leung" <Martin.Leung@amd.com>,
	"Tom Chung" <chiahsuan.chung@amd.com>,
	"Alvin Lee" <alvin.lee2@amd.com>,
	"George Shen" <George.Shen@amd.com>,
	"Qingqing Zhuo" <qingqing.zhuo@amd.com>,
	"Roman Li" <Roman.Li@amd.com>,
	"Wesley Chalmers" <Wesley.Chalmers@amd.com>,
	"Aurabindo Pillai" <aurabindo.pillai@amd.com>,
	"Jingwen Zhu" <Jingwen.Zhu@amd.com>,
	"Melissa Wen" <mwen@igalia.com>,
	"Felipe Clark" <felipe.clark@amd.com>,
	"Sung Joon Kim" <sungjoon.kim@amd.com>,
	"Dillon Varone" <Dillon.Varone@amd.com>,
	"Ethan Wellenreiter" <Ethan.Wellenreiter@amd.com>,
	"Taimur Hassan" <Syed.Hassan@amd.com>,
	"Maíra Canal" <mairacanal@riseup.net>,
	"Brian Chang" <Brian.Chang@amd.com>,
	"Gabe Teeger" <gabe.teeger@amd.com>,
	"André Almeida" <andrealmeid@igalia.com>,
	"Chaitanya Dhere" <chaitanya.dhere@amd.com>,
	"Jiapeng Chong" <jiapeng.chong@linux.alibaba.com>,
	"Ryan Lin" <tsung-hua.lin@amd.com>,
	"Hamza Mahfooz" <hamza.mahfooz@amd.com>
Subject: [PATCH 08/12] drm/amd/display: Remove two unused variables 'speakers' and 'channels' and remove unused function 'speakers_to_channels'
Date: Mon, 27 Mar 2023 20:33:49 -0300	[thread overview]
Message-ID: <20230327233353.64081-9-caionovais@usp.br> (raw)
In-Reply-To: <20230327233353.64081-1-caionovais@usp.br>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=y, Size: 2788 bytes --]

Compiling AMD GPU drivers displays two warnings:

drivers/gpu/drm/amd/amdgpu/../display/dc/dcn31/dcn31_apg.c: In function ‘apg31_se_audio_setup’:
drivers/gpu/drm/amd/amdgpu/../display/dc/dcn31/dcn31_apg.c:117:18: warning: variable ‘channels’ set but not used [-Wunused-but-set-variable]
and
drivers/gpu/drm/amd/amdgpu/../display/dc/dcn31/dcn31_apg.c:116:18: warning: variable ‘speakers’ set but not used [-Wunused-but-set-variable]

Get rid of them by removing the variables and the function
"speakers_to_channels".

Signed-off-by: Caio Novais <caionovais@usp.br>
---
 .../gpu/drm/amd/display/dc/dcn31/dcn31_apg.c  | 39 -------------------
 1 file changed, 39 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dcn31/dcn31_apg.c b/drivers/gpu/drm/amd/display/dc/dcn31/dcn31_apg.c
index 24e9ff65434d..e94d0ba915ce 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn31/dcn31_apg.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn31/dcn31_apg.c
@@ -72,40 +72,6 @@ static void apg31_disable(
 	REG_UPDATE(APG_CONTROL2, APG_ENABLE, 0);
 }
 
-static union audio_cea_channels speakers_to_channels(
-	struct audio_speaker_flags speaker_flags)
-{
-	union audio_cea_channels cea_channels = {0};
-
-	/* these are one to one */
-	cea_channels.channels.FL = speaker_flags.FL_FR;
-	cea_channels.channels.FR = speaker_flags.FL_FR;
-	cea_channels.channels.LFE = speaker_flags.LFE;
-	cea_channels.channels.FC = speaker_flags.FC;
-
-	/* if Rear Left and Right exist move RC speaker to channel 7
-	 * otherwise to channel 5
-	 */
-	if (speaker_flags.RL_RR) {
-		cea_channels.channels.RL_RC = speaker_flags.RL_RR;
-		cea_channels.channels.RR = speaker_flags.RL_RR;
-		cea_channels.channels.RC_RLC_FLC = speaker_flags.RC;
-	} else {
-		cea_channels.channels.RL_RC = speaker_flags.RC;
-	}
-
-	/* FRONT Left Right Center and REAR Left Right Center are exclusive */
-	if (speaker_flags.FLC_FRC) {
-		cea_channels.channels.RC_RLC_FLC = speaker_flags.FLC_FRC;
-		cea_channels.channels.RRC_FRC = speaker_flags.FLC_FRC;
-	} else {
-		cea_channels.channels.RC_RLC_FLC = speaker_flags.RLC_RRC;
-		cea_channels.channels.RRC_FRC = speaker_flags.RLC_RRC;
-	}
-
-	return cea_channels;
-}
-
 static void apg31_se_audio_setup(
 	struct apg *apg,
 	unsigned int az_inst,
@@ -113,17 +79,12 @@ static void apg31_se_audio_setup(
 {
 	struct dcn31_apg *apg31 = DCN31_APG_FROM_APG(apg);
 
-	uint32_t speakers = 0;
-	uint32_t channels = 0;
 
 	ASSERT(audio_info);
 	/* This should not happen.it does so we don't get BSOD*/
 	if (audio_info == NULL)
 		return;
 
-	speakers = audio_info->flags.info.ALLSPEAKERS;
-	channels = speakers_to_channels(audio_info->flags.speaker_flags).all;
-
 	/* DisplayPort only allows for one audio stream with stream ID 0 */
 	REG_UPDATE(APG_CONTROL2, APG_DP_AUDIO_STREAM_ID, 0);
 
-- 
2.40.0


  parent reply	other threads:[~2023-03-27 23:35 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-27 23:33 [PATCH 00/12] drm/amd: Remove unused variables Caio Novais
2023-03-27 23:33 ` [PATCH 01/12] drm/amd: Remove unused variable 'r' Caio Novais
2023-03-27 23:46   ` Alex Deucher
2023-03-27 23:33 ` [PATCH 02/12] drm/amd: Remove unused variable 'value0' Caio Novais
2023-03-27 23:48   ` Alex Deucher
2023-03-27 23:33 ` [PATCH 03/12] drm/amd/display: Remove unused variable 'pixel_width' Caio Novais
2023-03-27 23:33 ` [PATCH 04/12] drm/amd/display: Remove unused variable 'hubp' Caio Novais
2023-03-27 23:33 ` [PATCH 05/12] drm/amd/display: Remove unused variable 'speakers' Caio Novais
2023-03-27 23:33 ` [PATCH 06/12] drm/amd/display: Remove unused variable 'mc_vm_apt_default' Caio Novais
2023-03-27 23:33 ` [PATCH 07/12] drm/amd/display: Remove unused variable 'optc' Caio Novais
2023-03-27 23:33 ` Caio Novais [this message]
2023-03-27 23:33 ` [PATCH 09/12] drm/amd/display: Remove two unused variables 'is_pipe_split_expected' and 'state' Caio Novais
2023-03-27 23:50   ` Alex Deucher
2023-03-27 23:33 ` [PATCH 10/12] drm/amd/display: Remove unused variable 'cursor_bpp' Caio Novais
2023-03-27 23:33 ` [PATCH 11/12] drm/amd/display: Remove unused variable 'scl_enable' Caio Novais
2023-03-27 23:33 ` [PATCH 12/12] drm/amd/display: Remove two unused variables 'result_write_min_hblank' and 'hblank_size' Caio Novais
2023-03-27 23:53   ` Alex Deucher
2023-03-28 10:16 ` [PATCH 00/12] drm/amd: Remove unused variables Jani Nikula

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230327233353.64081-9-caionovais@usp.br \
    --to=caionovais@usp.br \
    --cc=Brian.Chang@amd.com \
    --cc=Charlene.Liu@amd.com \
    --cc=Dillon.Varone@amd.com \
    --cc=Ethan.Wellenreiter@amd.com \
    --cc=George.Shen@amd.com \
    --cc=HaoPing.Liu@amd.com \
    --cc=Hawking.Zhang@amd.com \
    --cc=Jack.Xiao@amd.com \
    --cc=Jingwen.Zhu@amd.com \
    --cc=Jun.Lei@amd.com \
    --cc=Martin.Leung@amd.com \
    --cc=Nicholas.Kazlauskas@amd.com \
    --cc=Rodrigo.Siqueira@amd.com \
    --cc=Roman.Li@amd.com \
    --cc=Syed.Hassan@amd.com \
    --cc=Wesley.Chalmers@amd.com \
    --cc=Xinhui.Pan@amd.com \
    --cc=airlied@gmail.com \
    --cc=alexander.deucher@amd.com \
    --cc=alvin.lee2@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=andrealmeid@igalia.com \
    --cc=aurabindo.pillai@amd.com \
    --cc=chaitanya.dhere@amd.com \
    --cc=chiahsuan.chung@amd.com \
    --cc=christian.koenig@amd.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=felipe.clark@amd.com \
    --cc=gabe.teeger@amd.com \
    --cc=guozhengkui@vivo.com \
    --cc=hamza.mahfooz@amd.com \
    --cc=harry.wentland@amd.com \
    --cc=jiapeng.chong@linux.alibaba.com \
    --cc=joshua@froggi.es \
    --cc=le.ma@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mairacanal@riseup.net \
    --cc=mario.limonciello@amd.com \
    --cc=mukul.joshi@amd.com \
    --cc=mwen@igalia.com \
    --cc=qingqing.zhuo@amd.com \
    --cc=sungjoon.kim@amd.com \
    --cc=sunpeng.li@amd.com \
    --cc=tsung-hua.lin@amd.com \
    --cc=wayne.lin@amd.com \
    --cc=wenjing.liu@amd.com \
    --cc=yifan1.zhang@amd.com \
    --cc=zhan.liu@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®