Message ID | 20230217181409.218008-4-arthurgrillo@riseup.net (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | Resolve warnings from AMDGPU | expand |
Applied. Thanks. On Fri, Feb 17, 2023 at 1:15 PM Arthur Grillo <arthurgrillo@riseup.net> wrote: > > Remove a couple of local variables that are only set but never used, > also remove an static utility function that is never used in consequence > of the variable removal. > > This decrease the number of -Wunused-but-set-variable warnings. > > Signed-off-by: Arthur Grillo <arthurgrillo@riseup.net> > --- > .../gpu/drm/amd/display/dc/dcn31/dcn31_apg.c | 41 ------------------- > 1 file changed, 41 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..05aac3e444b4 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,24 +79,17 @@ 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); > > /* When running in "pair mode", pairs of audio channels have their own enable > * this is for really old audio drivers */ > REG_UPDATE(APG_DBG_GEN_CONTROL, APG_DBG_AUDIO_CHANNEL_ENABLE, 0xFF); > - // REG_UPDATE(APG_DBG_GEN_CONTROL, APG_DBG_AUDIO_CHANNEL_ENABLE, channels); > > /* Disable forced mem power off */ > REG_UPDATE(APG_MEM_PWR, APG_MEM_PWR_FORCE, 0); > -- > 2.39.2 >
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..05aac3e444b4 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,24 +79,17 @@ 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); /* When running in "pair mode", pairs of audio channels have their own enable * this is for really old audio drivers */ REG_UPDATE(APG_DBG_GEN_CONTROL, APG_DBG_AUDIO_CHANNEL_ENABLE, 0xFF); - // REG_UPDATE(APG_DBG_GEN_CONTROL, APG_DBG_AUDIO_CHANNEL_ENABLE, channels); /* Disable forced mem power off */ REG_UPDATE(APG_MEM_PWR, APG_MEM_PWR_FORCE, 0);
Remove a couple of local variables that are only set but never used, also remove an static utility function that is never used in consequence of the variable removal. This decrease the number of -Wunused-but-set-variable warnings. Signed-off-by: Arthur Grillo <arthurgrillo@riseup.net> --- .../gpu/drm/amd/display/dc/dcn31/dcn31_apg.c | 41 ------------------- 1 file changed, 41 deletions(-)