ARM: mach-s3c24xx: Fix boolean expressions in osiris_dvs_notify
Subsystems (3)
PATCH 1/1 ARM: mach-s3c24xx: Fix boolean expressions in osiris_dvs_notify
Fix boolean expressions by using logical AND operator '&&' instead of bitwise operator '&'.
This issue was detected with the help of Coccinelle.
--- arch/arm/mach-s3c24xx/mach-osiris-dvs.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
arch/arm/mach-s3c24xx/mach-osiris-dvs.c +4 -4
@@ -65,16 +65,16 @@ static int osiris_dvs_notify(struct notifier_block *nb,switch (val) {case CPUFREQ_PRECHANGE : -if (old_dvs & !new_dvs || - cur_dvs & !new_dvs) { +if (old_dvs && !new_dvs || + cur_dvs && !new_dvs) {pr_debug ("%s: exiting dvs\n" , __func__); cur_dvs = false;gpio_set_value (OSIRIS_GPIO_DVS ,1 ); }break ;case CPUFREQ_POSTCHANGE : -if (!old_dvs & new_dvs || - !cur_dvs & new_dvs) { +if (!old_dvs && new_dvs || + !cur_dvs && new_dvs) {pr_debug ("entering dvs\n" ); cur_dvs = true;gpio_set_value (OSIRIS_GPIO_DVS ,0 );
Signature · 1 line
2.20.1
Krzysztof Kozlowski
maintainerQuoted 18 lines · Gustavo A. R. Silva
Fix boolean expressions by using logical AND operator '&&' instead of bitwise operator '&'.
This issue was detected with the help of Coccinelle.
Fixes 4fa084af28ca ("ARM: OSIRIS: DVS (Dynamic Voltage Scaling) supoort.")Signed-off-by Gustavo A. R. Silva <[email protected]>--- arch/arm/mach-s3c24xx/mach-osiris-dvs.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)arch/arm/mach-s3c24xx/mach-osiris-dvs.c +0
-0
arch/arm/mach-s3c24xx/mach-osiris-dvs.c static int osiris_dvs_notify(struct notifier_block *nb, · line 69
Quoted 7 lines
arch/arm/mach-s3c24xx/mach-osiris-dvs.c +2
-2@@ -65,16 +65,16 @@ static int osiris_dvs_notify(struct notifier_block *nb,switch (val) {case CPUFREQ_PRECHANGE : -if (old_dvs & !new_dvs || - cur_dvs & !new_dvs) { +if (old_dvs && !new_dvs || + cur_dvs && !new_dvs) {
Technically the old code will work fine because all variables are bools (so 0 or 1). Therefore I am not sure whether this should be ported to stable.
Anyway the patch is itself okay and I will take it after merge window. Thanks!
Best regards,
Krzysztof
Quoted 10 lines · Gustavo A. R. Silva
Fix boolean expressions by using logical AND operator '&&' instead of bitwise operator '&'.
This issue was detected with the help of Coccinelle.
Fixes 4fa084af28ca ("ARM: OSIRIS: DVS (Dynamic Voltage Scaling) supoort.")Signed-off-by Gustavo A. R. Silva <[email protected]>--- arch/arm/mach-s3c24xx/mach-osiris-dvs.c | 8 ++++----
Thanks, applied with fixing up -Wparentheses warning. I think you should update your GCC.
Best regards,
Krzysztof
Hi Krzysztof,
Quoted 6 lines · Krzysztof Kozlowski
Quoted 5 lines · Gustavo A. R. Silva
Fix boolean expressions by using logical AND operator '&&' instead of bitwise operator '&'.
This issue was detected with the help of Coccinelle.
Quoted 9 lines
Quoted 5 lines
Fixes 4fa084af28ca ("ARM: OSIRIS: DVS (Dynamic Voltage Scaling) supoort.")Signed-off-by Gustavo A. R. Silva <[email protected]>--- arch/arm/mach-s3c24xx/mach-osiris-dvs.c | 8 ++++----Thanks, applied with fixing up -Wparentheses warning. I think you should update your GCC.
Thanks for that.
I wonder if you could take these too:
https://lore.kernel.org/lkml/418252fcd77472413ce15ac3df167e448a4defe9.1546667177.git.gustavo@embeddedor.com/
https://lore.kernel.org/lkml/2795c5ba939fe23dda6c86135d56e68433f7d68a.1546667177.git.gustavo@embeddedor.com/
Thanks
--
Gustavo
Krzysztof Kozlowski
maintainerQuoted 20 lines · Gustavo A. R. Silva
Hi Krzysztof,
Quoted 6 lines · Krzysztof Kozlowski
Quoted 5 lines · Gustavo A. R. Silva
Fix boolean expressions by using logical AND operator '&&' instead of bitwise operator '&'.
This issue was detected with the help of Coccinelle.
Quoted 9 lines
Quoted 5 lines
Fixes 4fa084af28ca ("ARM: OSIRIS: DVS (Dynamic Voltage Scaling) supoort.")Signed-off-by Gustavo A. R. Silva <[email protected]>--- arch/arm/mach-s3c24xx/mach-osiris-dvs.c | 8 ++++----Thanks, applied with fixing up -Wparentheses warning. I think you should update your GCC.
Quoted 6 lines
Thanks for that.
I wonder if you could take these too:
https://lore.kernel.org/lkml/418252fcd77472413ce15ac3df167e448a4defe9.1546667177.git.gustavo@embeddedor.com/
https://lore.kernel.org/lkml/2795c5ba939fe23dda6c86135d56e68433f7d68a.1546667177.git.gustavo@embeddedor.com/
Can't do. I am maintainer only for ARM/Samsung platform and these are for Integrator.
Best regards,
Krzysztof
Quoted 9 lines · Krzysztof Kozlowski
Quoted 5 lines
I wonder if you could take these too:
https://lore.kernel.org/lkml/418252fcd77472413ce15ac3df167e448a4defe9.1546667177.git.gustavo@embeddedor.com/
https://lore.kernel.org/lkml/2795c5ba939fe23dda6c86135d56e68433f7d68a.1546667177.git.gustavo@embeddedor.com/Can't do. I am maintainer only for ARM/Samsung platform and these are for Integrator.
Oh Okay. I got it.
Thanks
--
Gustavo