All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] powerpc/eeh: Delete an error message for a failed memory allocation in two functions
@ 2017-08-04 14:46 ` SF Markus Elfring
  0 siblings, 0 replies; 6+ messages in thread
From: SF Markus Elfring @ 2017-08-04 14:46 UTC (permalink / raw)
  To: linuxppc-dev, Benjamin Herrenschmidt, Michael Ellerman,
	Paul Mackerras, Russell Currey
  Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 4 Aug 2017 16:37:56 +0200

Omit an extra message for a memory allocation failure in these functions.

This issue was detected by using the Coccinelle software.

Link: http://events.linuxfoundation.org/sites/events/files/slides/LCJ16-Refactor_Strings-WSang_0.pdf
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 arch/powerpc/kernel/eeh_dev.c   | 5 +----
 arch/powerpc/kernel/eeh_event.c | 5 ++---
 2 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/arch/powerpc/kernel/eeh_dev.c b/arch/powerpc/kernel/eeh_dev.c
index d6b2ca70d14d..2742ecbadf18 100644
--- a/arch/powerpc/kernel/eeh_dev.c
+++ b/arch/powerpc/kernel/eeh_dev.c
@@ -55,11 +55,8 @@ struct eeh_dev *eeh_dev_init(struct pci_dn *pdn)
 
 	/* Allocate EEH device */
 	edev = kzalloc(sizeof(*edev), GFP_KERNEL);
-	if (!edev) {
-		pr_warn("%s: out of memory\n",
-			__func__);
+	if (!edev)
 		return NULL;
-	}
 
 	/* Associate EEH device with OF node */
 	pdn->edev = edev;
diff --git a/arch/powerpc/kernel/eeh_event.c b/arch/powerpc/kernel/eeh_event.c
index accbf8b5fd46..c62bd90e038f 100644
--- a/arch/powerpc/kernel/eeh_event.c
+++ b/arch/powerpc/kernel/eeh_event.c
@@ -132,10 +132,9 @@ int eeh_send_failure_event(struct eeh_pe *pe)
 	struct eeh_event *event;
 
 	event = kzalloc(sizeof(*event), GFP_ATOMIC);
-	if (!event) {
-		pr_err("EEH: out of memory, event not handled\n");
+	if (!event)
 		return -ENOMEM;
-	}
+
 	event->pe = pe;
 
 	/* We may or may not be called in an interrupt context */
-- 
2.13.4

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

* [PATCH] powerpc/eeh: Delete an error message for a failed memory allocation in two functions
@ 2017-08-04 14:46 ` SF Markus Elfring
  0 siblings, 0 replies; 6+ messages in thread
From: SF Markus Elfring @ 2017-08-04 14:46 UTC (permalink / raw)
  To: linuxppc-dev, Benjamin Herrenschmidt, Michael Ellerman,
	Paul Mackerras, Russell Currey
  Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 4 Aug 2017 16:37:56 +0200

Omit an extra message for a memory allocation failure in these functions.

This issue was detected by using the Coccinelle software.

Link: http://events.linuxfoundation.org/sites/events/files/slides/LCJ16-Refactor_Strings-WSang_0.pdf
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 arch/powerpc/kernel/eeh_dev.c   | 5 +----
 arch/powerpc/kernel/eeh_event.c | 5 ++---
 2 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/arch/powerpc/kernel/eeh_dev.c b/arch/powerpc/kernel/eeh_dev.c
index d6b2ca70d14d..2742ecbadf18 100644
--- a/arch/powerpc/kernel/eeh_dev.c
+++ b/arch/powerpc/kernel/eeh_dev.c
@@ -55,11 +55,8 @@ struct eeh_dev *eeh_dev_init(struct pci_dn *pdn)
 
 	/* Allocate EEH device */
 	edev = kzalloc(sizeof(*edev), GFP_KERNEL);
-	if (!edev) {
-		pr_warn("%s: out of memory\n",
-			__func__);
+	if (!edev)
 		return NULL;
-	}
 
 	/* Associate EEH device with OF node */
 	pdn->edev = edev;
diff --git a/arch/powerpc/kernel/eeh_event.c b/arch/powerpc/kernel/eeh_event.c
index accbf8b5fd46..c62bd90e038f 100644
--- a/arch/powerpc/kernel/eeh_event.c
+++ b/arch/powerpc/kernel/eeh_event.c
@@ -132,10 +132,9 @@ int eeh_send_failure_event(struct eeh_pe *pe)
 	struct eeh_event *event;
 
 	event = kzalloc(sizeof(*event), GFP_ATOMIC);
