aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/go7007/saa7134-go7007.c
diff options
context:
space:
mode:
authorJulia Lawall <julia@diku.dk>2010-05-13 22:00:05 +0200
committerGreg Kroah-Hartman <gregkh@suse.de>2010-05-14 14:02:56 -0700
commit7a6cb0d5497418599d2125b670926b75e673861c (patch)
treea698dc86695304ef6aefe4bc6d18fdad7f3770ee /drivers/staging/go7007/saa7134-go7007.c
parentStaging: udlfb: fix coding style issues (diff)
downloadlinux-dev-7a6cb0d5497418599d2125b670926b75e673861c.tar.xz
linux-dev-7a6cb0d5497418599d2125b670926b75e673861c.zip
Staging: Use kcalloc or kzalloc
Use kcalloc or kzalloc rather than the combination of kmalloc and memset. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ expression x,y,flags; statement S; type T; @@ x = - kmalloc + kcalloc ( - y * sizeof(T), + y, sizeof(T), flags); if (x == NULL) S -memset(x, 0, y * sizeof(T)); @@ expression x,size,flags; statement S; @@ -x = kmalloc(size,flags); +x = kzalloc(size,flags); if (x == NULL) S -memset(x, 0, size); // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk>
Diffstat (limited to 'drivers/staging/go7007/saa7134-go7007.c')
-rw-r--r--drivers/staging/go7007/saa7134-go7007.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/staging/go7007/saa7134-go7007.c b/drivers/staging/go7007/saa7134-go7007.c
index b25d7d2090e1..49f0d31c118a 100644
--- a/drivers/staging/go7007/saa7134-go7007.c
+++ b/drivers/staging/go7007/saa7134-go7007.c
@@ -440,10 +440,9 @@ static int saa7134_go7007_init(struct saa7134_dev *dev)
printk(KERN_DEBUG "saa7134-go7007: probing new SAA713X board\n");
- saa = kmalloc(sizeof(struct saa7134_go7007), GFP_KERNEL);
+ saa = kzalloc(sizeof(struct saa7134_go7007), GFP_KERNEL);
if (saa == NULL)
return -ENOMEM;
- memset(saa, 0, sizeof(struct saa7134_go7007));
/* Allocate a couple pages for receiving the compressed stream */
saa->top = (u8 *)get_zeroed_page(GFP_KERNEL);