From: Fengguang Wu <fengguang.wu@intel.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Rupesh Gujare <rgujare@ozmodevices.com>,
Chris Kelly <ckelly@ozmodevices.com>,
devel@driverdev.osuosl.org, LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH] staging: ozwpan: compare pointer to NULL rather than 0
Date: Wed, 19 Sep 2012 09:37:32 +0800 [thread overview]
Message-ID: <20120919013732.GA15367@localhost> (raw)
Generated by: scripts/coccinelle/null/badzero.cocci
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
---
drivers/staging/ozwpan/ozcdev.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
--- linux.orig/drivers/staging/ozwpan/ozcdev.c 2012-09-19 09:33:20.887977986 +0800
+++ linux/drivers/staging/ozwpan/ozcdev.c 2012-09-19 09:33:32.383978265 +0800
@@ -104,10 +104,10 @@ ssize_t oz_cdev_read(struct file *filp,
if (pd)
oz_pd_get(pd);
spin_unlock_bh(&g_cdev.lock);
- if (pd == 0)
+ if (pd == NULL)
return -1;
ctx = oz_cdev_claim_ctx(pd);
- if (ctx == 0)
+ if (ctx == NULL)
goto out2;
n = ctx->rd_in - ctx->rd_out;
if (n < 0)
@@ -157,11 +157,11 @@ ssize_t oz_cdev_write(struct file *filp,
if (pd)
oz_pd_get(pd);
spin_unlock_bh(&g_cdev.lock);
- if (pd == 0)
+ if (pd == NULL)
return -1;
eb = &pd->elt_buff;
ei = oz_elt_info_alloc(eb);
- if (ei == 0) {
+ if (ei == NULL) {
count = 0;
goto out;
}
@@ -410,7 +410,7 @@ int oz_cdev_start(struct oz_pd *pd, int
return 0;
}
ctx = kzalloc(sizeof(struct oz_serial_ctx), GFP_ATOMIC);
- if (ctx == 0)
+ if (ctx == NULL)
return -ENOMEM;
atomic_set(&ctx->ref_count, 1);
ctx->tx_seq_num = 1;
@@ -424,7 +424,7 @@ int oz_cdev_start(struct oz_pd *pd, int
spin_unlock_bh(&pd->app_lock[OZ_APPID_SERIAL-1]);
}
spin_lock(&g_cdev.lock);
- if ((g_cdev.active_pd == 0) &&
+ if ((g_cdev.active_pd == NULL) &&
(memcmp(pd->mac_addr, g_cdev.active_addr, ETH_ALEN) == 0)) {
oz_pd_get(pd);
g_cdev.active_pd = pd;
@@ -477,7 +477,7 @@ void oz_cdev_rx(struct oz_pd *pd, struct
int ix;
ctx = oz_cdev_claim_ctx(pd);
- if (ctx == 0) {
+ if (ctx == NULL) {
oz_trace("Cannot claim serial context.\n");
return;
}
reply other threads:[~2012-09-19 1:37 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20120919013732.GA15367@localhost \
--to=fengguang.wu@intel.com \
--cc=ckelly@ozmodevices.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rgujare@ozmodevices.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.