From: SF Markus Elfring <elfring@users.sourceforge.net>
To: linux-sh@vger.kernel.org, Rich Felker <dalias@libc.org>,
Yoshinori Sato <ysato@users.sourceforge.jp>
Cc: LKML <linux-kernel@vger.kernel.org>,
kernel-janitors@vger.kernel.org, Wolfram Sang <wsa@the-dreams.de>
Subject: [PATCH 2/2] sh-clk: Delete an error message for a failed memory allocation in two functions
Date: Tue, 16 May 2017 17:31:20 +0000 [thread overview]
Message-ID: <ba6c79d1-1d60-b20b-94b4-e9c31a80dd90@users.sourceforge.net> (raw)
In-Reply-To: <db01c452-5817-db62-bbde-c4c5cd232a3a@users.sourceforge.net>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 16 May 2017 19:05:36 +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>
---
drivers/sh/clk/cpg.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/sh/clk/cpg.c b/drivers/sh/clk/cpg.c
index f23464bbeb7c..b3afe5c4fa3b 100644
--- a/drivers/sh/clk/cpg.c
+++ b/drivers/sh/clk/cpg.c
@@ -253,7 +253,5 @@ static int __init sh_clk_div_register_ops(struct clk *clks, int nr,
- if (!freq_table) {
- pr_err("%s: unable to alloc memory\n", __func__);
+ if (!freq_table)
return -ENOMEM;
- }
for (k = 0; !ret && (k < nr); k++) {
clkp = clks + k;
@@ -474,7 +472,5 @@ int __init sh_clk_fsidiv_register(struct clk *clks, int nr)
- if (!map) {
- pr_err("%s: unable to alloc memory\n", __func__);
+ if (!map)
return -ENOMEM;
- }
/* clks[i].enable_reg came from SH_CLK_FSIDIV() */
map->phys = (phys_addr_t)clks[i].enable_reg;
--
2.13.0
prev parent reply other threads:[~2017-05-16 17:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-16 17:29 [PATCH 0/2] sh-clk: Adjustments for two function implementations SF Markus Elfring
2017-05-16 17:30 ` [PATCH 1/2] sh-clk: Improve a size determination in sh_clk_fsidiv_register() SF Markus Elfring
2017-05-16 17:31 ` 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=ba6c79d1-1d60-b20b-94b4-e9c31a80dd90@users.sourceforge.net \
--to=elfring@users.sourceforge.net \
--cc=dalias@libc.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sh@vger.kernel.org \
--cc=wsa@the-dreams.de \
--cc=ysato@users.sourceforge.jp \
/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;
as well as URLs for NNTP newsgroup(s).