Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ARM: 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.

Fixes: 4fa084af28ca ("ARM: OSIRIS: DVS (Dynamic Voltage Scaling) supoort.")
Cc: stable@vger.kernel.org
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
[krzk: Fix -Wparentheses warning]
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>

authored by

Gustavo A. R. Silva and committed by
Krzysztof Kozlowski
e2477233 bfeffd15

+4 -4
+4 -4
arch/arm/mach-s3c24xx/mach-osiris-dvs.c
··· 65 65 66 66 switch (val) { 67 67 case CPUFREQ_PRECHANGE: 68 - if (old_dvs & !new_dvs || 69 - cur_dvs & !new_dvs) { 68 + if ((old_dvs && !new_dvs) || 69 + (cur_dvs && !new_dvs)) { 70 70 pr_debug("%s: exiting dvs\n", __func__); 71 71 cur_dvs = false; 72 72 gpio_set_value(OSIRIS_GPIO_DVS, 1); 73 73 } 74 74 break; 75 75 case CPUFREQ_POSTCHANGE: 76 - if (!old_dvs & new_dvs || 77 - !cur_dvs & new_dvs) { 76 + if ((!old_dvs && new_dvs) || 77 + (!cur_dvs && new_dvs)) { 78 78 pr_debug("entering dvs\n"); 79 79 cur_dvs = true; 80 80 gpio_set_value(OSIRIS_GPIO_DVS, 0);