staging: vt6655: s/kmalloc + memset / kzalloc
authorDevendra Naga <devendra.aaru@gmail.com>
Tue, 8 Jan 2013 17:52:34 +0000 (12:52 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 17 Jan 2013 21:17:03 +0000 (13:17 -0800)
replace kmalloc and subsequent memset with kzalloc
and drop the null checks and casts and clean the coding style a bit too

Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/vt6655/device.h

index 64d923c603e834b0fe923c7485553a33902ed075..e27244ce383e4f92865122027a5753e110ae47f9 100644 (file)
@@ -886,15 +886,9 @@ static inline PDEVICE_RD_INFO alloc_rd_info(void)
        return kzalloc(sizeof(DEVICE_RD_INFO), GFP_ATOMIC);
 }
 
-static inline PDEVICE_TD_INFO alloc_td_info(void) {
-    PDEVICE_TD_INFO  ptr;
-    ptr = (PDEVICE_TD_INFO)kmalloc((int)sizeof(DEVICE_TD_INFO), (int)GFP_ATOMIC);
-    if (ptr == NULL)
-        return NULL;
-    else {
-        memset(ptr,0,sizeof(DEVICE_TD_INFO));
-        return ptr;
-    }
+static inline PDEVICE_TD_INFO alloc_td_info(void)
+{
+       return kzalloc(sizeof(DEVICE_TD_INFO), GFP_ATOMIC);
 }
 
 /*---------------------  Export Functions  --------------------------*/