Open
Conversation
* 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.
* Fixes build with Clang.
In file included from drivers/pwm/pwm-pio-rp1.c:20:
include/linux/pio_rp1.h:283:42: error: implicit conversion from 'uint' (aka 'unsigned int') to 'uint16_t' (aka 'unsigned short') changes value from 4294967295 to 65535 [-Werror,-Wconstant-conversion]
283 | args.origin = (program->origin == -1) ? PIO_ORIGIN_ANY : program->origin;
| ~ ^~~~~~~~~~~~~~
include/linux/pio_rp1.h:44:27: note: expanded from macro 'PIO_ORIGIN_ANY'
44 | #define PIO_ORIGIN_ANY ((uint)(~0))
| ^~~~~~~~~~
include/linux/pio_rp1.h:312:42: error: implicit conversion from 'uint' (aka 'unsigned int') to 'uint16_t' (aka 'unsigned short') changes value from 4294967295 to 65535 [-Werror,-Wconstant-conversion]
312 | args.origin = (program->origin == -1) ? PIO_ORIGIN_ANY : program->origin;
| ~ ^~~~~~~~~~~~~~
include/linux/pio_rp1.h:44:27: note: expanded from macro 'PIO_ORIGIN_ANY'
44 | #define PIO_ORIGIN_ANY ((uint)(~0))
| ^~~~~~~~~~
2 errors 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.