Skip to contentSkip to conversation

pcmcia: Remove unnecessary parentheses

PATCH Applied Nathan Chancellor 2 participants 3 messages Dec 10, 2018 – Jan 29, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pcmcia: Remove unnecessary parentheses

Clang warns:

drivers/scsi/pcmcia/nsp_cs.c:1137:27: warning: equality comparison with extraneous parentheses [-Wparentheses-equality]

                if ((tmpSC->SCp.Message == MSG_COMMAND_COMPLETE)) {
                     ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~

drivers/scsi/pcmcia/nsp_cs.c:1137:27: note: remove extraneous parentheses around the comparison to silence this warning
if ((tmpSC->SCp.Message == MSG_COMMAND_COMPLETE)) {
~ ^ ~
drivers/scsi/pcmcia/nsp_cs.c:1137:27: note: use '=' to turn this equality comparison into an assignment

                if ((tmpSC->SCp.Message == MSG_COMMAND_COMPLETE)) {
                                        ^~
                                        =

1 warning generated.

---
 drivers/scsi/pcmcia/nsp_cs.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/scsi/pcmcia/nsp_cs.c +2 -1
index f3230494a8c9..f28105b144fc 100644
@@ -1134,7 +1134,8 @@ static irqreturn_t nspintr(int irq, void *dev_id)
 
 		//*sync_neg       = SYNC_NOT_YET;
 
-		if ((tmpSC->SCp.Message == MSG_COMMAND_COMPLETE)) {     /* all command complete and return status */
+		/* all command complete and return status */
+		if (tmpSC->SCp.Message == MSG_COMMAND_COMPLETE) {
 			tmpSC->result = (DID_OK		             << 16) |
 					((tmpSC->SCp.Message & 0xff) <<  8) |
 					((tmpSC->SCp.Status  & 0xff) <<  0);
Signature · 1 line
2.20.0
#1 lore raw
Quoted 39 lines · Nathan Chancellor

Clang warns:

drivers/scsi/pcmcia/nsp_cs.c:1137:27: warning: equality comparison with extraneous parentheses [-Wparentheses-equality]

                if ((tmpSC->SCp.Message == MSG_COMMAND_COMPLETE)) {
                     ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~

drivers/scsi/pcmcia/nsp_cs.c:1137:27: note: remove extraneous parentheses around the comparison to silence this warning
if ((tmpSC->SCp.Message == MSG_COMMAND_COMPLETE)) {
~ ^ ~
drivers/scsi/pcmcia/nsp_cs.c:1137:27: note: use '=' to turn this equality comparison into an assignment

                if ((tmpSC->SCp.Message == MSG_COMMAND_COMPLETE)) {
                                        ^~
                                        =

1 warning generated.

---
 drivers/scsi/pcmcia/nsp_cs.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/scsi/pcmcia/nsp_cs.c +2 -1
index f3230494a8c9..f28105b144fc 100644
@@ -1134,7 +1134,8 @@ static irqreturn_t nspintr(int irq, void *dev_id)
 
 		//*sync_neg       = SYNC_NOT_YET;
 
-		if ((tmpSC->SCp.Message == MSG_COMMAND_COMPLETE)) {     /* all command complete and return status */
+		/* all command complete and return status */
+		if (tmpSC->SCp.Message == MSG_COMMAND_COMPLETE) {
 			tmpSC->result = (DID_OK		             << 16) |
 					((tmpSC->SCp.Message & 0xff) <<  8) |
 					((tmpSC->SCp.Status  & 0xff) <<  0);
Signature · 1 line
2.20.0

Ping?

#2 lore raw

Nathan,

Quoted 4 lines
Quoted 4 lines

drivers/scsi/pcmcia/nsp_cs.c:1137:27: warning: equality comparison with extraneous parentheses [-Wparentheses-equality]

                if ((tmpSC->SCp.Message == MSG_COMMAND_COMPLETE)) {
                     ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~

Applied to 5.1/scsi-queue.

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering