From: SF Markus Elfring <elfring@users.sourceforge.net>
To: linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
Russell King <linux@armlinux.org.uk>,
Tony Lindgren <tony@atomide.com>
Cc: kernel-janitors@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH 8/9] ARM: OMAP2+: SmartReflex: Delete an error message for a failed memory allocation in two functions
Date: Sat, 3 Jun 2017 20:34:07 +0200 [thread overview]
Message-ID: <13210fb0-3a22-07f5-0bc5-b338b1ccfdeb@users.sourceforge.net> (raw)
In-Reply-To: <e9d44aa5-9208-9ff3-46ec-cd58ac3f4696@users.sourceforge.net>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 3 Jun 2017 19:16:27 +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>
---
arch/arm/mach-omap2/sr_device.c | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/arch/arm/mach-omap2/sr_device.c b/arch/arm/mach-omap2/sr_device.c
index 65775c6e8c27..eef6935e0403 100644
--- a/arch/arm/mach-omap2/sr_device.c
+++ b/arch/arm/mach-omap2/sr_device.c
@@ -48,7 +48,5 @@ static void __init sr_set_nvalues(struct omap_volt_data *volt_data,
- if (!nvalue_table) {
- pr_err("OMAP: SmartReflex: cannot allocate memory for n-value table\n");
+ if (!nvalue_table)
return;
- }
for (i = 0, j = 0; i < count; i++) {
u32 v;
@@ -104,8 +102,5 @@ static int __init sr_dev_init(struct omap_hwmod *oh, void *user)
- if (!sr_data) {
- pr_err("%s: Unable to allocate memory for %s sr_data\n",
- __func__, oh->name);
+ if (!sr_data)
return -ENOMEM;
- }
sr_dev_attr = (struct omap_smartreflex_dev_attr *)oh->dev_attr;
if (!sr_dev_attr || !sr_dev_attr->sensor_voltdm_name) {
--
2.13.0
next prev parent reply other threads:[~2017-06-03 18:34 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-03 18:20 [PATCH 0/9] ARM: OMAP2+: Adjustments for seven function implementations SF Markus Elfring
2017-06-03 18:27 ` [PATCH 1/9] ARM: OMAP2+: Delete an error message for a failed memory allocation in omap_mcspi_init() SF Markus Elfring
2017-06-03 18:28 ` [PATCH 2/9] ARM: OMAP2+: Delete an error message for a failed memory allocation in two functions SF Markus Elfring
2017-06-03 18:29 ` [PATCH 3/9] ARM: OMAP2+: McBSP: Delete an unnecessary variable initialisation in omap_init_mcbsp() SF Markus Elfring
2017-06-03 18:30 ` [PATCH 4/9] ARM: OMAP2+: McBSP: Improve a size determination " SF Markus Elfring
2017-06-03 18:31 ` [PATCH 5/9] ARM: OMAP2+: McBSP: Delete an error message for a failed memory allocation " SF Markus Elfring
2017-06-03 18:32 ` [PATCH 6/9] ARM: OMAP2+: Improve a size determination in sr_dev_init() SF Markus Elfring
2017-06-03 18:33 ` [PATCH 7/9] ARM: OMAP2+: Use kcalloc() in sr_set_nvalues() SF Markus Elfring
2017-06-03 18:34 ` SF Markus Elfring [this message]
2017-06-03 18:36 ` [PATCH 9/9] ARM: OMAP2+: Delete an error message for a failed memory allocation in omap_timer_init() SF Markus Elfring
2017-06-07 6:51 ` [PATCH 0/9] ARM: OMAP2+: Adjustments for seven function implementations Tony Lindgren
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=13210fb0-3a22-07f5-0bc5-b338b1ccfdeb@users.sourceforge.net \
--to=elfring@users.sourceforge.net \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=tony@atomide.com \
/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).