Skip to contentSkip to conversation

kmalloc + memset -> kzalloc conversion

PATCH New Deepak Saxena 1 participant 1 message Oct 1, 2005

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kmalloc + memset -> kzalloc conversion

drivers/cdrom/mcdx.c +1 -3
@@ -1085,7 +1085,7 @@ static int __init mcdx_init_drive(int dr
 
 	xtrace(INIT, "kmalloc space for stuffpt's\n");
 	xtrace(MALLOC, "init() malloc %d bytes\n", size);
-	if (!(stuffp = kmalloc(size, GFP_KERNEL))) {
+	if (!(stuffp = kzalloc(size, GFP_KERNEL))) {
 		xwarn("init() malloc failed\n");
 		return 1;
 	}
@@ -1101,8 +1101,6 @@ static int __init mcdx_init_drive(int dr
 	       sizeof(*stuffp), stuffp);
 
 	/* set default values */
-	memset(stuffp, 0, sizeof(*stuffp));
-
 	stuffp->present = 0;	/* this should be 0 already */
 	stuffp->toc = NULL;	/* this should be NULL already */
 
Signature · 3 lines
Deepak Saxena - [email protected] - http://www.plexity.net

Even a stopped clock gives the right time twice a day.