-	if (!event) {
-		pr_err("EEH: out of memory, event not handled\n");
+	if (!event)
 		return -ENOMEM;
-	}
+
 	event->pe = pe;
 
 	/* We may or may not be called in an interrupt context */
-- 
2.13.4


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

* Re: powerpc/eeh: Delete an error message for a failed memory allocation in two functions
  2017-08-04 14:46 ` SF Markus Elfring
@ 2017-09-01 13:29   ` Michael Ellerman
  -1 siblings, 0 replies; 6+ messages in thread
From: Michael Ellerman @ 2017-09-01 13:29 UTC (permalink / raw)
  To: SF Markus Elfring, linuxppc-dev, Benjamin Herrenschmidt,
	Paul Mackerras, Russell Currey
  Cc: kernel-janitors, LKML

On Fri, 2017-08-04 at 14:46:51 UTC, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Fri, 4 Aug 2017 16:37:56 +0200
> 
> Omit an extra message for a memory allocation failure in these functions.
> 
> This issue was detected by using the Coccinelle software.
> 
> Link: http://events.linuxfoundation.org/sites/events/files/slides/LCJ16-Refactor_Strings-WSang_0.pdf
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/6ab41161b44a3b4d504ac29c9dd997

cheers

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

* Re: powerpc/eeh: Delete an error message for a failed memory allocation in two functions
@ 2017-09-01 13:29   ` Michael Ellerman
  0 siblings, 0 replies; 6+ messages in thread
From: Michael Ellerman @ 2017-09-01 13:29 UTC (permalink / raw)
  To: SF Markus Elfring, linuxppc-dev, Benjamin Herrenschmidt,
	Paul Mackerras, Russell Currey
  Cc: kernel-janitors, LKML

On Fri, 2017-08-04 at 14:46:51 UTC, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Fri, 4 Aug 2017 16:37:56 +0200
> 
> Omit an extra message for a memory allocation failure in these functions.
> 
> This issue was detected by using the Coccinelle software.
> 
> Link: http://events.linuxfoundation.org/sites/events/files/slides/LCJ16-Refactor_Strings-WSang_0.pdf
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/6ab41161b44a3b4d504ac29c9dd997

cheers

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

* Re: powerpc/eeh: Delete an error message for a failed memory allocation in two functions
  2017-09-01 13:29   ` Michael Ellerman
@ 2017-09-05 11:52     ` SF Markus Elfring
  -1 siblings, 0 replies; 6+ messages in thread
From: SF Markus Elfring @ 2017-09-05 11:52 UTC (permalink / raw)
  To: Michael Ellerman, linuxppc-dev
  Cc: Benjamin Herrenschmidt, Paul Mackerras, Russell Currey,
	kernel-janitors, LKML

> Applied to powerpc next, thanks.
> 
> https://git.kernel.org/powerpc/c/6ab41161b44a3b4d504ac29c9dd997

Thanks that you picked another update suggestion up.

* It might matter to mention that only one patch hunk was accepted in this case.

* Can it be that the adjusted commit subject does contain a typo at the moment?
  Would the wording “powerpc/eeh: Delete a message for an "out of memory error"
  (at init time)” be more appropriate there?

Regards,
Markus

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

* Re: powerpc/eeh: Delete an error message for a failed memory allocation in two functions
@ 2017-09-05 11:52     ` SF Markus Elfring
  0 siblings, 0 replies; 6+ messages in thread
From: SF Markus Elfring @ 2017-09-05 11:52 UTC (permalink / raw)
  To: Michael Ellerman, linuxppc-dev
  Cc: Benjamin Herrenschmidt, Paul Mackerras, Russell Currey,
	kernel-janitors, LKML

> Applied to powerpc next, thanks.
> 
> https://git.kernel.org/powerpc/c/6ab41161b44a3b4d504ac29c9dd997

Thanks that you picked another update suggestion up.

* It might matter to mention that only one patch hunk was accepted in this case.

* Can it be that the adjusted commit subject does contain a typo at the moment?
  Would the wording “powerpc/eeh: Delete a message for an "out of memory error"
  (at init time)” be more appropriate there?

Regards,
Markus

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

end of thread, other threads:[~2017-09-05 11:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-04 14:46 [PATCH] powerpc/eeh: Delete an error message for a failed memory allocation in two functions SF Markus Elfring
2017-08-04 14:46 ` SF Markus Elfring
2017-09-01 13:29 ` Michael Ellerman
2017-09-01 13:29   ` Michael Ellerman
2017-09-05 11:52   ` SF Markus Elfring
2017-09-05 11:52     ` SF Markus Elfring

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.