From: SF Markus Elfring <elfring@users.sourceforge.net>
To: linuxppc-dev@lists.ozlabs.org,
Benjamin Herrenschmidt <benh@kernel.crashing.org>,
Michael Ellerman <mpe@ellerman.id.au>,
Paul Mackerras <paulus@samba.org>, Rob Herring <robh@kernel.org>,
Tyrel Datwyler <tyreld@linux.vnet.ibm.com>
Cc: LKML <linux-kernel@vger.kernel.org>, kernel-janitors@vger.kernel.org
Subject: [PATCH 3/5] powerpc/4xx: Delete an error message for a failed memory allocation in three functions
Date: Thu, 11 Jan 2018 19:02:45 +0100 [thread overview]
Message-ID: <92f46132-b654-cc73-a589-4abf8ab3122a@users.sourceforge.net> (raw)
In-Reply-To: <2b9b4285-f1c0-5dc7-35c6-df901c9ca0eb@users.sourceforge.net>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Thu, 11 Jan 2018 18:28:54 +0100
Omit an extra message for a memory allocation failure in these functions.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
arch/powerpc/platforms/4xx/msi.c | 5 ++---
arch/powerpc/platforms/4xx/ocm.c | 5 +----
2 files changed, 3 insertions(+), 7 deletions(-)
diff --git a/arch/powerpc/platforms/4xx/msi.c b/arch/powerpc/platforms/4xx/msi.c
index d50417e23add..d16b81303cb0 100644
--- a/arch/powerpc/platforms/4xx/msi.c
+++ b/arch/powerpc/platforms/4xx/msi.c
@@ -224,10 +224,9 @@ static int ppc4xx_msi_probe(struct platform_device *dev)
dev_dbg(&dev->dev, "PCIE-MSI: Setting up MSI support...\n");
msi = kzalloc(sizeof(struct ppc4xx_msi), GFP_KERNEL);
- if (!msi) {
- dev_err(&dev->dev, "No memory for MSI structure\n");
+ if (!msi)
return -ENOMEM;
- }
+
dev->dev.platform_data = msi;
/* Get MSI ranges */
diff --git a/arch/powerpc/platforms/4xx/ocm.c b/arch/powerpc/platforms/4xx/ocm.c
index 8cb601e8bed7..5a750d0ad446 100644
--- a/arch/powerpc/platforms/4xx/ocm.c
+++ b/arch/powerpc/platforms/4xx/ocm.c
@@ -337,7 +337,6 @@ void *ppc4xx_ocm_alloc(phys_addr_t *phys, int size, int align,
ocm_blk = kzalloc(sizeof(struct ocm_block), GFP_KERNEL);
if (!ocm_blk) {
- printk(KERN_ERR "PPC4XX OCM: could not allocate ocm block");
rh_free(ocm_reg->rh, offset);
break;
}
@@ -391,10 +390,8 @@ static int __init ppc4xx_ocm_init(void)
return 0;
ocm_nodes = kzalloc((count * sizeof(struct ocm_info)), GFP_KERNEL);
- if (!ocm_nodes) {
- printk(KERN_ERR "PPC4XX OCM: failed to allocate OCM nodes!\n");
+ if (!ocm_nodes)
return -ENOMEM;
- }
ocm_count = count;
count = 0;
--
2.15.1
next prev parent reply other threads:[~2018-01-11 18:03 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-11 17:58 [PATCH 0/5] powerpc/platforms/4xx: Adjustments for six function implementations SF Markus Elfring
2018-01-11 18:00 ` [PATCH 1/5] powerpc/4xx: Combine four seq_printf() calls into two in ocm_debugfs_show() SF Markus Elfring
2018-12-23 13:28 ` [1/5] " Michael Ellerman
2018-01-11 18:01 ` [PATCH 2/5] powerpc/4xx: Use seq_putc() " SF Markus Elfring
2018-12-23 13:28 ` [2/5] " Michael Ellerman
2018-01-11 18:02 ` SF Markus Elfring [this message]
2018-12-23 13:28 ` [3/5] powerpc/4xx: Delete an error message for a failed memory allocation in three functions Michael Ellerman
2018-01-11 18:03 ` [PATCH 4/5] powerpc/4xx: Improve a size determination in two functions SF Markus Elfring
2018-01-11 18:04 ` [PATCH 5/5] powerpc/4xx: Delete an unnecessary return statement " SF Markus Elfring
2018-12-23 13:28 ` [5/5] " 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=92f46132-b654-cc73-a589-4abf8ab3122a@users.sourceforge.net \
--to=elfring@users.sourceforge.net \
--cc=benh@kernel.crashing.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=paulus@samba.org \
--cc=robh@kernel.org \
--cc=tyreld@linux.vnet.ibm.com \
/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).