From: Geoff Levand <geoff@infradead.org>
To: Michael Ellerman <mpe@ellerman.id.au>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
linuxppc-dev@lists.ozlabs.org, Jim Paris <jim@jtan.com>,
Jens Axboe <axboe@kernel.dk>,
Markus Elfring <elfring@users.sourceforge.net>
Subject: [PATCH 1/3] block/ps3vram: Delete an error message for a failed memory allocation in ps3vram_cache_init()
Date: Mon, 07 Aug 2017 20:09:20 +0000 [thread overview]
Message-ID: <9f412d91a41af6e0a8eb44413a40e154f02bdd3a.1502135910.git.geoff@infradead.org> (raw)
In-Reply-To: <cover.1502135910.git.geoff@infradead.org>
From: Markus Elfring <elfring@users.sourceforge.net>
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>
Cc: Jim Paris <jim@jtan.com>
Cc: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Geoff Levand <geoff@infradead.org>
---
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.11.0
next prev parent reply other threads:[~2017-08-07 20:09 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-07 20:09 [PATCH 0/3] Minor updates for PS3 Geoff Levand
2017-08-07 20:09 ` Geoff Levand [this message]
2017-08-18 12:51 ` [1/3] block/ps3vram: Delete an error message for a failed memory allocation in ps3vram_cache_init() Michael Ellerman
2017-08-07 20:09 ` [PATCH 2/3] block/ps3vram: Check return of ps3vram_cache_init Geoff Levand
2017-08-08 12:46 ` SF Markus Elfring
2017-08-18 12:51 ` [2/3] " Michael Ellerman
2017-08-07 20:09 ` [PATCH 3/3] powerpc/ps3: Refresh ps3_defconfig Geoff Levand
2017-08-08 10:16 ` [PATCH 0/3] Minor updates for PS3 Michael Ellerman
2017-08-08 14:25 ` Jens Axboe
2017-08-09 6:16 ` Michael Ellerman
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=9f412d91a41af6e0a8eb44413a40e154f02bdd3a.1502135910.git.geoff@infradead.org \
--to=geoff@infradead.org \
--cc=axboe@kernel.dk \
--cc=benh@kernel.crashing.org \
--cc=elfring@users.sourceforge.net \
--cc=jim@jtan.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
/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).