Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
eth: yt6801: initialize variable 'pcie_msi_mask_bits' when pcie_cap_o…
…ffset Fix follow errors with clang-19: drivers/net/ethernet/motorcomm/yt6801/fuxi-gmac-net.c:983:6: error: variable 'pcie_msi_mask_bits' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized] 983 | if (pcie_cap_offset) { | ^~~~~~~~~~~~~~~ drivers/net/ethernet/motorcomm/yt6801/fuxi-gmac-net.c:994:43: note: uninitialized use occurs here 994 | pcie_msi_mask_bits = FXGMAC_SET_REG_BITS(pcie_msi_mask_bits, | ^~~~~~~~~~~~~~~~~~ drivers/net/ethernet/motorcomm/yt6801/fuxi-os.h:189:22: note: expanded from macro 'FXGMAC_SET_REG_BITS' 189 | typeof(var) _var = (var); \ | ^~~ drivers/net/ethernet/motorcomm/yt6801/fuxi-gmac-net.c:983:2: note: remove the 'if' if its condition is always true 983 | if (pcie_cap_offset) { | ^~~~~~~~~~~~~~~~~~~~ drivers/net/ethernet/motorcomm/yt6801/fuxi-gmac-net.c:979:24: note: initialize the variable 'pcie_msi_mask_bits' to silence this warning 979 | u32 pcie_msi_mask_bits; | ^ | = 0 drivers/net/ethernet/motorcomm/yt6801/fuxi-gmac-net.c:1014:6: error: variable 'pcie_msi_mask_bits' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized] 1014 | if (pcie_cap_offset) { | ^~~~~~~~~~~~~~~ drivers/net/ethernet/motorcomm/yt6801/fuxi-gmac-net.c:1025:43: note: uninitialized use occurs here 1025 | pcie_msi_mask_bits = FXGMAC_SET_REG_BITS(pcie_msi_mask_bits, | ^~~~~~~~~~~~~~~~~~ drivers/net/ethernet/motorcomm/yt6801/fuxi-os.h:189:22: note: expanded from macro 'FXGMAC_SET_REG_BITS' 189 | typeof(var) _var = (var); \ | ^~~ drivers/net/ethernet/motorcomm/yt6801/fuxi-gmac-net.c:1014:2: note: remove the 'if' if its condition is always true 1014 | if (pcie_cap_offset) { | ^~~~~~~~~~~~~~~~~~~~ drivers/net/ethernet/motorcomm/yt6801/fuxi-gmac-net.c:1010:24: note: initialize the variable 'pcie_msi_mask_bits' to silence this warning 1010 | u32 pcie_msi_mask_bits; | ^ | = 0 2 errors generated. Signed-off-by: WangYuli <[email protected]>
- Loading branch information