* [PATCH] isdn/hisax: Remove unnecessary parenthesis
@ 2018-09-20 4:05 Nathan Chancellor
2018-09-20 6:11 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Nathan Chancellor @ 2018-09-20 4:05 UTC (permalink / raw)
To: Karsten Keil, David S. Miller
Cc: netdev, linux-kernel, Nick Desaulniers, Nathan Chancellor
Clang warns when more than one set of parentheses are used for single
conditional statements:
drivers/isdn/hisax/w6692.c:627:30: warning: equality comparison with
extraneous parentheses [-Wparentheses-equality]
if ((cs->dc.w6692.ph_state == W_L1IND_DRD)) {
~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
drivers/isdn/hisax/w6692.c:627:30: note: remove extraneous parentheses
around the comparison to silence this warning
if ((cs->dc.w6692.ph_state == W_L1IND_DRD)) {
~ ^ ~
drivers/isdn/hisax/w6692.c:627:30: note: use '=' to turn this equality
comparison into an assignment
if ((cs->dc.w6692.ph_state == W_L1IND_DRD)) {
^~
=
1 warning generated.
Remove the parentheses to silence this warning.
Reported-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
---
drivers/isdn/hisax/w6692.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/isdn/hisax/w6692.c b/drivers/isdn/hisax/w6692.c
index c4be1644f5bb..bb8e4b7e34ea 100644
--- a/drivers/isdn/hisax/w6692.c
+++ b/drivers/isdn/hisax/w6692.c
@@ -624,7 +624,7 @@ W6692_l1hw(struct PStack *st, int pr, void *arg)
break;
case (HW_RESET | REQUEST):
spin_lock_irqsave(&cs->lock, flags);
- if ((cs->dc.w6692.ph_state == W_L1IND_DRD)) {
+ if (cs->dc.w6692.ph_state == W_L1IND_DRD) {
ph_command(cs, W_L1CMD_ECK);
spin_unlock_irqrestore(&cs->lock, flags);
} else {
--
2.19.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] isdn/hisax: Remove unnecessary parenthesis
2018-09-20 4:05 [PATCH] isdn/hisax: Remove unnecessary parenthesis Nathan Chancellor
@ 2018-09-20 6:11 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2018-09-20 6:11 UTC (permalink / raw)
To: natechancellor; +Cc: isdn, netdev, linux-kernel, ndesaulniers
From: Nathan Chancellor <natechancellor@gmail.com>
Date: Wed, 19 Sep 2018 21:05:23 -0700
> Clang warns when more than one set of parentheses are used for single
> conditional statements:
>
> drivers/isdn/hisax/w6692.c:627:30: warning: equality comparison with
> extraneous parentheses [-Wparentheses-equality]
> if ((cs->dc.w6692.ph_state == W_L1IND_DRD)) {
> ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
> drivers/isdn/hisax/w6692.c:627:30: note: remove extraneous parentheses
> around the comparison to silence this warning
> if ((cs->dc.w6692.ph_state == W_L1IND_DRD)) {
> ~ ^ ~
> drivers/isdn/hisax/w6692.c:627:30: note: use '=' to turn this equality
> comparison into an assignment
> if ((cs->dc.w6692.ph_state == W_L1IND_DRD)) {
> ^~
> =
> 1 warning generated.
>
> Remove the parentheses to silence this warning.
>
> Reported-by: Nick Desaulniers <ndesaulniers@google.com>
> Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Applied.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-09-20 6:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-20 4:05 [PATCH] isdn/hisax: Remove unnecessary parenthesis Nathan Chancellor
2018-09-20 6:11 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).