[PATCH 1/4] staging: vt6655: s/kmalloc + memset/kzalloc in alloc_rd_info

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

 



replace kmalloc and memset if the pointer is valid with kzalloc,
and remove the check around the null pointer cases as we dont need it.

Signed-off-by: Devendra Naga <devendra.aaru@xxxxxxxxx>
---
 drivers/staging/vt6655/device.h |    9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/drivers/staging/vt6655/device.h b/drivers/staging/vt6655/device.h
index e54e00b..1a077f9 100644
--- a/drivers/staging/vt6655/device.h
+++ b/drivers/staging/vt6655/device.h
@@ -882,14 +882,7 @@ inline static bool device_get_ip(PSDevice pInfo) {
 
 
 static inline PDEVICE_RD_INFO alloc_rd_info(void) {
-    PDEVICE_RD_INFO  ptr;
-    ptr = (PDEVICE_RD_INFO)kmalloc((int)sizeof(DEVICE_RD_INFO), (int)GFP_ATOMIC);
-    if (ptr == NULL)
-        return NULL;
-    else {
-        memset(ptr,0,sizeof(DEVICE_RD_INFO));
-        return ptr;
-    }
+    return kzalloc(sizeof(DEVICE_RD_INFO), GFP_ATOMIC);
 }
 
 static inline PDEVICE_TD_INFO alloc_td_info(void) {
-- 
1.7.10.4

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/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