]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/5.0.4/arm-s3c24xx-fix-boolean-expressions-in-osiris_dvs_notify.patch
Linux 5.0.4
[thirdparty/kernel/stable-queue.git] / releases / 5.0.4 / arm-s3c24xx-fix-boolean-expressions-in-osiris_dvs_notify.patch
CommitLineData
1d454ad7
GKH
1From e2477233145f2156434afb799583bccd878f3e9f Mon Sep 17 00:00:00 2001
2From: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
3Date: Thu, 3 Jan 2019 14:14:08 -0600
4Subject: ARM: s3c24xx: Fix boolean expressions in osiris_dvs_notify
5
6From: Gustavo A. R. Silva <gustavo@embeddedor.com>
7
8commit e2477233145f2156434afb799583bccd878f3e9f upstream.
9
10Fix boolean expressions by using logical AND operator '&&' instead of
11bitwise operator '&'.
12
13This issue was detected with the help of Coccinelle.
14
15Fixes: 4fa084af28ca ("ARM: OSIRIS: DVS (Dynamic Voltage Scaling) supoort.")
16Cc: stable@vger.kernel.org
17Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
18[krzk: Fix -Wparentheses warning]
19Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
20Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
21
22---
23 arch/arm/mach-s3c24xx/mach-osiris-dvs.c | 8 ++++----
24 1 file changed, 4 insertions(+), 4 deletions(-)
25
26--- a/arch/arm/mach-s3c24xx/mach-osiris-dvs.c
27+++ b/arch/arm/mach-s3c24xx/mach-osiris-dvs.c
28@@ -65,16 +65,16 @@ static int osiris_dvs_notify(struct noti
29
30 switch (val) {
31 case CPUFREQ_PRECHANGE:
32- if (old_dvs & !new_dvs ||
33- cur_dvs & !new_dvs) {
34+ if ((old_dvs && !new_dvs) ||
35+ (cur_dvs && !new_dvs)) {
36 pr_debug("%s: exiting dvs\n", __func__);
37 cur_dvs = false;
38 gpio_set_value(OSIRIS_GPIO_DVS, 1);
39 }
40 break;
41 case CPUFREQ_POSTCHANGE:
42- if (!old_dvs & new_dvs ||
43- !cur_dvs & new_dvs) {
44+ if ((!old_dvs && new_dvs) ||
45+ (!cur_dvs && new_dvs)) {
46 pr_debug("entering dvs\n");
47 cur_dvs = true;
48 gpio_set_value(OSIRIS_GPIO_DVS, 0);