Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Linux: Kernel

[PATCH] pvrusb2: use NULL instead of 0

 

 

Linux kernel RSS feed   Index | Next | Previous | View Threaded


randy.dunlap at oracle

Oct 23, 2006, 8:28 PM

Post #1 of 2 (337 views)
Permalink
[PATCH] pvrusb2: use NULL instead of 0

From: Randy Dunlap <randy.dunlap [at] oracle>

Fix sparse NULL usage warnings:
drivers/media/video/pvrusb2/pvrusb2-v4l2.c:714:14: warning: Using plain integer as NULL pointer
drivers/media/video/pvrusb2/pvrusb2-v4l2.c:715:16: warning: Using plain integer as NULL pointer
drivers/media/video/pvrusb2/pvrusb2-v4l2.c:1079:10: warning: Using plain integer as NULL pointer
drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.c:224:58: warning: Using plain integer as NULL pointer

Signed-off-by: Randy Dunlap <randy.dunlap [at] oracle>
---
drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.c | 2 +-
drivers/media/video/pvrusb2/pvrusb2-v4l2.c | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)

--- linux-2.6.19-rc2-git8.orig/drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.c
+++ linux-2.6.19-rc2-git8/drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.c
@@ -221,7 +221,7 @@ static unsigned int decoder_describe(str
static void decoder_reset(struct pvr2_v4l_cx2584x *ctxt)
{
int ret;
- ret = pvr2_i2c_client_cmd(ctxt->client,VIDIOC_INT_RESET,0);
+ ret = pvr2_i2c_client_cmd(ctxt->client,VIDIOC_INT_RESET,NULL);
pvr2_trace(PVR2_TRACE_CHIPS,"i2c cx25840 decoder_reset (ret=%d)",ret);
}

--- linux-2.6.19-rc2-git8.orig/drivers/media/video/pvrusb2/pvrusb2-v4l2.c
+++ linux-2.6.19-rc2-git8/drivers/media/video/pvrusb2/pvrusb2-v4l2.c
@@ -711,8 +711,8 @@ static void pvr2_v4l2_dev_destroy(struct
dip->devbase.minor,pvr2_config_get_name(dip->config));

/* Paranoia */
- dip->v4lp = 0;
- dip->stream = 0;
+ dip->v4lp = NULL;
+ dip->stream = NULL;

/* Actual deallocation happens later when all internal references
are gone. */
@@ -1076,7 +1076,7 @@ struct pvr2_v4l2 *pvr2_v4l2_create(struc
vp->vdev = kmalloc(sizeof(*vp->vdev),GFP_KERNEL);
if (!vp->vdev) {
kfree(vp);
- return 0;
+ return NULL;
}
memset(vp->vdev,0,sizeof(*vp->vdev));
pvr2_channel_init(&vp->channel,mnp);


---
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/


vonbrand at inf

Oct 24, 2006, 7:21 AM

Post #2 of 2 (319 views)
Permalink
Re: [PATCH] pvrusb2: use NULL instead of 0 [In reply to]

Randy Dunlap <randy.dunlap [at] oracle> wrote:
> From: Randy Dunlap <randy.dunlap [at] oracle>
>
> Fix sparse NULL usage warnings:
> drivers/media/video/pvrusb2/pvrusb2-v4l2.c:714:14: warning: Using plain integer as NULL pointer
> drivers/media/video/pvrusb2/pvrusb2-v4l2.c:715:16: warning: Using plain integer as NULL pointer
> drivers/media/video/pvrusb2/pvrusb2-v4l2.c:1079:10: warning: Using plain integer as NULL pointer
> drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.c:224:58: warning: Using plain integer as NULL pointer
>
> Signed-off-by: Randy Dunlap <randy.dunlap [at] oracle>
> ---
> drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.c | 2 +-
> drivers/media/video/pvrusb2/pvrusb2-v4l2.c | 6 +++---
> 2 files changed, 4 insertions(+), 4 deletions(-)
>
> --- linux-2.6.19-rc2-git8.orig/drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.c
> +++ linux-2.6.19-rc2-git8/drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.c
> @@ -221,7 +221,7 @@ static unsigned int decoder_describe(str
> static void decoder_reset(struct pvr2_v4l_cx2584x *ctxt)
> {
> int ret;
> - ret = pvr2_i2c_client_cmd(ctxt->client,VIDIOC_INT_RESET,0);
> + ret = pvr2_i2c_client_cmd(ctxt->client,VIDIOC_INT_RESET,NULL);

Should be, per Coding-style:

ret = pvr2_i2c_client_cmd(ctxt->client, VIDIOC_INT_RESET, NULL);

There is more similar stuff in the patch. Why not clean that up in the
same sweep?
--
Dr. Horst H. von Brand User #22616 counter.li.org
Departamento de Informatica Fono: +56 32 2654431
Universidad Tecnica Federico Santa Maria +56 32 2654239
Casilla 110-V, Valparaiso, Chile Fax: +56 32 2797513
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

Linux kernel RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.