mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Rajan Vaja <rajan.vaja@gmail.com>
To: gregkh@linuxfoundation.org
Cc: carlos@cgarcia.org, mahfouz.saif.elyazal@gmail.com,
	rodriguez.twister@gmail.com, peter@hurleysoftware.com,
	devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: [PATCH v2 1/2] staging: fwserial: Fix pointer comparison to NULL checkpatch problem
Date: Tue,  1 Dec 2015 15:18:11 +0530	[thread overview]
Message-ID: <6ae18a9bd62089b98d64016bad121007f5ceaa39.1448961501.git.rajan.vaja@gmail.com> (raw)
In-Reply-To: <cover.1448961501.git.rajan.vaja@gmail.com>
In-Reply-To: <cover.1448961501.git.rajan.vaja@gmail.com>

Fix pointer comparison to NULL problem reported by checkpatch.

Signed-off-by: Rajan Vaja <rajan.vaja@gmail.com>
---
 drivers/staging/fwserial/dma_fifo.c |   10 +++++-----
 drivers/staging/fwserial/fwserial.c |    4 ++--
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/fwserial/dma_fifo.c b/drivers/staging/fwserial/dma_fifo.c
index 7a3347c..4cd3ed3 100644
--- a/drivers/staging/fwserial/dma_fifo.c
+++ b/drivers/staging/fwserial/dma_fifo.c
@@ -106,7 +106,7 @@ void dma_fifo_free(struct dma_fifo *fifo)
 {
 	struct dma_pending *pending, *next;

-	if (fifo->data == NULL)
+	if (!fifo->data)
 		return;

 	list_for_each_entry_safe(pending, next, &fifo->pending, link)
@@ -123,7 +123,7 @@ void dma_fifo_reset(struct dma_fifo *fifo)
 {
 	struct dma_pending *pending, *next;

-	if (fifo->data == NULL)
+	if (!fifo->data)
 		return;

 	list_for_each_entry_safe(pending, next, &fifo->pending, link)
@@ -149,7 +149,7 @@ int dma_fifo_in(struct dma_fifo *fifo, const void *src, int n)
 {
 	int ofs, l;

-	if (fifo->data == NULL)
+	if (!fifo->data)
 		return -ENOENT;
 	if (fifo->corrupt)
 		return -ENXIO;
@@ -192,7 +192,7 @@ int dma_fifo_out_pend(struct dma_fifo *fifo, struct dma_pending *pended)
 {
 	unsigned len, n, ofs, l, limit;

-	if (fifo->data == NULL)
+	if (!fifo->data)
 		return -ENOENT;
 	if (fifo->corrupt)
 		return -ENXIO;
@@ -252,7 +252,7 @@ int dma_fifo_out_complete(struct dma_fifo *fifo, struct dma_pending *complete)
 {
 	struct dma_pending *pending, *next, *tmp;

-	if (fifo->data == NULL)
+	if (!fifo->data)
 		return -ENOENT;
 	if (fifo->corrupt)
 		return -ENXIO;
diff --git a/drivers/staging/fwserial/fwserial.c b/drivers/staging/fwserial/fwserial.c
index b3ea4bb..38ba145 100644
--- a/drivers/staging/fwserial/fwserial.c
+++ b/drivers/staging/fwserial/fwserial.c
@@ -1701,7 +1701,7 @@ static void fwserial_virt_plug_complete(struct fwtty_peer *peer,
 	dma_fifo_change_tx_limit(&port->tx_fifo, port->max_payload);
 	spin_unlock_bh(&peer->port->lock);

-	if (port->port.console && port->fwcon_ops->notify != NULL)
+	if (port->port.console && port->fwcon_ops->notify)
 		(*port->fwcon_ops->notify)(FWCON_NOTIFY_ATTACH, port->con_data);

 	fwtty_info(&peer->unit, "peer (guid:%016llx) connected on %s\n",
@@ -1808,7 +1808,7 @@ static void fwserial_release_port(struct fwtty_port *port, bool reset)
 	RCU_INIT_POINTER(port->peer, NULL);
 	spin_unlock_bh(&port->lock);

-	if (port->port.console && port->fwcon_ops->notify != NULL)
+	if (port->port.console && port->fwcon_ops->notify)
 		(*port->fwcon_ops->notify)(FWCON_NOTIFY_DETACH, port->con_data);
 }

--
1.7.9.5


  reply	other threads:[~2015-12-01  9:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-01  9:48 [PATCH v2 0/2] Fix coding style problems reported by checkpatch Rajan Vaja
2015-12-01  9:48 ` Rajan Vaja [this message]
2016-02-08  3:36   ` [PATCH v2 1/2] staging: fwserial: Fix pointer comparison to NULL checkpatch problem Greg KH
2015-12-01  9:48 ` [PATCH v2 2/2] staging: fwserial: Fix no space after cast checkpatch issue Rajan Vaja

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=6ae18a9bd62089b98d64016bad121007f5ceaa39.1448961501.git.rajan.vaja@gmail.com \
    --to=rajan.vaja@gmail.com \
    --cc=carlos@cgarcia.org \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mahfouz.saif.elyazal@gmail.com \
    --cc=peter@hurleysoftware.com \
    --cc=rodriguez.twister@gmail.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

all inboxes | Powered by JetHome®