From: SF Markus Elfring <elfring@users.sourceforge.net>
To: oprofile-list@lists.sf.net, Robert Richter <rric@kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
kernel-janitors@vger.kernel.org, Wolfram Sang <wsa@the-dreams.de>
Subject: [PATCH 2/2] oprofile_perf: Delete error messages for a failed memory allocation in oprofile_perf_init()
Date: Sat, 13 May 2017 18:35:14 +0200 [thread overview]
Message-ID: <bcb24b7d-f046-63e2-7f17-49fcbc838353@users.sourceforge.net> (raw)
In-Reply-To: <8e408a15-7884-e9a1-0df2-a7419987c450@users.sourceforge.net>
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
prev parent reply other threads:[~2017-05-13 16:35 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-13 16:32 [PATCH 0/2] oprofile_perf: Adjustments for oprofile_perf_init() SF Markus Elfring
2017-05-13 16:33 ` [PATCH 1/2] oprofile_perf: Improve a size determination in oprofile_perf_init() SF Markus Elfring
2017-05-13 16:35 ` SF Markus Elfring [this message]
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=bcb24b7d-f046-63e2-7f17-49fcbc838353@users.sourceforge.net \
--to=elfring@users.sourceforge.net \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=oprofile-list@lists.sf.net \
--cc=rric@kernel.org \
--cc=wsa@the-dreams.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome