From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752782Ab3BOFVi (ORCPT ); Fri, 15 Feb 2013 00:21:38 -0500 Received: from mout.gmx.net ([212.227.17.20]:60878 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751614Ab3BOFVX (ORCPT ); Fri, 15 Feb 2013 00:21:23 -0500 X-Authenticated: #12255092 X-Provags-ID: V01U2FsdGVkX19jTZlJpIBj9e1oRkU73Kfme0UA81eSBTqv/4RfT5 Jo/hm7U/Whq4hI From: Peter Huewe To: Rupesh Gujare Cc: Greg Kroah-Hartman , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, Peter Huewe Subject: [PATCH 6/7] staging/ozwpan: Fix sparse warning Using plain integer as NULL pointer Date: Fri, 15 Feb 2013 06:25:34 +0100 Message-Id: <1360905935-20601-6-git-send-email-peterhuewe@gmx.de> X-Mailer: git-send-email 1.7.8.6 In-Reply-To: <1360905935-20601-1-git-send-email-peterhuewe@gmx.de> References: <1360905935-20601-1-git-send-email-peterhuewe@gmx.de> X-Y-GMX-Trusted: 0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch fixes the warning "Using plain integer as NULL pointer", generated by sparse, by replacing the offending 0s with NULL. Signed-off-by: Peter Huewe --- drivers/staging/ozwpan/ozusbsvc.c | 22 +++++++++++----------- 1 files changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/staging/ozwpan/ozusbsvc.c b/drivers/staging/ozwpan/ozusbsvc.c index 8fa7f25..e12343e 100644 --- a/drivers/staging/ozwpan/ozusbsvc.c +++ b/drivers/staging/ozwpan/ozusbsvc.c @@ -34,7 +34,7 @@ */ int oz_usb_init(void) { - oz_event_log(OZ_EVT_SERVICE, 1, OZ_APPID_USB, 0, 0); + oz_event_log(OZ_EVT_SERVICE, 1, OZ_APPID_USB, NULL, 0); return oz_hcd_init(); } /*------------------------------------------------------------------------------ @@ -43,7 +43,7 @@ int oz_usb_init(void) */ void oz_usb_term(void) { - oz_event_log(OZ_EVT_SERVICE, 2, OZ_APPID_USB, 0, 0); + oz_event_log(OZ_EVT_SERVICE, 2, OZ_APPID_USB, NULL, 0); oz_hcd_term(); } /*------------------------------------------------------------------------------ @@ -54,8 +54,8 @@ int oz_usb_start(struct oz_pd *pd, int resume) { int rc = 0; struct oz_usb_ctx *usb_ctx; - struct oz_usb_ctx *old_ctx = 0; - oz_event_log(OZ_EVT_SERVICE, 3, OZ_APPID_USB, 0, resume); + struct oz_usb_ctx *old_ctx = NULL; + oz_event_log(OZ_EVT_SERVICE, 3, OZ_APPID_USB, NULL, resume); if (resume) { oz_trace("USB service resumed.\n"); return 0; @@ -65,7 +65,7 @@ int oz_usb_start(struct oz_pd *pd, int resume) * has a USB context then we will destroy it. */ usb_ctx = kzalloc(sizeof(struct oz_usb_ctx), GFP_ATOMIC); - if (usb_ctx == 0) + if (usb_ctx == NULL) return -ENOMEM; atomic_set(&usb_ctx->ref_count, 1); usb_ctx->pd = pd; @@ -76,7 +76,7 @@ int oz_usb_start(struct oz_pd *pd, int resume) */ spin_lock_bh(&pd->app_lock[OZ_APPID_USB-1]); old_ctx = pd->app_ctx[OZ_APPID_USB-1]; - if (old_ctx == 0) + if (old_ctx == NULL) pd->app_ctx[OZ_APPID_USB-1] = usb_ctx; oz_usb_get(pd->app_ctx[OZ_APPID_USB-1]); spin_unlock_bh(&pd->app_lock[OZ_APPID_USB-1]); @@ -98,10 +98,10 @@ int oz_usb_start(struct oz_pd *pd, int resume) oz_hcd_pd_reset(usb_ctx, usb_ctx->hport); } else { usb_ctx->hport = oz_hcd_pd_arrived(usb_ctx); - if (usb_ctx->hport == 0) { + if (usb_ctx->hport == NULL) { oz_trace("USB hub returned null port.\n"); spin_lock_bh(&pd->app_lock[OZ_APPID_USB-1]); - pd->app_ctx[OZ_APPID_USB-1] = 0; + pd->app_ctx[OZ_APPID_USB-1] = NULL; spin_unlock_bh(&pd->app_lock[OZ_APPID_USB-1]); oz_usb_put(usb_ctx); rc = -1; @@ -117,14 +117,14 @@ int oz_usb_start(struct oz_pd *pd, int resume) void oz_usb_stop(struct oz_pd *pd, int pause) { struct oz_usb_ctx *usb_ctx; - oz_event_log(OZ_EVT_SERVICE, 4, OZ_APPID_USB, 0, pause); + oz_event_log(OZ_EVT_SERVICE, 4, OZ_APPID_USB, NULL, pause); if (pause) { oz_trace("USB service paused.\n"); return; } spin_lock_bh(&pd->app_lock[OZ_APPID_USB-1]); usb_ctx = (struct oz_usb_ctx *)pd->app_ctx[OZ_APPID_USB-1]; - pd->app_ctx[OZ_APPID_USB-1] = 0; + pd->app_ctx[OZ_APPID_USB-1] = NULL; spin_unlock_bh(&pd->app_lock[OZ_APPID_USB-1]); if (usb_ctx) { unsigned long tout = jiffies + HZ; @@ -182,7 +182,7 @@ int oz_usb_heartbeat(struct oz_pd *pd) if (usb_ctx) oz_usb_get(usb_ctx); spin_unlock_bh(&pd->app_lock[OZ_APPID_USB-1]); - if (usb_ctx == 0) + if (usb_ctx == NULL) return rc; if (usb_ctx->stopped) goto done; -- 1.7.8.6