[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1576566037-29837-1-git-send-email-zhangpan26@huawei.com>
Date: Tue, 17 Dec 2019 15:00:37 +0800
From: Pan Zhang <zhangpan26@...wei.com>
To: <zhangpan26@...wei.com>, <hushiyuan@...wei.com>,
<ulf.hansson@...aro.org>, <allison@...utok.net>,
<gregkh@...uxfoundation.org>, <tglx@...utronix.de>
CC: <linux-mmc@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: [PATCH] mmc: host: use kzalloc instead of kmalloc and memset
Signed-off-by: Pan Zhang <zhangpan26@...wei.com>
---
drivers/mmc/host/vub300.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/mmc/host/vub300.c b/drivers/mmc/host/vub300.c
index 6ced1b7..e893ced 100644
--- a/drivers/mmc/host/vub300.c
+++ b/drivers/mmc/host/vub300.c
@@ -1227,12 +1227,10 @@ static void __download_offload_pseudocode(struct vub300_mmc_host *vub300,
size -= 1;
if (interrupt_size < size) {
u16 xfer_length = roundup_to_multiple_of_64(interrupt_size);
- u8 *xfer_buffer = kmalloc(xfer_length, GFP_KERNEL);
+ u8 *xfer_buffer = kzalloc(xfer_length, GFP_KERNEL);
if (xfer_buffer) {
int retval;
memcpy(xfer_buffer, data, interrupt_size);
- memset(xfer_buffer + interrupt_size, 0,
- xfer_length - interrupt_size);
size -= interrupt_size;
data += interrupt_size;
retval =
--
2.7.4
Powered by blists - more mailing lists