linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: Fuqian Huang <huangfq.daxian@gmail.com>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Len Brown <len.brown@intel.com>,
	linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 43/87] kernel: power: replace kmalloc and memset with kzalloc
Date: Thu, 27 Jun 2019 21:56:08 +0200	[thread overview]
Message-ID: <20190627195607.GA17039@amd> (raw)
In-Reply-To: <20190627174048.4234-1-huangfq.daxian@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 805 bytes --]

On Fri 2019-06-28 01:40:48, Fuqian Huang wrote:
> kmalloc + memset(0) -> kzalloc
> 
> Signed-off-by: Fuqian Huang <huangfq.daxian@gmail.com>

Acked-by: Pavel Machek <pavel@ucw.cz>

> @@ -974,12 +974,11 @@ static int get_swap_reader(struct swap_map_handle *handle,
>  	last = handle->maps = NULL;
>  	offset = swsusp_header->image;
>  	while (offset) {
> -		tmp = kmalloc(sizeof(*handle->maps), GFP_KERNEL);
> +		tmp = kzalloc(sizeof(*handle->maps), GFP_KERNEL);
>  		if (!tmp) {
>  			release_swap_reader(handle);
>  			return -ENOMEM;
>  		}
> -		memset(tmp, 0, sizeof(*tmp));
>  		if (!handle->maps)
>  			handle->maps = tmp;
>  		if (last)

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

      reply	other threads:[~2019-06-27 19:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-27 17:40 [PATCH 43/87] kernel: power: replace kmalloc and memset with kzalloc Fuqian Huang
2019-06-27 19:56 ` Pavel Machek [this message]

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=20190627195607.GA17039@amd \
    --to=pavel@ucw.cz \
    --cc=huangfq.daxian@gmail.com \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).