Skip to contentSkip to conversation

staging: unisys: Remove unneeded parentheses on the right hand side of assignment

PATCH In review Janani Ravichandran 3 participants 5 messages Feb 11, 2016 – Feb 12, 2016 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: unisys: Remove unneeded parentheses on the right hand side of assignment

Remove parentheses around the right hand side of assignments as they are not needed. Semantic patch used:

@@
expression a, b, c;
@@

(
a = (b == c)
|
a =
- (
b
- )
)

---
 drivers/staging/unisys/visorinput/visorinput.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/unisys/visorinput/visorinput.c +1 -1
index 38d4d5b..b85dc21 100644
@@ -468,7 +468,7 @@ handle_locking_key(struct input_dev *visorinput_dev,
 		break;
 	}
 	if (led >= 0) {
-		int old_state = (test_bit(led, visorinput_dev->led) != 0);
+		int old_state = test_bit(led, visorinput_dev->led) != 0;
 
 		if (old_state != desired_state) {
 			input_report_key(visorinput_dev, keycode, 1);
Signature · 1 line
2.5.0
#1 lore raw
Quoted 26 lines · Janani Ravichandran

Remove parentheses around the right hand side of assignments as they are not needed. Semantic patch used:

@@
expression a, b, c;
@@

(
a = (b == c)
|
a =
- (
b
- )
)

---
 drivers/staging/unisys/visorinput/visorinput.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/unisys/visorinput/visorinput.c +0 -0
index 38d4d5b..b85dc21 100644

drivers/staging/unisys/visorinput/visorinput.c handle_locking_key(struct input_dev *visorinput_dev, · line 471

Quoted 5 lines
drivers/staging/unisys/visorinput/visorinput.c +1 -1
@@ -468,7 +468,7 @@ handle_locking_key(struct input_dev *visorinput_dev,
 		break;
 	}
 	if (led >= 0) {
-		int old_state = (test_bit(led, visorinput_dev->led) != 0);
+		int old_state = test_bit(led, visorinput_dev->led) != 0;

Maybe the parentheses are kind of nice in this case, due to the = on the right hand side.

julia

Quoted 13 lines
drivers/staging/unisys/visorinput/visorinput.c +0 -1
 		if (old_state != desired_state) {
 			input_report_key(visorinput_dev, keycode, 1);
--

2.5.0

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20160211211314.GA4118%40janani-Inspiron-3521.
For more options, visit https://groups.google.com/d/optout.

#2 lore raw
Quoted 40 lines · Julia Lawall
Quoted 16 lines · Janani Ravichandran

Remove parentheses around the right hand side of assignments as they are not needed. Semantic patch used:

@@
expression a, b, c;
@@

(
a = (b == c)
|
a =
- (
b
- )
)

Review

Quoted 6 lines
---
 drivers/staging/unisys/visorinput/visorinput.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
(quoted diff) +0 -0

b/drivers/staging/unisys/visorinput/visorinput.c

drivers/staging/unisys/visorinput/visorinput.c handle_locking_key(struct input_dev *visorinput_dev, · line 471

Quoted 9 lines

index 38d4d5b..b85dc21 100644

drivers/staging/unisys/visorinput/visorinput.c +1 -1
@@ -468,7 +468,7 @@ handle_locking_key(struct input_dev *visorinput_dev,
              break;
      }
      if (led >= 0) {
-             int old_state = (test_bit(led, visorinput_dev->led) != 0);
+             int old_state = test_bit(led, visorinput_dev->led) != 0;

Maybe the parentheses are kind of nice in this case, due to the = on the right hand side.

Quoted 1 line

You're right. I'll leave them as they are.

Janani.

Quoted 20 lines

julia

Quoted 8 lines
drivers/staging/unisys/visorinput/visorinput.c +0 -1
              if (old_state != desired_state) {
                      input_report_key(visorinput_dev, keycode, 1);
--

2.5.0

--
You received this message because you are subscribed to the Google

Groups "outreachy-kernel" group.

Quoted 1 line

To unsubscribe from this group and stop receiving emails from it, send

an email to [email protected].

Quoted 2 lines

To post to this group, send email to [email protected]. To view this discussion on the web visit

https://groups.google.com/d/msgid/outreachy-kernel/20160211211314.GA4118%40janani-Inspiron-3521
.

Quoted 2 lines

For more options, visit https://groups.google.com/d/optout.

maintainer
#3 lore raw
In reply to Janani Ravichandran
Quoted 2 lines · Janani Ravichandran

Remove parentheses around the right hand side of assignments as they are not needed. Semantic patch used:

<snip>

The subject you used was identical to the previous patch you sent, yet it modified different things, so I wouldn't be able to take this one.

Try putting the filename in the Subject: line if you do this again, something like:
Subject: [PATCH] staging: unisys: visorinput.c: Remove...

thanks,

greg k-h

#4 lore raw
Quoted 10 lines

The subject you used was identical to the previous patch you sent, yet it modified different things, so I wouldn't be able to take this one.

Try putting the filename in the Subject: line if you do this again, something like:
Subject: [PATCH] staging: unisys: visorinput.c: Remove...

Sure, I will do that next time.

Thanks,
Janani.

Quoted 6 lines

thanks,

greg k-h