Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1648650

[PATCH 2/5] MIPS: smp-cps: Delete error messages for failed memory allocations in cps_prepare_cpus()

From SF Markus Elfring <elfring@users.sourceforge.net>
Newsgroups linux.kernel
Subject [PATCH 2/5] MIPS: smp-cps: Delete error messages for failed memory allocations in cps_prepare_cpus()
Date 2017-05-23 23:00 +0200
Message-ID <tKp4n-7w-33@gated-at.bofh.it> (permalink)
References <tKp4m-7w-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 23 May 2017 21:41:32 +0200

Omit two extra messages for memory allocation failures in this function.

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/mips/kernel/smp-cps.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/arch/mips/kernel/smp-cps.c b/arch/mips/kernel/smp-cps.c
index 36954ddd0b9f..bc8d7f6a62c2 100644
--- a/arch/mips/kernel/smp-cps.c
+++ b/arch/mips/kernel/smp-cps.c
@@ -171,7 +171,5 @@ static void __init cps_prepare_cpus(unsigned int max_cpus)
-	if (!mips_cps_core_bootcfg) {
-		pr_err("Failed to allocate boot config for %u cores\n", ncores);
+	if (!mips_cps_core_bootcfg)
 		goto err_out;
-	}
 
 	/* Allocate VPE boot configuration structs */
 	for (c = 0; c < ncores; c++) {
@@ -182,8 +180,5 @@ static void __init cps_prepare_cpus(unsigned int max_cpus)
-		if (!mips_cps_core_bootcfg[c].vpe_config) {
-			pr_err("Failed to allocate %u VPE boot configs\n",
-			       core_vpes);
+		if (!mips_cps_core_bootcfg[c].vpe_config)
 			goto err_out;
-		}
 	}
 
 	/* Mark this CPU as booted */
-- 
2.13.0

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/5] MIPS-kernel: Adjustments for some function  implementations SF Markus Elfring <elfring@users.sourceforge.net> - 2017-05-23 23:00 +0200
  [PATCH 2/5] MIPS: smp-cps: Delete error messages for failed memory  allocations in cps_prepare_cpus() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-05-23 23:00 +0200
  [PATCH 3/5] MIPS: VPE: Delete an error message for a failed memory  allocation in vpe_open() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-05-23 23:00 +0200
  [PATCH 5/5] MIPS: VPE: Adjust 13 checks for null pointers SF Markus Elfring <elfring@users.sourceforge.net> - 2017-05-23 23:00 +0200
  [PATCH 4/5] MIPS: VPE: Improve a size determination in two functions SF Markus Elfring <elfring@users.sourceforge.net> - 2017-05-23 23:00 +0200
  [PATCH 1/5] MIPS: pm-cps: Delete an error message for a failed memory  allocation in cps_pm_online_cpu() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-05-23 23:00 +0200
  Re: [PATCH 0/5] MIPS-kernel: Adjustments for some function  implementations Joe Perches <joe@perches.com> - 2017-05-23 23:20 +0200

csiph-web