linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH] powerpc/nvram: Replace kmalloc with kzalloc in the error message
@ 2020-05-29 18:50 Markus Elfring
  2020-06-02  2:57 ` Michael Ellerman
  0 siblings, 1 reply; 9+ messages in thread
From: Markus Elfring @ 2020-05-29 18:50 UTC (permalink / raw)
  To: Michael Ellerman, Liao Pingfang, linuxppc-dev
  Cc: Allison Randal, Anton Vorontsov, Benjamin Herrenschmidt,
	Colin Cross, Greg Kroah-Hartman, Kees Cook, Paul Mackerras,
	Thomas Gleixner, Tony Luck, Wang Liang, Xue Zhihong, Yi Wang,
	LKML, kernel-janitors

> 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.

How do you think about to take another look at a previous update suggestion
like the following?

powerpc/nvram: Delete three error messages for a failed memory allocation
https://patchwork.ozlabs.org/project/linuxppc-dev/patch/00845261-8528-d011-d3b8-e9355a231d3a@users.sourceforge.net/
https://lore.kernel.org/linuxppc-dev/00845261-8528-d011-d3b8-e9355a231d3a@users.sourceforge.net/
https://lore.kernel.org/patchwork/patch/752720/
https://lkml.org/lkml/2017/1/19/537

Regards,
Markus

^ permalink raw reply	[flat|nested] 9+ messages in thread
* [PATCH] powerpc/nvram: Replace kmalloc with kzalloc in the error message
@ 2020-05-29  1:02 Yi Wang
  2020-05-29  4:04 ` Michael Ellerman
  0 siblings, 1 reply; 9+ messages in thread
From: Yi Wang @ 2020-05-29  1:02 UTC (permalink / raw)
  To: mpe
  Cc: benh, paulus, keescook, anton, ccross, tony.luck, gregkh, tglx,
	allison, linuxppc-dev, linux-kernel, xue.zhihong, wang.yi59,
	wang.liang82, Liao Pingfang

From: Liao Pingfang <liao.pingfang@zte.com.cn>

Use kzalloc instead of kmalloc in the error message according to
the previous kzalloc() call.

Signed-off-by: Liao Pingfang <liao.pingfang@zte.com.cn>
---
 arch/powerpc/kernel/nvram_64.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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


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

end of thread, other threads:[~2020-06-03 13:19 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-29 18:50 [PATCH] powerpc/nvram: Replace kmalloc with kzalloc in the error message Markus Elfring
2020-06-02  2:57 ` Michael Ellerman
2020-06-02  5:01   ` Markus Elfring
2020-06-02 11:23     ` Michael Ellerman
2020-06-02 11:41       ` Dan Carpenter
2020-06-03 11:37         ` Michael Ellerman
2020-06-03 13:18           ` Dan Carpenter
  -- strict thread matches above, loose matches on Subject: below --
2020-05-29  1:02 Yi Wang
2020-05-29  4:04 ` Michael Ellerman

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).