staging/ozwpan: Fix NULL vs zero in ozcdev.c (sparse warning)
This patch fixes the warning "Using plain integer as NULL pointer", generated by sparse, by replacing the offending 0s with NULL. If the initialization with NULL was unnecessary (due to unconditional assignment before first use) it was removed. Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
41ebb8a1c5
commit
bc501c551c
@ -97,7 +97,7 @@ ssize_t oz_cdev_read(struct file *filp, char __user *buf, size_t count,
|
||||
int ix;
|
||||
|
||||
struct oz_pd *pd;
|
||||
struct oz_serial_ctx *ctx = 0;
|
||||
struct oz_serial_ctx *ctx;
|
||||
|
||||
spin_lock_bh(&g_cdev.lock);
|
||||
pd = g_cdev.active_pd;
|
||||
@ -147,7 +147,7 @@ ssize_t oz_cdev_write(struct file *filp, const char __user *buf, size_t count,
|
||||
{
|
||||
struct oz_pd *pd;
|
||||
struct oz_elt_buf *eb;
|
||||
struct oz_elt_info *ei = 0;
|
||||
struct oz_elt_info *ei;
|
||||
struct oz_elt *elt;
|
||||
struct oz_app_hdr *app_hdr;
|
||||
struct oz_serial_ctx *ctx;
|
||||
@ -182,7 +182,7 @@ ssize_t oz_cdev_write(struct file *filp, const char __user *buf, size_t count,
|
||||
ctx->tx_seq_num = 1;
|
||||
spin_lock(&eb->lock);
|
||||
if (oz_queue_elt_info(eb, 0, 0, ei) == 0)
|
||||
ei = 0;
|
||||
ei = NULL;
|
||||
spin_unlock(&eb->lock);
|
||||
}
|
||||
spin_unlock_bh(&pd->app_lock[OZ_APPID_USB-1]);
|
||||
@ -217,7 +217,7 @@ static int oz_set_active_pd(u8 *addr)
|
||||
if (is_zero_ether_addr(addr)) {
|
||||
spin_lock_bh(&g_cdev.lock);
|
||||
pd = g_cdev.active_pd;
|
||||
g_cdev.active_pd = 0;
|
||||
g_cdev.active_pd = NULL;
|
||||
memset(g_cdev.active_addr, 0,
|
||||
sizeof(g_cdev.active_addr));
|
||||
spin_unlock_bh(&g_cdev.lock);
|
||||
@ -385,7 +385,7 @@ int oz_cdev_deregister(void)
|
||||
*/
|
||||
int oz_cdev_init(void)
|
||||
{
|
||||
oz_event_log(OZ_EVT_SERVICE, 1, OZ_APPID_SERIAL, 0, 0);
|
||||
oz_event_log(OZ_EVT_SERVICE, 1, OZ_APPID_SERIAL, NULL, 0);
|
||||
oz_app_enable(OZ_APPID_SERIAL, 1);
|
||||
return 0;
|
||||
}
|
||||
@ -394,7 +394,7 @@ int oz_cdev_init(void)
|
||||
*/
|
||||
void oz_cdev_term(void)
|
||||
{
|
||||
oz_event_log(OZ_EVT_SERVICE, 2, OZ_APPID_SERIAL, 0, 0);
|
||||
oz_event_log(OZ_EVT_SERVICE, 2, OZ_APPID_SERIAL, NULL, 0);
|
||||
oz_app_enable(OZ_APPID_SERIAL, 0);
|
||||
}
|
||||
/*------------------------------------------------------------------------------
|
||||
@ -403,8 +403,8 @@ void oz_cdev_term(void)
|
||||
int oz_cdev_start(struct oz_pd *pd, int resume)
|
||||
{
|
||||
struct oz_serial_ctx *ctx;
|
||||
struct oz_serial_ctx *old_ctx = 0;
|
||||
oz_event_log(OZ_EVT_SERVICE, 3, OZ_APPID_SERIAL, 0, resume);
|
||||
struct oz_serial_ctx *old_ctx;
|
||||
oz_event_log(OZ_EVT_SERVICE, 3, OZ_APPID_SERIAL, NULL, resume);
|
||||
if (resume) {
|
||||
oz_trace("Serial service resumed.\n");
|
||||
return 0;
|
||||
@ -440,22 +440,22 @@ int oz_cdev_start(struct oz_pd *pd, int resume)
|
||||
void oz_cdev_stop(struct oz_pd *pd, int pause)
|
||||
{
|
||||
struct oz_serial_ctx *ctx;
|
||||
oz_event_log(OZ_EVT_SERVICE, 4, OZ_APPID_SERIAL, 0, pause);
|
||||
oz_event_log(OZ_EVT_SERVICE, 4, OZ_APPID_SERIAL, NULL, pause);
|
||||
if (pause) {
|
||||
oz_trace("Serial service paused.\n");
|
||||
return;
|
||||
}
|
||||
spin_lock_bh(&pd->app_lock[OZ_APPID_SERIAL-1]);
|
||||
ctx = (struct oz_serial_ctx *)pd->app_ctx[OZ_APPID_SERIAL-1];
|
||||
pd->app_ctx[OZ_APPID_SERIAL-1] = 0;
|
||||
pd->app_ctx[OZ_APPID_SERIAL-1] = NULL;
|
||||
spin_unlock_bh(&pd->app_lock[OZ_APPID_SERIAL-1]);
|
||||
if (ctx)
|
||||
oz_cdev_release_ctx(ctx);
|
||||
spin_lock(&g_cdev.lock);
|
||||
if (pd == g_cdev.active_pd)
|
||||
g_cdev.active_pd = 0;
|
||||
g_cdev.active_pd = NULL;
|
||||
else
|
||||
pd = 0;
|
||||
pd = NULL;
|
||||
spin_unlock(&g_cdev.lock);
|
||||
if (pd) {
|
||||
oz_pd_put(pd);
|
||||
|
Loading…
x
Reference in New Issue
Block a user