* [PATCH] pcmcia: Remove unnecessary parentheses
@ 2018-12-10 23:55 Nathan Chancellor
2019-01-26 19:12 ` Nathan Chancellor
0 siblings, 1 reply; 3+ messages in thread
From: Nathan Chancellor @ 2018-12-10 23:55 UTC (permalink / raw)
To: YOKOTA Hiroshi, James E.J. Bottomley, Martin K. Petersen
Cc: linux-scsi, linux-kernel, 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.
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
---
drivers/scsi/pcmcia/nsp_cs.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/scsi/pcmcia/nsp_cs.c b/drivers/scsi/pcmcia/nsp_cs.c
index f3230494a8c9..f28105b144fc 100644
--- a/drivers/scsi/pcmcia/nsp_cs.c
+++ b/drivers/scsi/pcmcia/nsp_cs.c
@@ -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);
--
2.20.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] pcmcia: Remove unnecessary parentheses
2018-12-10 23:55 [PATCH] pcmcia: Remove unnecessary parentheses Nathan Chancellor
@ 2019-01-26 19:12 ` Nathan Chancellor
2019-01-29 6:29 ` Martin K. Petersen
0 siblings, 1 reply; 3+ messages in thread
From: Nathan Chancellor @ 2019-01-26 19:12 UTC (permalink / raw)
To: YOKOTA Hiroshi, James E.J. Bottomley, Martin K. Petersen
Cc: linux-scsi, linux-kernel
On Mon, Dec 10, 2018 at 04:55:40PM -0700, Nathan Chancellor wrote:
> 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.
>
> Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
> ---
> drivers/scsi/pcmcia/nsp_cs.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/scsi/pcmcia/nsp_cs.c b/drivers/scsi/pcmcia/nsp_cs.c
> index f3230494a8c9..f28105b144fc 100644
> --- a/drivers/scsi/pcmcia/nsp_cs.c
> +++ b/drivers/scsi/pcmcia/nsp_cs.c
> @@ -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);
> --
> 2.20.0
>
Ping?
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] pcmcia: Remove unnecessary parentheses
2019-01-26 19:12 ` Nathan Chancellor
@ 2019-01-29 6:29 ` Martin K. Petersen
0 siblings, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2019-01-29 6:29 UTC (permalink / raw)
To: Nathan Chancellor
Cc: YOKOTA Hiroshi, James E.J. Bottomley, Martin K. Petersen,
linux-scsi, linux-kernel
Nathan,
>> 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.
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-01-29 6:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-10 23:55 [PATCH] pcmcia: Remove unnecessary parentheses Nathan Chancellor
2019-01-26 19:12 ` Nathan Chancellor
2019-01-29 6:29 ` Martin K. Petersen
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).