Skip to contentSkip to conversation

mach-osiris-dvs.c : use "&&" (not "&") with bool operands

PATCH In review Ameen Ali 2 participants 2 messages Mar 13, 2015

Subsystems (2)
lore
Share & tools
lore

Ameen Ali

author
#0 lore raw

PATCH 10/10 mach-osiris-dvs.c : use "&&" (not "&") with bool operands

itwise AND ("&") was used
in logical expressions with operands having "bool" type. Replaced bitwise AND operators with logical AND.

Signed-off-by <[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 +4 -4
index ce2db23..e189836 100644
@@ -70,16 +70,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.1.0
#1 lore raw
Quoted 5 lines · Ameen Ali

itwise AND ("&") was used
in logical expressions with operands having "bool" type. Replaced bitwise AND operators with logical AND.

Signed-off-by <[email protected]

This line's messed up. The correct format is:
Signed-off-by: Full name <email>
Always use checkpatch to check the .patch for these kinds of issues. Also the Subject: is not properly formatted. Usually we do something like:
subsystem/architecture: bla bla bla
You can look at the 'git log' for examples and format it similarly.

Quoted 30 lines
---
 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
index ce2db23..e189836 100644
@@ -70,16 +70,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 · 2 lines
Thanks,
Giedrius