public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: SF Markus Elfring <elfring@users.sourceforge.net>
To: "Andrew F. Davis" <afd@ti.com>,
	Christophe Jaillet <christophe.jaillet@wanadoo.fr>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Gustavo A. R. Silva" <garsilva@embeddedor.com>,
	Evgeniy Polyakov <zbr@ioremap.net>,
	"Maciej S. Szmigiero" <mail@maciej.szmigiero.name>,
	Sebastian Reichel <sre@kernel.org>,
	Wei Yongjun <weiyongjun1@huawei.com>
Cc: LKML <linux-kernel@vger.kernel.org>, kernel-janitors@vger.kernel.org
Subject: [PATCH 1/4] w1: Delete an error message for a failed memory allocation in two functions
Date: Mon, 21 Aug 2017 22:53:44 +0200	[thread overview]
Message-ID: <2caa1294-178b-b7da-8f1c-e3200a88a62f@users.sourceforge.net> (raw)
In-Reply-To: <cb845ee0-0826-6a68-1246-0beab38129c1@users.sourceforge.net>

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 21 Aug 2017 21:05:42 +0200

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>
---
 drivers/w1/w1.c     | 7 +------
 drivers/w1/w1_int.c | 6 +-----
 2 files changed, 2 insertions(+), 11 deletions(-)

diff --git a/drivers/w1/w1.c b/drivers/w1/w1.c
index 74471e7aa5cc..f26c1ea280dd 100644
--- a/drivers/w1/w1.c
+++ b/drivers/w1/w1.c
@@ -715,10 +715,5 @@ int w1_attach_slave_device(struct w1_master *dev, struct w1_reg_num *rn)
-	if (!sl) {
-		dev_err(&dev->dev,
-			 "%s: failed to allocate new slave device.\n",
-			 __func__);
+	if (!sl)
 		return -ENOMEM;
-	}
-
 
 	sl->owner = THIS_MODULE;
 	sl->master = dev;
diff --git a/drivers/w1/w1_int.c b/drivers/w1/w1_int.c
index 1c776178f598..9e37463960ed 100644
--- a/drivers/w1/w1_int.c
+++ b/drivers/w1/w1_int.c
@@ -44,9 +44,5 @@ static struct w1_master *w1_alloc_dev(u32 id, int slave_count, int slave_ttl,
-	if (!dev) {
-		pr_err("Failed to allocate %zd bytes for new w1 device.\n",
-			sizeof(struct w1_master));
+	if (!dev)
 		return NULL;
-	}
-
 
 	dev->bus_master = (struct w1_bus_master *)(dev + 1);
 
-- 
2.14.0

  reply	other threads:[~2017-08-21 20:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-21 20:52 [PATCH 0/4] w1: Adjustments for some function implementations SF Markus Elfring
2017-08-21 20:53 ` SF Markus Elfring [this message]
2017-08-21 20:54 ` [PATCH 2/4] w1: Improve a size determination in two functions SF Markus Elfring
2017-08-21 20:56 ` [PATCH 3/4] w1-masters: Delete an error message for a failed memory allocation in four functions SF Markus Elfring
2017-08-21 20:57 ` [PATCH 4/4] w1-masters: Improve a size determination " 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=2caa1294-178b-b7da-8f1c-e3200a88a62f@users.sourceforge.net \
    --to=elfring@users.sourceforge.net \
    --cc=afd@ti.com \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=garsilva@embeddedor.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mail@maciej.szmigiero.name \
    --cc=sre@kernel.org \
    --cc=weiyongjun1@huawei.com \
    --cc=zbr@ioremap.net \
    /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