All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] s390/dasd: Use kzalloc instead of kmalloc/memset
@ 2022-04-19  1:43 Haowen Bai
  2022-04-19  5:43 ` Sven Schnelle
  0 siblings, 1 reply; 5+ messages in thread
From: Haowen Bai @ 2022-04-19  1:43 UTC (permalink / raw)
  To: Stefan Haberland, Jan Hoeppner, Heiko Carstens, Vasily Gorbik,
	Alexander Gordeev, Christian Borntraeger, Sven Schnelle
  Cc: Haowen Bai, linux-s390, linux-kernel

Use kzalloc rather than duplicating its implementation, which
makes code simple and easy to understand.

Signed-off-by: Haowen Bai <baihaowen@meizu.com>
---
 drivers/s390/block/dasd_eckd.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/s390/block/dasd_eckd.c b/drivers/s390/block/dasd_eckd.c
index 8410a25a65c1..74a035c56c3e 100644
--- a/drivers/s390/block/dasd_eckd.c
+++ b/drivers/s390/block/dasd_eckd.c
@@ -1480,7 +1480,7 @@ static int dasd_eckd_pe_handler(struct dasd_device *device,
 {
 	struct pe_handler_work_data *data;
 
-	data = kmalloc(sizeof(*data), GFP_ATOMIC | GFP_DMA);
+	data = kzalloc(sizeof(*data), GFP_ATOMIC | GFP_DMA);
 	if (!data) {
 		if (mutex_trylock(&dasd_pe_handler_mutex)) {
 			data = pe_handler_worker;
@@ -1489,7 +1489,6 @@ static int dasd_eckd_pe_handler(struct dasd_device *device,
 			return -ENOMEM;
 		}
 	} else {
-		memset(data, 0, sizeof(*data));
 		data->isglobal = 0;
 	}
 	INIT_WORK(&data->worker, do_pe_handler_work);
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-04-29 12:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-19  1:43 [PATCH] s390/dasd: Use kzalloc instead of kmalloc/memset Haowen Bai
2022-04-19  5:43 ` Sven Schnelle
2022-04-19  6:05   ` [PATCH V2] " Haowen Bai
2022-04-20  6:44     ` Sven Schnelle
2022-04-29 12:52     ` Stefan Haberland

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.