Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1642692 > unrolled thread
| Started by | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| First post | 2017-05-16 19:40 +0200 |
| Last post | 2017-05-16 19:40 +0200 |
| Articles | 2 — 1 participant |
Back to article view | Back to linux.kernel
[PATCH 0/2] sh-clk: Adjustments for two function implementations SF Markus Elfring <elfring@users.sourceforge.net> - 2017-05-16 19:40 +0200
[PATCH 2/2] sh-clk: Delete an error message for a failed memory allocation in two functions SF Markus Elfring <elfring@users.sourceforge.net> - 2017-05-16 19:40 +0200
| From | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| Date | 2017-05-16 19:40 +0200 |
| Subject | [PATCH 0/2] sh-clk: Adjustments for two function implementations |
| Message-ID | <tHOBY-6g-11@gated-at.bofh.it> |
From: Markus Elfring <elfring@users.sourceforge.net> Date: Tue, 16 May 2017 19:24:56 +0200 Two update suggestions were taken into account from static source code analysis. Markus Elfring (2): Improve a size determination in sh_clk_fsidiv_register() Delete an error message for a failed memory allocation in two functions drivers/sh/clk/cpg.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) -- 2.13.0
[toc] | [next] | [standalone]
| From | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| Date | 2017-05-16 19:40 +0200 |
| Subject | [PATCH 2/2] sh-clk: Delete an error message for a failed memory allocation in two functions |
| Message-ID | <tHOBY-6g-23@gated-at.bofh.it> |
| In reply to | #1642692 |
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
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web