linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: Takashi Iwai <tiwai@suse.de>
Cc: alsa-devel@alsa-project.org,
	Olivier Moysan <olivier.moysan@st.com>,
	Alexandre Torgue <alexandre.torgue@st.com>,
	kernel-janitors@vger.kernel.org,
	Arnaud Pouliquen <arnaud.pouliquen@st.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Colin King <colin.king@canonical.com>,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	Jaya Kumar <jayakumar.alsa@gmail.com>
Subject: Re: [alsa-devel] [PATCH 9/9] ALSA: intel_hdmi: remove redundant variable cfg_val
Date: Mon, 6 Aug 2018 13:37:53 -0500	[thread overview]
Message-ID: <a5a408bc-cc58-946e-5b36-496548a6316f@linux.intel.com> (raw)
In-Reply-To: <s5hin4unyh0.wl-tiwai@suse.de>

On 8/1/18 6:00 AM, Takashi Iwai wrote:
> On Wed, 01 Aug 2018 12:47:42 +0200,
> Colin King wrote:
>>
>> From: Colin Ian King <colin.king@canonical.com>
>>
>> Variable cfg_val is being assigned but is never used hence it is
>> redundant and can be removed.
>>
>> Cleans up clang warning:
>> warning: variable 'cfg_val' set but not used [-Wunused-but-set-variable]
>>
>> Signed-off-by: Colin Ian King <colin.king@canonical.com>
>> ---
>>   sound/x86/intel_hdmi_audio.c | 2 --
>>   1 file changed, 2 deletions(-)
>>
>> diff --git a/sound/x86/intel_hdmi_audio.c b/sound/x86/intel_hdmi_audio.c
>> index edc9f5a34eff..fa7dca5a68c8 100644
>> --- a/sound/x86/intel_hdmi_audio.c
>> +++ b/sound/x86/intel_hdmi_audio.c
>> @@ -290,7 +290,6 @@ static void had_reset_audio(struct snd_intelhad *intelhaddata)
>>   static int had_prog_status_reg(struct snd_pcm_substream *substream,
>>   			struct snd_intelhad *intelhaddata)
>>   {
>> -	union aud_cfg cfg_val = {.regval = 0};
>>   	union aud_ch_status_0 ch_stat0 = {.regval = 0};
>>   	union aud_ch_status_1 ch_stat1 = {.regval = 0};
>>   
>> @@ -298,7 +297,6 @@ static int had_prog_status_reg(struct snd_pcm_substream *substream,
>>   					  IEC958_AES0_NONAUDIO) >> 1;
>>   	ch_stat0.regx.clk_acc = (intelhaddata->aes_bits &
>>   					  IEC958_AES3_CON_CLOCK) >> 4;
>> -	cfg_val.regx.val_bit = ch_stat0.regx.lpcm_id;
> 
> Actually this made me wonder what is the definition of val_bit.
> It seems always 1 in the current code after the commit 964ca8083c02.
> Pierre?

This val_bit is only there for debug/test, it should be set to one by 
default and has nothing to do with the lpcm_id. This variable was set 
even in patches before upstream submission and was never needed, I guess 
it must be a 9-yr old issue. Good catch!

Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>

BTW looking at the structures in intel_hdmi_lpe_audio.h, the field 
format:3 in audio_ch_status_0 is misleading at best, it should be the 
emphasis if I look at the SPDIF/AES docs. It's not used but I'll have to 
relook at all this when I find some time... We should really set the 
registers to mirror what the aes_bits are, not just the non_audio and 
clock accuracy fields.

  parent reply	other threads:[~2018-08-06 18:38 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-01 10:47 [PATCH 0/9] ALSA: remove redundant variables Colin King
2018-08-01 10:47 ` [PATCH 1/9] ALSA: asihpi: remove redundant variable max_streams Colin King
2018-08-01 12:00   ` Takashi Iwai
2018-08-01 10:47 ` [PATCH 2/9] ALSA: cs5535audio: remove redundant pointer 'dma' Colin King
2018-08-01 12:01   ` Takashi Iwai
2018-08-01 10:47 ` [PATCH 3/9] ALSA: emu10k1: remove redundant variable attn Colin King
2018-08-01 12:01   ` Takashi Iwai
2018-08-01 10:47 ` [PATCH 4/9] ALSA: ens137x: remove redundant array pcm_devs Colin King
2018-08-01 12:01   ` Takashi Iwai
2018-08-01 10:47 ` [PATCH 5/9] ALSA: sonicvibes: remove redundant pointer 'dir' Colin King
2018-08-01 12:01   ` Takashi Iwai
2018-08-01 10:47 ` [PATCH 6/9] ASoC: nau8540: remove redundant variable osrate Colin King
2018-08-01 11:17   ` Applied "ASoC: nau8540: remove redundant variable osrate" to the asoc tree Mark Brown
2018-08-01 10:47 ` [PATCH 7/9] ASoC: stm32: remove redundant pointers 'priv' and 'rtd' Colin King
2018-08-01 11:16   ` Applied "ASoC: stm32: remove redundant pointers 'priv' and 'rtd'" to the asoc tree Mark Brown
2018-08-01 10:47 ` [PATCH 8/9] ALSA: usb-audio: remove redundant pointer 'urb' Colin King
2018-08-01 12:01   ` Takashi Iwai
2018-08-01 10:47 ` [PATCH 9/9] ALSA: intel_hdmi: remove redundant variable cfg_val Colin King
2018-08-01 11:00   ` Takashi Iwai
2018-08-01 14:55     ` [alsa-devel] " Pierre-Louis Bossart
2018-08-06 18:37     ` Pierre-Louis Bossart [this message]
2018-08-06 19:37       ` Takashi Iwai
2018-08-06 19:59         ` Pierre-Louis Bossart

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=a5a408bc-cc58-946e-5b36-496548a6316f@linux.intel.com \
    --to=pierre-louis.bossart@linux.intel.com \
    --cc=alexandre.torgue@st.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=arnaud.pouliquen@st.com \
    --cc=broonie@kernel.org \
    --cc=colin.king@canonical.com \
    --cc=jayakumar.alsa@gmail.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=olivier.moysan@st.com \
    --cc=tiwai@suse.de \
    /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;
as well as URLs for NNTP newsgroup(s).