diff options
author | Mike Isely <isely@pobox.com> | 2007-01-19 21:03:32 -0600 |
---|---|---|
committer | Mike Isely <isely@pobox.com> | 2007-01-19 21:03:32 -0600 |
commit | c9019059ca70298f81743eb39208252c18a14b0b (patch) | |
tree | b41c4831f0bb368353c179e0b060ec45735f5524 /linux/drivers/media/video/pvrusb2/pvrusb2-v4l2.c | |
parent | efd3dcb4eb48b258a8973455bfeda8d67111b8c8 (diff) | |
download | mediapointer-dvb-s2-c9019059ca70298f81743eb39208252c18a14b0b.tar.gz mediapointer-dvb-s2-c9019059ca70298f81743eb39208252c18a14b0b.tar.bz2 |
pvrusb2: Use kzalloc instead of kmalloc+memset pairs
From: Mike Isely <isely@pobox.com>
Signed-off-by: Mike Isely <isely@pobox.com>
Diffstat (limited to 'linux/drivers/media/video/pvrusb2/pvrusb2-v4l2.c')
-rw-r--r-- | linux/drivers/media/video/pvrusb2/pvrusb2-v4l2.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-v4l2.c b/linux/drivers/media/video/pvrusb2/pvrusb2-v4l2.c index 538f9a514..c600dcd2f 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-v4l2.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-v4l2.c @@ -930,11 +930,10 @@ static int pvr2_v4l2_open(struct inode *inode, struct file *file) return -EIO; } - fhp = kmalloc(sizeof(*fhp),GFP_KERNEL); + fhp = kzalloc(sizeof(*fhp),GFP_KERNEL); if (!fhp) { return -ENOMEM; } - memset(fhp,0,sizeof(*fhp)); init_waitqueue_head(&fhp->wait_data); fhp->dev_info = dip; @@ -1212,19 +1211,16 @@ struct pvr2_v4l2 *pvr2_v4l2_create(struct pvr2_context *mnp) { struct pvr2_v4l2 *vp; - vp = kmalloc(sizeof(*vp),GFP_KERNEL); + vp = kzalloc(sizeof(*vp),GFP_KERNEL); if (!vp) return vp; - memset(vp,0,sizeof(*vp)); - vp->dev_video = kmalloc(sizeof(*vp->dev_video),GFP_KERNEL); - vp->dev_radio = kmalloc(sizeof(*vp->dev_radio),GFP_KERNEL); + vp->dev_video = kzalloc(sizeof(*vp->dev_video),GFP_KERNEL); + vp->dev_radio = kzalloc(sizeof(*vp->dev_radio),GFP_KERNEL); if (!(vp->dev_video && vp->dev_radio)) { kfree(vp->dev_video); kfree(vp->dev_radio); kfree(vp); return NULL; } - memset(vp->dev_video,0,sizeof(*vp->dev_video)); - memset(vp->dev_radio,0,sizeof(*vp->dev_radio)); pvr2_channel_init(&vp->channel,mnp); pvr2_trace(PVR2_TRACE_STRUCT,"Creating pvr2_v4l2 id=%p",vp); |