[PATCH 1/3] ASoC: Intel: Skylake: remove comparison always false warning

From: Pierre-Louis Bossart
Date: Tue Jul 07 2020 - 15:23:29 EST


Fix W=1 warnings:

skl-sst-dsp.c: In function âskl_dsp_get_enabled_coresâ:
include/linux/bits.h:26:28: warning: comparison of unsigned expression
< 0 is always false [-Wtype-limits]

cast the core number to a long to avoid checking if an unsigned value
is lower than zero.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@xxxxxxxxxxxxxxx>
---
sound/soc/intel/skylake/skl-sst-dsp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/intel/skylake/skl-sst-dsp.c b/sound/soc/intel/skylake/skl-sst-dsp.c
index 225706d148d8..cb83b395f210 100644
--- a/sound/soc/intel/skylake/skl-sst-dsp.c
+++ b/sound/soc/intel/skylake/skl-sst-dsp.c
@@ -52,7 +52,7 @@ unsigned int skl_dsp_get_enabled_cores(struct sst_dsp *ctx)
unsigned int core_mask, en_cores_mask;
u32 val;

- core_mask = SKL_DSP_CORES_MASK(skl->cores.count);
+ core_mask = SKL_DSP_CORES_MASK((long)skl->cores.count);

val = sst_dsp_shim_read_unlocked(ctx, SKL_ADSP_REG_ADSPCS);

--
2.25.1