From: Keyur Patel <iamkeyur96@gmail.com>
Cc: iamkeyur96@gmail.com, "James E.J. Bottomley" <jejb@linux.ibm.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>,
linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] scsi: aha1740: Use !x in place of NULL comparisons
Date: Thu, 11 Jul 2019 19:48:33 -0400 [thread overview]
Message-ID: <20190711234833.27475-1-iamkeyur96@gmail.com> (raw)
Change (x == NULL) to !x and (x != NULL) to x, to fix
following checkpatch.pl warnings:
CHECK: Comparison to NULL could be written "!x".
Signed-off-by: Keyur Patel <iamkeyur96@gmail.com>
---
drivers/scsi/aha1740.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/scsi/aha1740.c b/drivers/scsi/aha1740.c
index da4150c17781..ec81b7be0a60 100644
--- a/drivers/scsi/aha1740.c
+++ b/drivers/scsi/aha1740.c
@@ -385,7 +385,7 @@ static int aha1740_queuecommand_lck(struct scsi_cmnd * SCpnt,
SCpnt->host_scribble = dma_alloc_coherent (&host->edev->dev,
sizeof (struct aha1740_sg),
&sg_dma, GFP_ATOMIC);
- if(SCpnt->host_scribble == NULL) {
+ if (!(SCpnt->host_scribble)) {
printk(KERN_WARNING "aha1740: out of memory in queuecommand!\n");
return 1;
}
@@ -576,7 +576,7 @@ static int aha1740_probe (struct device *dev)
translation ? "en" : "dis");
shpnt = scsi_host_alloc(&aha1740_template,
sizeof(struct aha1740_hostdata));
- if(shpnt == NULL)
+ if (!shpnt)
goto err_release_region;
shpnt->base = 0;
--
2.22.0
next reply other threads:[~2019-07-11 23:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-11 23:48 Keyur Patel [this message]
2019-07-11 23:52 ` [PATCH] scsi: aha1740: Use !x in place of NULL comparisons James Bottomley
2019-07-12 0:38 ` Martin K. Petersen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190711234833.27475-1-iamkeyur96@gmail.com \
--to=iamkeyur96@gmail.com \
--cc=jejb@linux.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).