mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [-next] ASoC: Intel: fix compiler warning of function ‘probe_codec’
@ 2022-09-13 10:02 Wang Yufen
  2022-09-13 14:06 ` Cezary Rojewski
  0 siblings, 1 reply; 2+ messages in thread
From: Wang Yufen @ 2022-09-13 10:02 UTC (permalink / raw)
  To: cezary.rojewski, pierre-louis.bossart, liam.r.girdwood,
	peter.ujfalusi, yung-chuan.liao, ranjani.sridharan, kai.vehmanen,
	broonie, perex, tiwai, alsa-devel
  Cc: linux-kernel

Move the variable ‘skl’ define to
CONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC enabled, to fix the compiler
warning:
  sound/soc/intel/skylake/skl.c: In function ‘probe_codec’:
  sound/soc/intel/skylake/skl.c:729:18: warning: unused variable ‘skl’ [-Wunused-variable]
    729 |  struct skl_dev *skl = bus_to_skl(bus);
        |                  ^~~

Signed-off-by: Wang Yufen <wangyufen@huawei.com>
---
 sound/soc/intel/skylake/skl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/intel/skylake/skl.c b/sound/soc/intel/skylake/skl.c
index c7c1cad..52a041d 100644
--- a/sound/soc/intel/skylake/skl.c
+++ b/sound/soc/intel/skylake/skl.c
@@ -726,8 +726,8 @@ static int probe_codec(struct hdac_bus *bus, int addr)
 	unsigned int cmd = (addr << 28) | (AC_NODE_ROOT << 20) |
 		(AC_VERB_PARAMETERS << 8) | AC_PAR_VENDOR_ID;
 	unsigned int res = -1;
-	struct skl_dev *skl = bus_to_skl(bus);
 #if IS_ENABLED(CONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC)
+	struct skl_dev *skl = bus_to_skl(bus);
 	struct hdac_hda_priv *hda_codec;
 #endif
 	struct hda_codec *codec;
-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [-next] ASoC: Intel: fix compiler warning of function ‘probe_codec’
  2022-09-13 10:02 [-next] ASoC: Intel: fix compiler warning of function ‘probe_codec’ Wang Yufen
@ 2022-09-13 14:06 ` Cezary Rojewski
  0 siblings, 0 replies; 2+ messages in thread
From: Cezary Rojewski @ 2022-09-13 14:06 UTC (permalink / raw)
  To: Wang Yufen, pierre-louis.bossart, liam.r.girdwood,
	peter.ujfalusi, yung-chuan.liao, ranjani.sridharan, kai.vehmanen,
	broonie, perex, tiwai, alsa-devel
  Cc: linux-kernel

On 2022-09-13 12:02 PM, Wang Yufen wrote:
> Move the variable ‘skl’ define to
> CONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC enabled, to fix the compiler
> warning:
>    sound/soc/intel/skylake/skl.c: In function ‘probe_codec’:
>    sound/soc/intel/skylake/skl.c:729:18: warning: unused variable ‘skl’ [-Wunused-variable]
>      729 |  struct skl_dev *skl = bus_to_skl(bus);
>          |                  ^~~
> 
> Signed-off-by: Wang Yufen <wangyufen@huawei.com>

Fix is fine but it has been proposed already by Gaosheng [1].



[1]: 
https://lore.kernel.org/alsa-devel/20220822035133.2147381-1-cuigaosheng1@huawei.com/

Regards,
Czarek

> ---
>   sound/soc/intel/skylake/skl.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/sound/soc/intel/skylake/skl.c b/sound/soc/intel/skylake/skl.c
> index c7c1cad..52a041d 100644
> --- a/sound/soc/intel/skylake/skl.c
> +++ b/sound/soc/intel/skylake/skl.c
> @@ -726,8 +726,8 @@ static int probe_codec(struct hdac_bus *bus, int addr)
>   	unsigned int cmd = (addr << 28) | (AC_NODE_ROOT << 20) |
>   		(AC_VERB_PARAMETERS << 8) | AC_PAR_VENDOR_ID;
>   	unsigned int res = -1;
> -	struct skl_dev *skl = bus_to_skl(bus);
>   #if IS_ENABLED(CONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC)
> +	struct skl_dev *skl = bus_to_skl(bus);
>   	struct hdac_hda_priv *hda_codec;
>   #endif
>   	struct hda_codec *codec;

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-09-13 14:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-13 10:02 [-next] ASoC: Intel: fix compiler warning of function ‘probe_codec’ Wang Yufen
2022-09-13 14:06 ` Cezary Rojewski

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®