All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Ellerman <mpe@ellerman.id.au>
To: Yi Wang <wang.yi59@zte.com.cn>
Cc: benh@kernel.crashing.org, paulus@samba.org,
	keescook@chromium.org, anton@enomsg.org, ccross@android.com,
	tony.luck@intel.com, gregkh@linuxfoundation.org,
	tglx@linutronix.de, allison@lohutok.net,
	linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org,
	xue.zhihong@zte.com.cn, wang.yi59@zte.com.cn,
	wang.liang82@zte.com.cn, Liao Pingfang <liao.pingfang@zte.com.cn>
Subject: Re: [PATCH] powerpc/nvram: Replace kmalloc with kzalloc in the error message
Date: Fri, 29 May 2020 14:04:01 +1000	[thread overview]
Message-ID: <87r1v3idzi.fsf@mpe.ellerman.id.au> (raw)
In-Reply-To: <1590714135-15818-1-git-send-email-wang.yi59@zte.com.cn>

Yi Wang <wang.yi59@zte.com.cn> writes:
> From: Liao Pingfang <liao.pingfang@zte.com.cn>
>
> Use kzalloc instead of kmalloc in the error message according to
> the previous kzalloc() call.

Please just remove the message instead, it's a tiny allocation that's
unlikely to ever fail, and the caller will print an error anyway.

cheers

> diff --git a/arch/powerpc/kernel/nvram_64.c b/arch/powerpc/kernel/nvram_64.c
> index fb4f610..c3a0c8d 100644
> --- a/arch/powerpc/kernel/nvram_64.c
> +++ b/arch/powerpc/kernel/nvram_64.c
> @@ -892,7 +892,7 @@ loff_t __init nvram_create_partition(const char *name, int sig,
>  	/* Create our OS partition */
>  	new_part = kzalloc(sizeof(*new_part), GFP_KERNEL);
>  	if (!new_part) {
> -		pr_err("%s: kmalloc failed\n", __func__);
> +		pr_err("%s: kzalloc failed\n", __func__);
>  		return -ENOMEM;
>  	}
>  
> -- 
> 2.9.5

WARNING: multiple messages have this Message-ID (diff)
From: Michael Ellerman <mpe@ellerman.id.au>
To: Yi Wang <wang.yi59@zte.com.cn>
Cc: wang.yi59@zte.com.cn, tony.luck@intel.com, keescook@chromium.org,
	wang.liang82@zte.com.cn, gregkh@linuxfoundation.org,
	anton@enomsg.org, linux-kernel@vger.kernel.org, paulus@samba.org,
	Liao Pingfang <liao.pingfang@zte.com.cn>,
	xue.zhihong@zte.com.cn, ccross@android.com, tglx@linutronix.de,
	linuxppc-dev@lists.ozlabs.org, allison@lohutok.net
Subject: Re: [PATCH] powerpc/nvram: Replace kmalloc with kzalloc in the error message
Date: Fri, 29 May 2020 14:04:01 +1000	[thread overview]
Message-ID: <87r1v3idzi.fsf@mpe.ellerman.id.au> (raw)
In-Reply-To: <1590714135-15818-1-git-send-email-wang.yi59@zte.com.cn>

Yi Wang <wang.yi59@zte.com.cn> writes:
> From: Liao Pingfang <liao.pingfang@zte.com.cn>
>
> Use kzalloc instead of kmalloc in the error message according to
> the previous kzalloc() call.

Please just remove the message instead, it's a tiny allocation that's
unlikely to ever fail, and the caller will print an error anyway.

cheers

> diff --git a/arch/powerpc/kernel/nvram_64.c b/arch/powerpc/kernel/nvram_64.c
> index fb4f610..c3a0c8d 100644
> --- a/arch/powerpc/kernel/nvram_64.c
> +++ b/arch/powerpc/kernel/nvram_64.c
> @@ -892,7 +892,7 @@ loff_t __init nvram_create_partition(const char *name, int sig,
>  	/* Create our OS partition */
>  	new_part = kzalloc(sizeof(*new_part), GFP_KERNEL);
>  	if (!new_part) {
> -		pr_err("%s: kmalloc failed\n", __func__);
> +		pr_err("%s: kzalloc failed\n", __func__);
>  		return -ENOMEM;
>  	}
>  
> -- 
> 2.9.5

  reply	other threads:[~2020-05-29  4:03 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-29  1:02 [PATCH] powerpc/nvram: Replace kmalloc with kzalloc in the error message Yi Wang
2020-05-29  1:02 ` Yi Wang
2020-05-29  4:04 ` Michael Ellerman [this message]
2020-05-29  4:04   ` Michael Ellerman
2020-05-29 18:50 Markus Elfring
2020-05-29 18:50 ` Markus Elfring
2020-05-29 18:50 ` Markus Elfring
2020-06-02  2:57 ` Michael Ellerman
2020-06-02  2:57   ` Michael Ellerman
2020-06-02  2:57   ` Michael Ellerman
2020-06-02  5:01   ` Markus Elfring
2020-06-02  5:01     ` Markus Elfring
2020-06-02  5:01     ` Markus Elfring
2020-06-02 11:23     ` Michael Ellerman
2020-06-02 11:23       ` Michael Ellerman
2020-06-02 11:23       ` Michael Ellerman
2020-06-02 11:41       ` Dan Carpenter
2020-06-02 11:41         ` Dan Carpenter
2020-06-02 11:41         ` Dan Carpenter
2020-06-03 11:37         ` Michael Ellerman
2020-06-03 11:37           ` Michael Ellerman
2020-06-03 11:37           ` Michael Ellerman
2020-06-03 13:18           ` Dan Carpenter
2020-06-03 13:18             ` Dan Carpenter
2020-06-03 13:18             ` Dan Carpenter

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=87r1v3idzi.fsf@mpe.ellerman.id.au \
    --to=mpe@ellerman.id.au \
    --cc=allison@lohutok.net \
    --cc=anton@enomsg.org \
    --cc=benh@kernel.crashing.org \
    --cc=ccross@android.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=keescook@chromium.org \
    --cc=liao.pingfang@zte.com.cn \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=paulus@samba.org \
    --cc=tglx@linutronix.de \
    --cc=tony.luck@intel.com \
    --cc=wang.liang82@zte.com.cn \
    --cc=wang.yi59@zte.com.cn \
    --cc=xue.zhihong@zte.com.cn \
    /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.