lkml.org 
[lkml]   [2017]   [Jun]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH 2/3] ARM: dmabounce: Delete an error message for a failed memory allocation in two functions
From
Date
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
\
 
 \ /
  Last update: 2017-06-01 18:03    [W:0.057 / U:0.096 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site