Re: [1/3] block/ps3vram: Delete an error message for a failed memory allocation in ps3vram_cache_init()

2017-08-18 Thread Michael Ellerman
On Mon, 2017-08-07 at 20:09:20 UTC, Geoff Levand wrote:
> From: Markus Elfring 
> 
> Omit an extra message for a memory allocation failure in this function.
> 
> 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 
> Cc: Jim Paris 
> Cc: Jens Axboe 
> Signed-off-by: Geoff Levand 

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/fd1335e048a961ef63f7da1a0c8f39

cheers


[PATCH 1/3] block/ps3vram: Delete an error message for a failed memory allocation in ps3vram_cache_init()

2017-08-07 Thread Geoff Levand
From: Markus Elfring 

Omit an extra message for a memory allocation failure in this function.

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 
Cc: Jim Paris 
Cc: Jens Axboe 
Signed-off-by: Geoff Levand 
---
 drivers/block/ps3vram.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/block/ps3vram.c b/drivers/block/ps3vram.c
index e0e81cacd781..ba97d037279e 100644
--- a/drivers/block/ps3vram.c
+++ b/drivers/block/ps3vram.c
@@ -409,10 +409,8 @@ static int ps3vram_cache_init(struct ps3_system_bus_device 
*dev)
priv->cache.page_size = CACHE_PAGE_SIZE;
priv->cache.tags = kzalloc(sizeof(struct ps3vram_tag) *
   CACHE_PAGE_COUNT, GFP_KERNEL);
-   if (priv->cache.tags == NULL) {
-   dev_err(>core, "Could not allocate cache tags\n");
+   if (!priv->cache.tags)
return -ENOMEM;
-   }
 
dev_info(>core, "Created ram cache: %d entries, %d KiB each\n",
CACHE_PAGE_COUNT, CACHE_PAGE_SIZE / 1024);
-- 
2.11.0