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


Groups > linux.kernel > #1640957 > unrolled thread

[PATCH 0/2] oprofile_perf: Adjustments for oprofile_perf_init()

Started bySF Markus Elfring <elfring@users.sourceforge.net>
First post2017-05-13 18:40 +0200
Last post2017-05-13 18:40 +0200
Articles 2 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH 0/2] oprofile_perf: Adjustments for oprofile_perf_init() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-05-13 18:40 +0200
    [PATCH 2/2] oprofile_perf: Delete error messages for a failed memory  allocation in oprofile_perf_init() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-05-13 18:40 +0200

#1640957 — [PATCH 0/2] oprofile_perf: Adjustments for oprofile_perf_init()

FromSF Markus Elfring <elfring@users.sourceforge.net>
Date2017-05-13 18:40 +0200
Subject[PATCH 0/2] oprofile_perf: Adjustments for oprofile_perf_init()
Message-ID<tGIff-689-5@gated-at.bofh.it>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 13 May 2017 18:28:38 +0200

Two update suggestions were taken into account
from static source code analysis.

Markus Elfring (2):
  Improve a size determination
  Delete error messages for a failed memory allocation

 drivers/oprofile/oprofile_perf.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

-- 
2.12.3

[toc] | [next] | [standalone]


#1640958 — [PATCH 2/2] oprofile_perf: Delete error messages for a failed memory allocation in oprofile_perf_init()

FromSF Markus Elfring <elfring@users.sourceforge.net>
Date2017-05-13 18:40 +0200
Subject[PATCH 2/2] oprofile_perf: Delete error messages for a failed memory allocation in oprofile_perf_init()
Message-ID<tGIfg-689-7@gated-at.bofh.it>
In reply to#1640957
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 13 May 2017 18:08:07 +0200

Omit extra messages for a memory allocation failure 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>
---
 drivers/oprofile/oprofile_perf.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/oprofile/oprofile_perf.c b/drivers/oprofile/oprofile_perf.c
index 033f2c26f2ad..6de27b90b562 100644
--- a/drivers/oprofile/oprofile_perf.c
+++ b/drivers/oprofile/oprofile_perf.c
@@ -291,5 +291,3 @@ int __init oprofile_perf_init(struct oprofile_operations *ops)
-		pr_info("oprofile: failed to allocate %d "
-				"counters\n", num_counters);
 		ret = -ENOMEM;
 		num_counters = 0;
 		goto out;
@@ -299,8 +297,6 @@ int __init oprofile_perf_init(struct oprofile_operations *ops)
 		per_cpu(perf_events, cpu) = kcalloc(num_counters,
 				sizeof(struct perf_event *), GFP_KERNEL);
 		if (!per_cpu(perf_events, cpu)) {
-			pr_info("oprofile: failed to allocate %d perf events "
-					"for cpu %d\n", num_counters, cpu);
 			ret = -ENOMEM;
 			goto out;
 		}
-- 
2.12.3

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web