On Wed, Aug 09, 2023 at 01:41:18PM -0500, Pierre-Louis Bossart wrote:
On 8/9/23 13:12, Nathan Chancellor wrote:
Clang warns (or errors with CONFIG_WERROR):
sound/soc/sof/intel/hda.c:423:6: error: variable 'chip' is uninitialized when used here [-Werror,-Wuninitialized] 423 | if (chip && chip->check_sdw_wakeen_irq) | ^~~~ sound/soc/sof/intel/hda.c:418:39: note: initialize the variable 'chip' to silence this warning 418 | const struct sof_intel_dsp_desc *chip; | ^ | = NULL 1 error generated.
Add the missing initialization, following the pattern of the other irq functions.
Fixes: 9362ab78f175 ("ASoC: SOF: Intel: add abstraction for SoundWire wake-ups") Signed-off-by: Nathan Chancellor nathan@kernel.org
Indeed, thanks Nathan for flagging this obvious mistake. I must have done something wrong when extracting the patches.
Acked-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com
Thanks for the quick response!
That said, we DO compile with clang and there was no warning https://github.com/thesofproject/linux/actions/runs/5542372669/job/150108183...
Is this dependent on a specific version of clang? I'd like to make sure our tools and tests are updated.
It should not be, I can reproduce it with all the versions of clang that the kernel supports (11.x+).
Looking at your GitHub Actions files, I am not sure exporting CC works correctly so I don't think you are building with clang. If I do it locally:
$ export CC=clang
$ make -j$(nproc) defconfig
$ grep -E 'CONFIG_(CC_IS|CLANG|GCC)' .config CONFIG_CC_IS_GCC=y CONFIG_GCC_VERSION=130201 CONFIG_CLANG_VERSION=0 CONFIG_GCC11_NO_ARRAY_BOUNDS=y CONFIG_GCC_PLUGINS=y # CONFIG_GCC_PLUGIN_LATENT_ENTROPY is not set # CONFIG_GCC_PLUGIN_STACKLEAK is not set
$ make -j$(nproc) sound/soc/sof/intel/hda.o
$ head -1 sound/soc/sof/intel/.hda.o.cmd savedcmd_sound/soc/sof/intel/hda.o := gcc ...
This was brought up some time ago and Masahiro made a decent point that this might not be a desirable behavior change.
https://lore.kernel.org/CAK7LNAT6Yp3oemUxSst+htnmM-St8WmSv+UZ2x2XF23cw-kU-Q@...
Switching to passing CC via the actual make command should fix that.
Cheers, Nathan