From: elfring@users.sourceforge.net (SF Markus Elfring)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/3] ARM: dmabounce: Delete an error message for a failed memory allocation in two functions
Date: Thu, 1 Jun 2017 18:00:53 +0200 [thread overview]
Message-ID: <f03717c9-9cc8-d339-0e04-b6888a4ce90b@users.sourceforge.net> (raw)
In-Reply-To: <697e7810-d280-08f3-2a24-026ff41e15a3@users.sourceforge.net>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Thu, 1 Jun 2017 17:10:39 +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/common/dmabounce.c | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/arch/arm/common/dmabounce.c b/arch/arm/common/dmabounce.c
index fcdecb2de242..9ef7ab64b3d8 100644
--- a/arch/arm/common/dmabounce.c
+++ b/arch/arm/common/dmabounce.c
@@ -127,7 +127,5 @@ alloc_safe_buffer(struct dmabounce_device_info *device_info, void *ptr,
- if (buf == NULL) {
- dev_warn(dev, "%s: kmalloc failed\n", __func__);
+ if (!buf)
return NULL;
- }
buf->ptr = ptr;
buf->size = size;
@@ -491,8 +489,5 @@ int dmabounce_register_dev(struct device *dev, unsigned long small_buffer_size,
- if (!device_info) {
- dev_err(dev,
- "Could not allocated dmabounce_device_info\n");
+ if (!device_info)
return -ENOMEM;
- }
ret = dmabounce_init_pool(&device_info->small, dev,
"small_dmabounce_pool", small_buffer_size);
--
2.13.0
next prev parent reply other threads:[~2017-06-01 16:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-01 15:56 [PATCH 0/3] ARM: dmabounce: Adjustments for four function implementations SF Markus Elfring
2017-06-01 15:59 ` [PATCH 1/3] ARM: dmabounce: Improve a size determination in two functions SF Markus Elfring
2017-06-01 16:00 ` SF Markus Elfring [this message]
2017-06-01 16:02 ` [PATCH 3/3] ARM: dmabounce: Combine substrings for two messages SF Markus Elfring
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=f03717c9-9cc8-d339-0e04-b6888a4ce90b@users.sourceforge.net \
--to=elfring@users.sourceforge.net \
--cc=linux-arm-kernel@lists.infradead.org \
/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).