]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.19.31/arm-s3c24xx-fix-boolean-expressions-in-osiris_dvs_notify.patch
Linux 4.14.108
[thirdparty/kernel/stable-queue.git] / releases / 4.19.31 / arm-s3c24xx-fix-boolean-expressions-in-osiris_dvs_notify.patch
1 From e2477233145f2156434afb799583bccd878f3e9f Mon Sep 17 00:00:00 2001
2 From: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
3 Date: Thu, 3 Jan 2019 14:14:08 -0600
4 Subject: ARM: s3c24xx: Fix boolean expressions in osiris_dvs_notify
5
6 From: Gustavo A. R. Silva <gustavo@embeddedor.com>
7
8 commit e2477233145f2156434afb799583bccd878f3e9f upstream.
9
10 Fix boolean expressions by using logical AND operator '&&' instead of
11 bitwise operator '&'.
12
13 This issue was detected with the help of Coccinelle.
14
15 Fixes: 4fa084af28ca ("ARM: OSIRIS: DVS (Dynamic Voltage Scaling) supoort.")
16 Cc: stable@vger.kernel.org
17 Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
18 [krzk: Fix -Wparentheses warning]
19 Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
20 Signed-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);