Fix Clang 22 warnings#7299
Conversation
|
I agree with "fixup! drm/vc4: Assign 32 overlay planes to writeback only" I'll leave others to review the remaining patches. |
cc6a4fb to
2033fd9
Compare
|
These all look fine, although I'd like @pelwell to check the |
|
The PIO_ORIGIN_ANY change is going to need more thought by me, but I'm happy to merge the others now if you split it into a separate PR. |
* Fixes build with Clang.
drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c:1513:3: error: variable 'chan_flags_all' is uninitialized when used here [-Werror,-Wuninitialized]
1513 | chan_flags_all |= dw->chan_flags[i];
| ^~~~~~~~~~~~~~
drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c:1502:25: note: initialize the variable 'chan_flags_all' to silence this warning
1502 | uint32_t chan_flags_all;
| ^
| = 0
1 error generated.
* Fixes build with Clang.
drivers/gpu/drm/vc4/vc4_plane.c:2799:2: error: variable 'txp_crtc' is used uninitialized whenever 'for' loop exits because its condition is false [-Werror,-Wsometimes-uninitialized]
2799 | drm_for_each_crtc(crtc, drm) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/drm/drm_crtc.h:1312:2: note: expanded from macro 'drm_for_each_crtc'
1312 | list_for_each_entry(crtc, &(dev)->mode_config.crtc_list, head)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/list.h:783:7: note: expanded from macro 'list_for_each_entry'
783 | !list_entry_is_head(pos, head, member); \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/vc4/vc4_plane.c:2809:20: note: uninitialized use occurs here
2809 | drm_crtc_mask(txp_crtc);
| ^~~~~~~~
drivers/gpu/drm/vc4/vc4_plane.c:2799:2: note: remove the condition if it is always true
2799 | drm_for_each_crtc(crtc, drm) {
| ^
include/drm/drm_crtc.h:1312:2: note: expanded from macro 'drm_for_each_crtc'
1312 | list_for_each_entry(crtc, &(dev)->mode_config.crtc_list, head)
| ^
include/linux/list.h:783:7: note: expanded from macro 'list_for_each_entry'
783 | !list_entry_is_head(pos, head, member); \
| ^
drivers/gpu/drm/vc4/vc4_plane.c:2796:27: note: initialize the variable 'txp_crtc' to silence this warning
2796 | struct drm_crtc *txp_crtc;
| ^
| = NULL
1 error generated.
* Fixes build with Clang.
drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c:461:10: error: array index 18 is past the end of the array (that has type 'u8[1]' (aka 'unsigned char[1]')) [-Werror,-Warray-bounds]
461 | setbit(eventmask_msg->mask, BRCMF_E_ULP);
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/wireless/broadcom/brcm80211/brcmfmac/../include/brcmu_utils.h:37:30: note: expanded from macro 'setbit'
37 | #define setbit(a, i) (((u8 *)a)[(i)/NBBY] |= 1<<((i)%NBBY))
| ^ ~~~~~~~~
drivers/net/wireless/broadcom/brcm80211/brcmfmac/fweh.h:313:2: note: array 'mask' declared here
313 | u8 mask[1];
| ^
1 error generated.
…nk-up
* Fixes build with Clang.
drivers/pci/controller/pcie-brcmstb.c:1595:3: error: variable 'clkreq_cntl' is uninitialized when used here [-Werror,-Wuninitialized]
1595 | clkreq_cntl |= PCIE_MISC_HARD_PCIE_HARD_DEBUG_CLKREQ_DEBUG_ENABLE_MASK;
| ^~~~~~~~~~~
drivers/pci/controller/pcie-brcmstb.c:1578:17: note: initialize the variable 'clkreq_cntl' to silence this warning
1578 | u32 clkreq_cntl;
| ^
| = 0
1 error generated.
* Change SND_PIMIDI and SND_PISOUND_MICRO to select CRC8 instead of depend
on it.
* Fixes build with Clang.
sound/drivers/upisnd/upisnd_codec.c:741:6: error: variable 'ret' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized]
741 | if (adau->clk_src != ADAU1961_CLK_SRC_MCLK)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sound/drivers/upisnd/upisnd_codec.c:744:9: note: uninitialized use occurs here
744 | return ret;
| ^~~
sound/drivers/upisnd/upisnd_codec.c:741:2: note: remove the 'if' if its condition is always true
741 | if (adau->clk_src != ADAU1961_CLK_SRC_MCLK)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
742 | ret = snd_soc_dapm_add_routes(dapm, &adau1961_dapm_pll_route, 1);
sound/drivers/upisnd/upisnd_codec.c:739:9: note: initialize the variable 'ret' to silence this warning
739 | int ret;
| ^
| = 0
1 error generated.
* Fixes build with Clang.
sound/soc/bcm/hifiberry_studio_dac8x.c:770:41: error: equality comparison with extraneous parentheses [-Werror,-Wparentheses-equality]
770 | if ((priv->card_info.card_clk_options == 0x02)) {
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
sound/soc/bcm/hifiberry_studio_dac8x.c:770:41: note: remove extraneous parentheses around the comparison to silence this warning
770 | if ((priv->card_info.card_clk_options == 0x02)) {
| ~ ^ ~
sound/soc/bcm/hifiberry_studio_dac8x.c:770:41: note: use '=' to turn this equality comparison into an assignment
770 | if ((priv->card_info.card_clk_options == 0x02)) {
| ^~
| =
1 error generated.
2033fd9 to
e166a8c
Compare
|
Done. Split the
Not familiar with the code so not sure why Would |
|
Thanks for the merge! Couple of follow up questions.
|
|
This patch set fixes build warnings with Clang. These issues were observed when compiling code merged from this repository as part of Android kernel which is compiled using Clang 22 and
CONFIG_WERROR=yset.I also reproduced that these issues are present and resolved with this patch set when compiling the kernel from this repository (
rpi-6.18.ybranch) with Clang 22 both cross-compiling on Ubuntu host as well as natively on Raspberry Pi 5 using Raspberry Pi OS.Also fixed minor issue that
SND_PIMIDIandSND_PISOUND_MICROshould rather selectCRC8than depend on it. This likely works here as some other drivers already selectsCRC8. I generally don't compile the Android kernel withSND_PISOUND_MICROenabled but it doesn't get set in defconfig as there's also noCRC8set otherwise.