mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Helge Deller <deller@gmx.de>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org,
	linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] video: of: display_timing: Remove a redundant zeroing of memory
Date: Thu, 24 Mar 2022 07:38:08 +0100	[thread overview]
Message-ID: <4115b2c5-7f7f-2ef3-e368-b21766774b5c@gmx.de> (raw)
In-Reply-To: <99f22ad1068fbbbc95acea59871cd408cde2623d.1647981212.git.christophe.jaillet@wanadoo.fr>

On 3/22/22 21:33, Christophe JAILLET wrote:
> of_parse_display_timing() already call memset(0) on its 2nd argument, so
> there is no need to clear it explicitly before calling this function.
>
> Use kmalloc() instead of kzalloc() to save a few cycles.
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>

applied.

Thanks!
Helge

> ---
>  drivers/video/of_display_timing.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/video/of_display_timing.c b/drivers/video/of_display_timing.c
> index f93b6abbe258..bebd371c6b93 100644
> --- a/drivers/video/of_display_timing.c
> +++ b/drivers/video/of_display_timing.c
> @@ -199,7 +199,7 @@ struct display_timings *of_get_display_timings(const struct device_node *np)
>  		struct display_timing *dt;
>  		int r;
>
> -		dt = kzalloc(sizeof(*dt), GFP_KERNEL);
> +		dt = kmalloc(sizeof(*dt), GFP_KERNEL);
>  		if (!dt) {
>  			pr_err("%pOF: could not allocate display_timing struct\n",
>  				np);


      reply	other threads:[~2022-03-24  6:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-22 20:33 Christophe JAILLET
2022-03-24  6:38 ` Helge Deller [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=4115b2c5-7f7f-2ef3-e368-b21766774b5c@gmx.de \
    --to=deller@gmx.de \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®