android_kernel_motorola_sm6375/drivers/soc
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Nathan Chancellor bca4a53ea7 soc/tegra: fuse: Fix bitwise vs. logical OR warning
[ Upstream commit a7083763619f7485ccdade160deb81737cf2732f ]

A new warning in clang points out two instances where boolean
expressions are being used with a bitwise OR instead of logical OR:

drivers/soc/tegra/fuse/speedo-tegra20.c:72:9: warning: use of bitwise '|' with boolean operands [-Wbitwise-instead-of-logical]
                reg = tegra_fuse_read_spare(i) |
                      ^~~~~~~~~~~~~~~~~~~~~~~~~~
                                               ||
drivers/soc/tegra/fuse/speedo-tegra20.c:72:9: note: cast one or both operands to int to silence this warning
drivers/soc/tegra/fuse/speedo-tegra20.c:87:9: warning: use of bitwise '|' with boolean operands [-Wbitwise-instead-of-logical]
                reg = tegra_fuse_read_spare(i) |
                      ^~~~~~~~~~~~~~~~~~~~~~~~~~
                                               ||
drivers/soc/tegra/fuse/speedo-tegra20.c:87:9: note: cast one or both operands to int to silence this warning
2 warnings generated.

The motivation for the warning is that logical operations short circuit
while bitwise operations do not.

In this instance, tegra_fuse_read_spare() is not semantically returning
a boolean, it is returning a bit value. Use u32 for its return type so
that it can be used with either bitwise or boolean operators without any
warnings.

Fixes: 25cd5a3914 ("ARM: tegra: Add speedo-based process identification")
Link: https://github.com/ClangBuiltLinux/linux/issues/1488
Suggested-by: Michał Mirosław <[email protected]>
Signed-off-by: Nathan Chancellor <[email protected]>
Reviewed-by: Nick Desaulniers <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
2021-12-22 09:29:37 +01:00
..
actions
amlogic
aspeed soc: aspeed: p2a-ctrl: Fix boundary check for mmap 2021-09-22 12:26:20 +02:00
atmel
bcm
dove
fsl soc: fsl: dpaa2-console: free buffer before returning from dpaa2_console_read 2021-11-17 09:48:45 +01:00
gemini
imx
ixp4xx soc: ixp4xx/qmgr: fix invalid __iomem access 2021-08-12 13:21:04 +02:00
lantiq
mediatek
qcom soc: qcom: mdt_loader: Drop PT_LOAD check on hash segment 2021-10-13 10:08:18 +02:00
renesas
rockchip soc: rockchip: ROCKCHIP_GRF should not default to y, unconditionally 2021-09-15 09:47:30 +02:00
samsung
sunxi
tegra soc/tegra: fuse: Fix bitwise vs. logical OR warning 2021-12-22 09:29:37 +01:00
ti
ux500
versatile
xilinx
zte
Kconfig
Makefile