thermal: armada: Fix -Wshift-negative-value
Subsystems (2)
PATCH 1/1 thermal: armada: Fix -Wshift-negative-value
Clang produces the following warning
drivers/thermal/armada_thermal.c:270:33: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
1 warning reg &= ~CONTROL1_TSEN_AVG_MASK <<CONTROL1_TSEN_AVG_SHIFT; generated
.
~~~~~~~~~~~~~~~~~~~~~~~ ^
CONTROL1_TSEN_AVG_SHIFT is defined to be zero.
Since shifting by zero does nothing this variable can be removed.
--- drivers/thermal/armada_thermal.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/thermal/armada_thermal.c +2 -3
@@ -53,7 +53,6 @@#define CONTROL0_TSEN_MODE_EXTERNAL 0x2#define CONTROL0_TSEN_MODE_MASK 0x3 -#define CONTROL1_TSEN_AVG_SHIFT 0#define CONTROL1_TSEN_AVG_MASK 0x7#define CONTROL1_EXT_TSEN_SW_RESET BIT(7)#define CONTROL1_EXT_TSEN_HW_RESETn BIT(8)
@@ -267,8 +266,8 @@ static void armada_cp110_init(struct platform_device *pdev,/* Average the output value over 2^1 = 2 samples */ regmap_read (priv->syscon, data->syscon_control1_off, ®); - reg &= ~CONTROL1_TSEN_AVG_MASK <<CONTROL1_TSEN_AVG_SHIFT ; - reg |=1 <<CONTROL1_TSEN_AVG_SHIFT ; + reg &= ~CONTROL1_TSEN_AVG_MASK ; + reg |=1 ;regmap_write (priv->syscon, data->syscon_control1_off, reg); }
Signature · 1 line
2.22.0.rc2.383.gf4fbbf30c2-goog
Quoted 7 lines · Nathan Huckleberry
Clang produces the following warning
drivers/thermal/armada_thermal.c:270:33: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
1 warning reg &= ~CONTROL1_TSEN_AVG_MASK <<CONTROL1_TSEN_AVG_SHIFT; generated
.
Quoted 8 lines
~~~~~~~~~~~~~~~~~~~~~~~ ^
CONTROL1_TSEN_AVG_SHIFTis defined to be zero.
Since shifting by zero does nothing this variable can be removed.
Quoted 28 lines
--- drivers/thermal/armada_thermal.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)drivers/thermal/armada_thermal.c +2
-3@@ -53,7 +53,6 @@#define CONTROL0_TSEN_MODE_EXTERNAL 0x2#define CONTROL0_TSEN_MODE_MASK 0x3 -#define CONTROL1_TSEN_AVG_SHIFT 0#define CONTROL1_TSEN_AVG_MASK 0x7#define CONTROL1_EXT_TSEN_SW_RESET BIT(7)#define CONTROL1_EXT_TSEN_HW_RESETn BIT(8)@@ -267,8 +266,8 @@ static void armada_cp110_init(struct platform_device *pdev,/* Average the output value over 2^1 = 2 samples */ regmap_read (priv->syscon, data->syscon_control1_off, ®); - reg &= ~CONTROL1_TSEN_AVG_MASK <<CONTROL1_TSEN_AVG_SHIFT ; - reg |=1 <<CONTROL1_TSEN_AVG_SHIFT ; + reg &= ~CONTROL1_TSEN_AVG_MASK ; + reg |=1 ;regmap_write (priv->syscon, data->syscon_control1_off, reg); }
Signature · 5 lines
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook | <http://twitter.com/#!/linaroorg> Twitter | <http://www.linaro.org/linaro-blog/> Blog
Following up to see if this patch is going to be accepted.
Quoted 2 lines · Nathan Huckleberry' via Clang Built Linux
Following up to see if this patch is going to be accepted.
Miquel is listed as the maintainer of this file in MAINTAINERS. Miquel, can you please pick this up? Otherwise Zhang, Eduardo, and Daniel are listed as maintainers for drivers/thermal/.
Signature · 2 lines
Thanks, ~Nick Desaulniers
Quoted 8 lines · Nick Desaulniers
Quoted 2 lines · Nathan Huckleberry' via Clang Built Linux
Following up to see if this patch is going to be accepted.
Miquel is listed as the maintainer of this file in
MAINTAINERS. Miquel, can you please pick this up? Otherwise Zhang, Eduardo, and Daniel are listed as maintainers fordrivers/thermal/.
I'm listed as reviewer, it is up to Zhang or Eduardo to take the patches.
Signature · 5 lines
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook | <http://twitter.com/#!/linaroorg> Twitter | <http://www.linaro.org/linaro-blog/> Blog
Hello,
Daniel Lezcano <[email protected]> wrote on Thu, 15 Aug 2019 01:06:21 +0200:
Quoted 13 lines · Nick Desaulniers
Quoted 8 lines
Quoted 2 lines · Nathan Huckleberry' via Clang Built Linux
Following up to see if this patch is going to be accepted.
Miquel is listed as the maintainer of this file in
MAINTAINERS. Miquel, can you please pick this up? Otherwise Zhang, Eduardo, and Daniel are listed as maintainers fordrivers/thermal/.I'm listed as reviewer, it is up to Zhang or Eduardo to take the patches.
Sorry for the delay, I don't manage a tree for this driver, I'll let Zhang or Eduardo take the patch with my
Thanks,
Miquèl
Zhang Rui
reviewerQuoted 22 lines · Miquel Raynal
Hello,
Daniel Lezcano <[email protected]> wrote on Thu, 15 Aug 2019 01:06:21 +0200:
Quoted 7 lines · Nick Desaulniers
Quoted 6 lines
Quoted 2 lines · Nathan Huckleberry' via Clang Built Linux
Following up to see if this patch is going to be accepted.
Quoted 9 lines
Quoted 4 lines
Miquel is listed as the maintainer of this file in
MAINTAINERS. Miquel, can you please pick this up? Otherwise Zhang, Eduardo, and
Daniel are listed as maintainers fordrivers/thermal/.I'm listed as reviewer, it is up to Zhang or Eduardo to take the patches.
Quoted 5 lines
Sorry for the delay, I don't manage a tree for this driver, I'll let Zhang or Eduardo take the patch with my
Acked-by Miquel Raynal <[email protected]>
Patch applied.
thanks,
rui
Quoted 3 lines
Thanks,
Miquèl
Quoted 27 lines · Zhang Rui
Quoted 25 lines · Miquel Raynal
Hello,
Daniel Lezcano <[email protected]> wrote on Thu, 15 Aug 2019 01:06:21 +0200:
Quoted 7 lines · Nick Desaulniers
Quoted 6 lines
Quoted 2 lines · Nathan Huckleberry' via Clang Built Linux
Following up to see if this patch is going to be accepted.
Quoted 9 lines
Quoted 4 lines
Miquel is listed as the maintainer of this file in
MAINTAINERS. Miquel, can you please pick this up? Otherwise Zhang, Eduardo, and
Daniel are listed as maintainers fordrivers/thermal/.I'm listed as reviewer, it is up to Zhang or Eduardo to take the patches.
Sorry for the delay, I don't manage a tree for this driver, I'll let Zhang or Eduardo take the patch with my
Quoted 7 lines
Quoted 2 lines
Acked-by Miquel Raynal <[email protected]>Patch applied.
thanks,
rui
Thanks Rui, did you push the branch? I guess I would have expected it in https://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux.git/log/?h=next?
I'm trying to track where this lands in
https://github.com/ClangBuiltLinux/linux/issues/532.
Signature · 2 lines
Thanks, ~Nick Desaulniers
Zhang Rui
reviewerQuoted 43 lines · Nick Desaulniers
Quoted 33 lines · Zhang Rui
Quoted 31 lines · Miquel Raynal
Hello,
Daniel Lezcano <[email protected]> wrote on Thu, 15 Aug 2019
01:06:21 +0200:Quoted 15 lines · Nick Desaulniers
Quoted 5 lines
On Tue, Aug 13, 2019 at 10:28 AM 'Nathan Huckleberry' via Clang
BuiltQuoted 1 line · Linux
Quoted 8 lines
Quoted 1 line
Following up to see if this patch is going to be accepted.
Miquel is listed as the maintainer of this file in
MAINTAINERS.
Miquel, can you please pick this up? Otherwise Zhang, Eduardo,
and
Daniel are listed as maintainers fordrivers/thermal/.Quoted 5 lines
I'm listed as reviewer, it is up to Zhang or Eduardo to take the
patches.Sorry for the delay, I don't manage a tree for this driver, I'll let
Zhang or Eduardo take the patch with myQuoted 7 lines
Quoted 2 lines
Acked-by Miquel Raynal <[email protected]>Patch applied.
thanks,
rui
Quoted 7 lines
Thanks Rui, did you push the branch? I guess I would have expected it
in
https://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux.git/log/?h=next
?
I'm trying to track where this lands in
https://github.com/ClangBuiltLinux/linux/issues/532.
Not yet. I will push it to kernel.org after I finish my internal build test.
thanks,
rui