[PATCH] drivers/staging/gdm72xx/gdm_sdio.c: Replace kmalloc+memset for kzalloc

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

 



Replace kmalloc+memset for kzalloc and cleanup related code.

To be applied after 47ad3428a1086af425447f763705e06b16ae905d:
[PATCH 5/9] drivers/staging/gdm72xx/gdm_sdio.c: Remove useless kfree

Signed-off-by: Peter Senna Tschudin <peter.senna@xxxxxxxxx>
---
 drivers/staging/gdm72xx/gdm_sdio.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/gdm72xx/gdm_sdio.c b/drivers/staging/gdm72xx/gdm_sdio.c
index a0621d9..2e1a964 100644
--- a/drivers/staging/gdm72xx/gdm_sdio.c
+++ b/drivers/staging/gdm72xx/gdm_sdio.c
@@ -91,14 +91,12 @@ static void free_tx_struct(struct sdio_tx *t)
 
 static struct sdio_rx *alloc_rx_struct(struct rx_cxt *rx)
 {
-	struct sdio_rx *r = NULL;
+	struct sdio_rx *r;
 
-	r = kmalloc(sizeof(*r), GFP_ATOMIC);
+	r = kzalloc(sizeof(*r), GFP_ATOMIC);
 	if (!r)
 		return NULL;
 
-	memset(r, 0, sizeof(*r));
-
 	r->rx_cxt = rx;
 
 	return r;
-- 
1.7.11.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