All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dafna Hirschfeld <dafna3@gmail.com>
To: gregkh@linuxfoundation.org
Cc: outreachy-kernel@googlegroups.com, dafna3@gmail.com
Subject: [PATCH 2/3] staging: mt7621-mmc: Fix comparison to NULL
Date: Sun, 30 Sep 2018 22:04:03 +0300	[thread overview]
Message-ID: <d4f88bd5e9d515c423f3cbe94d951970abe25b0e.1538333858.git.dafna3@gmail.com> (raw)
In-Reply-To: <cover.1538333858.git.dafna3@gmail.com>
In-Reply-To: <cover.1538333858.git.dafna3@gmail.com>

Replace comparisons of a variable 'x' to NULL with
either 'x' or '!x'.
Issues found with checkpatch.pl

Signed-off-by: Dafna Hirschfeld <dafna3@gmail.com>
---
 drivers/staging/mt7621-mmc/sd.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/mt7621-mmc/sd.c b/drivers/staging/mt7621-mmc/sd.c
index 8c32cec5950a..f2955fae7b28 100644
--- a/drivers/staging/mt7621-mmc/sd.c
+++ b/drivers/staging/mt7621-mmc/sd.c
@@ -851,8 +851,8 @@ static int msdc_do_request(struct mmc_host *mmc, struct mmc_request *mrq)
 #define SND_DAT 0
 #define SND_CMD 1
 
-	BUG_ON(mmc == NULL);
-	BUG_ON(mrq == NULL);
+	BUG_ON(!mmc);
+	BUG_ON(!mrq);
 
 	host->error = 0;
 
@@ -946,7 +946,7 @@ static int msdc_do_request(struct mmc_host *mmc, struct mmc_request *mrq)
 	}
 
 done:
-	if (data != NULL) {
+	if (data) {
 		host->data = NULL;
 		dma_unmap_sg(mmc_dev(mmc), data->sg, data->sg_len,
 			     mmc_get_dma_dir(data));
@@ -1638,7 +1638,7 @@ static irqreturn_t msdc_irq(int irq, void *dev_id)
 	}
 
 	/* transfer complete interrupt */
-	if (data != NULL) {
+	if (data) {
 		if (inten & MSDC_INT_XFER_COMPL) {
 			data->bytes_xfered = host->xfer_size;
 			complete(&host->xfer_done);
@@ -1661,7 +1661,7 @@ static irqreturn_t msdc_irq(int irq, void *dev_id)
 	}
 
 	/* command interrupts */
-	if ((cmd != NULL) && (intsts & cmdsts)) {
+	if (cmd && (intsts & cmdsts)) {
 		if ((intsts & MSDC_INT_CMDRDY) || (intsts & MSDC_INT_ACMDRDY) ||
 			(intsts & MSDC_INT_ACMD19_DONE)) {
 			u32 *rsp = &cmd->resp[0];
-- 
2.17.1



  parent reply	other threads:[~2018-09-30 19:04 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-30 19:04 [PATCH 0/3] *** Cleanup patches for mt7621-mmc staging driver *** Dafna Hirschfeld
2018-09-30 19:04 ` [PATCH 1/3] staging: mt7621-mmc: remove unnecessary braces from 'if' statements Dafna Hirschfeld
2018-09-30 20:18   ` [Outreachy kernel] " Julia Lawall
2018-10-01  7:57     ` Dafna Hirschfeld
2018-10-01  8:47       ` Julia Lawall
2018-10-02  8:24         ` Dafna Hirschfeld
2018-10-02  9:28           ` Himanshu Jha
2018-10-02  9:39             ` Julia Lawall
2018-10-03 18:10               ` Dafna Hirschfeld
2018-10-03 19:00                 ` Julia Lawall
2018-10-03 19:36                   ` Dafna Hirschfeld
2018-10-03 19:40                     ` Julia Lawall
2018-10-02 15:31             ` Dafna Hirschfeld
2018-10-02 20:05               ` Himanshu Jha
2018-10-02 20:17                 ` Vaishali Thakkar
2018-10-02 20:56                   ` Vaishali Thakkar
2018-10-02 20:24                 ` Julia Lawall
2018-09-30 19:04 ` Dafna Hirschfeld [this message]
2018-09-30 19:04 ` [PATCH 3/3] staging: mt7621-mmc: replace `printk` with preferred API Dafna Hirschfeld

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=d4f88bd5e9d515c423f3cbe94d951970abe25b0e.1538333858.git.dafna3@gmail.com \
    --to=dafna3@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=outreachy-kernel@googlegroups.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.