[PATCH] staging: sm750fb: Use kzalloc rather than kmalloc followed by memset with 0

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The semantic patch that makes this change is available
in scriptcoccinelle/api/alloc/kzalloc-simple.cocci.

Signed-off-by: Madhusudhanan Ravindran <mravindran04@xxxxxxxxx>
---
 drivers/staging/sm750fb/sm750.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index 8c260ee..d0b6f3f 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -1342,11 +1342,10 @@ static int __init lynxfb_setup(char * options)
 	pr_info("options:%s\n",options);
 
 	len = strlen(options) + 1;
-	g_settings = kmalloc(len,GFP_KERNEL);
+	g_settings = kzalloc(len, GFP_KERNEL);
 	if(!g_settings)
 		return -ENOMEM;
 
-	memset(g_settings,0,len);
 	tmp = g_settings;
 
 	/* 	Notes:
-- 
1.9.1

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux