linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] block/ps3vram: Delete an error message for a failed memory allocation in ps3vram_cache_init()
@ 2017-08-07 10:52 SF Markus Elfring
  2017-08-07 15:10 ` Geoff Levand
  0 siblings, 1 reply; 11+ messages in thread
From: SF Markus Elfring @ 2017-08-07 10:52 UTC (permalink / raw)
  To: linuxppc-dev, Benjamin Herrenschmidt, Geoff Levand,
	Michael Ellerman, Paul Mackerras
  Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 7 Aug 2017 12:37:01 +0200

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 <elfring@users.sourceforge.net>
---
 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(&dev->core, "Could not allocate cache tags\n");
+	if (!priv->cache.tags)
 		return -ENOMEM;
-	}
 
 	dev_info(&dev->core, "Created ram cache: %d entries, %d KiB each\n",
 		CACHE_PAGE_COUNT, CACHE_PAGE_SIZE / 1024);
-- 
2.13.4

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2017-08-08  8:38 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-07 10:52 [PATCH] block/ps3vram: Delete an error message for a failed memory allocation in ps3vram_cache_init() SF Markus Elfring
2017-08-07 15:10 ` Geoff Levand
2017-08-07 15:13   ` Joe Perches
2017-08-07 16:27   ` SF Markus Elfring
2017-08-07 18:28     ` Geoff Levand
2017-08-07 18:34       ` SF Markus Elfring
2017-08-07 18:49         ` Geoff Levand
2017-08-07 19:04           ` SF Markus Elfring
2017-08-07 20:17             ` Geoff Levand
2017-08-08  8:23               ` SF Markus Elfring
2017-08-08  2:13             ` Michael Ellerman

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).