Commit 3d9562a6 authored by Fengguang Wu's avatar Fengguang Wu Committed by Greg Kroah-Hartman

staging: ozwpan: compare pointer to NULL rather than 0

Generated by: scripts/coccinelle/null/badzero.cocci
Signed-off-by: default avatarFengguang Wu <fengguang.wu@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 65bf58ce
...@@ -104,10 +104,10 @@ ssize_t oz_cdev_read(struct file *filp, char __user *buf, size_t count, ...@@ -104,10 +104,10 @@ ssize_t oz_cdev_read(struct file *filp, char __user *buf, size_t count,
if (pd) if (pd)
oz_pd_get(pd); oz_pd_get(pd);
spin_unlock_bh(&g_cdev.lock); spin_unlock_bh(&g_cdev.lock);
if (pd == 0) if (pd == NULL)
return -1; return -1;
ctx = oz_cdev_claim_ctx(pd); ctx = oz_cdev_claim_ctx(pd);
if (ctx == 0) if (ctx == NULL)
goto out2; goto out2;
n = ctx->rd_in - ctx->rd_out; n = ctx->rd_in - ctx->rd_out;
if (n < 0) if (n < 0)
...@@ -157,11 +157,11 @@ ssize_t oz_cdev_write(struct file *filp, const char __user *buf, size_t count, ...@@ -157,11 +157,11 @@ ssize_t oz_cdev_write(struct file *filp, const char __user *buf, size_t count,
if (pd) if (pd)
oz_pd_get(pd); oz_pd_get(pd);
spin_unlock_bh(&g_cdev.lock); spin_unlock_bh(&g_cdev.lock);
if (pd == 0) if (pd == NULL)
return -1; return -1;
eb = &pd->elt_buff; eb = &pd->elt_buff;
ei = oz_elt_info_alloc(eb); ei = oz_elt_info_alloc(eb);
if (ei == 0) { if (ei == NULL) {
count = 0; count = 0;
goto out; goto out;
} }
...@@ -410,7 +410,7 @@ int oz_cdev_start(struct oz_pd *pd, int resume) ...@@ -410,7 +410,7 @@ int oz_cdev_start(struct oz_pd *pd, int resume)
return 0; return 0;
} }
ctx = kzalloc(sizeof(struct oz_serial_ctx), GFP_ATOMIC); ctx = kzalloc(sizeof(struct oz_serial_ctx), GFP_ATOMIC);
if (ctx == 0) if (ctx == NULL)
return -ENOMEM; return -ENOMEM;
atomic_set(&ctx->ref_count, 1); atomic_set(&ctx->ref_count, 1);
ctx->tx_seq_num = 1; ctx->tx_seq_num = 1;
...@@ -424,7 +424,7 @@ int oz_cdev_start(struct oz_pd *pd, int resume) ...@@ -424,7 +424,7 @@ int oz_cdev_start(struct oz_pd *pd, int resume)
spin_unlock_bh(&pd->app_lock[OZ_APPID_SERIAL-1]); spin_unlock_bh(&pd->app_lock[OZ_APPID_SERIAL-1]);
} }
spin_lock(&g_cdev.lock); 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)) { (memcmp(pd->mac_addr, g_cdev.active_addr, ETH_ALEN) == 0)) {
oz_pd_get(pd); oz_pd_get(pd);
g_cdev.active_pd = pd; g_cdev.active_pd = pd;
...@@ -477,7 +477,7 @@ void oz_cdev_rx(struct oz_pd *pd, struct oz_elt *elt) ...@@ -477,7 +477,7 @@ void oz_cdev_rx(struct oz_pd *pd, struct oz_elt *elt)
int ix; int ix;
ctx = oz_cdev_claim_ctx(pd); ctx = oz_cdev_claim_ctx(pd);
if (ctx == 0) { if (ctx == NULL) {
oz_trace("Cannot claim serial context.\n"); oz_trace("Cannot claim serial context.\n");
return; return;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment