mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: SF Markus Elfring <elfring@users.sourceforge.net>
To: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
	kernel-janitors@vger.kernel.org
Cc: LKML <linux-kernel@vger.kernel.org>, Wolfram Sang <wsa@the-dreams.de>
Subject: [PATCH 1/6] PNP: Delete an error message for a failed memory allocation in pnp_alloc()
Date: Mon, 15 May 2017 21:12:26 +0200	[thread overview]
Message-ID: <8e1a8099-5f0b-d8f4-d039-7c3ecdf8b508@users.sourceforge.net> (raw)
In-Reply-To: <94f6ec12-0092-e1e6-3fb1-81f9630eae1f@users.sourceforge.net>

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 15 May 2017 19:35:29 +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/pnp/core.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/pnp/core.c b/drivers/pnp/core.c
index b54620e53830..27945a2d9c4e 100644
--- a/drivers/pnp/core.c
+++ b/drivers/pnp/core.c
@@ -35,10 +35,8 @@ void *pnp_alloc(long size)
 	void *result;
 
 	result = kzalloc(size, GFP_KERNEL);
-	if (!result) {
-		printk(KERN_ERR "pnp: Out of Memory\n");
+	if (!result)
 		return NULL;
-	}
 	return result;
 }
 
-- 
2.13.0

  reply	other threads:[~2017-05-15 19:12 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-15 19:10 [PATCH 0/6] PNP: Adjustments for four function implementations SF Markus Elfring
2017-05-15 19:12 ` SF Markus Elfring [this message]
2017-05-15 19:14 ` [PATCH 2/6] PNP: Improve a size determination in pnp_alloc_dev() SF Markus Elfring
2017-05-15 19:16 ` [PATCH 3/6] PNP: Improve a size determination in pnp_clone_dependent_set() SF Markus Elfring
2017-05-15 19:18 ` [PATCH 4/6] PNP: Delete an error message for a failed memory allocation " SF Markus Elfring
2017-05-15 19:20 ` [PATCH 5/6] PNP: Improve a size determination in quirk_awe32_add_ports() SF Markus Elfring
2017-05-15 19:22 ` [PATCH 6/6] PNP: Delete an error message for a failed memory allocation " SF Markus Elfring
2017-05-27 19:08 ` [PATCH 0/6] PNP: Adjustments for four function implementations Andy Shevchenko
2017-12-18 18:21 ` SF Markus Elfring

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=8e1a8099-5f0b-d8f4-d039-7c3ecdf8b508@users.sourceforge.net \
    --to=elfring@users.sourceforge.net \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rafael.j.wysocki@intel.com \
    --cc=wsa@the-dreams.de \
    /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

Powered by JetHome