From: Sven Schnelle <svens@linux.ibm.com>
To: Haowen Bai <baihaowen@meizu.com>
Cc: <agordeev@linux.ibm.com>, <borntraeger@linux.ibm.com>,
<gor@linux.ibm.com>, <hca@linux.ibm.com>,
<hoeppner@linux.ibm.com>, <linux-kernel@vger.kernel.org>,
<linux-s390@vger.kernel.org>, <sth@linux.ibm.com>
Subject: Re: [PATCH V2] s390/dasd: Use kzalloc instead of kmalloc/memset
Date: Wed, 20 Apr 2022 08:44:54 +0200 [thread overview]
Message-ID: <yt9dy200xnh5.fsf@linux.ibm.com> (raw)
In-Reply-To: <1650348310-18553-1-git-send-email-baihaowen@meizu.com> (Haowen Bai's message of "Tue, 19 Apr 2022 14:05:10 +0800")
Haowen Bai <baihaowen@meizu.com> writes:
> Use kzalloc rather than duplicating its implementation, which
> makes code simple and easy to understand.
>
> Signed-off-by: Haowen Bai <baihaowen@meizu.com>
> ---
> V1->V2: also remove the isglobal assigment above, so the whole else block
> could go away
>
> drivers/s390/block/dasd_eckd.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/drivers/s390/block/dasd_eckd.c b/drivers/s390/block/dasd_eckd.c
> index 8410a25a65c1..6b70f9dfff02 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;
> @@ -1488,9 +1488,6 @@ static int dasd_eckd_pe_handler(struct dasd_device *device,
> } else {
> return -ENOMEM;
> }
> - } else {
> - memset(data, 0, sizeof(*data));
> - data->isglobal = 0;
> }
> INIT_WORK(&data->worker, do_pe_handler_work);
> dasd_get_device(device);
Reviewed-by: Sven Schnelle <svens@linux.ibm.com>
next prev parent reply other threads:[~2022-04-20 6:45 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2022-04-29 12:52 ` Stefan Haberland
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=yt9dy200xnh5.fsf@linux.ibm.com \
--to=svens@linux.ibm.com \
--cc=agordeev@linux.ibm.com \
--cc=baihaowen@meizu.com \
--cc=borntraeger@linux.ibm.com \
--cc=gor@linux.ibm.com \
--cc=hca@linux.ibm.com \
--cc=hoeppner@linux.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=sth@linux.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.