mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: SF Markus Elfring <elfring@users.sourceforge.net>
To: linux-iio@vger.kernel.org, linux-input@vger.kernel.org,
	"Benjamin Tissoires" <benjamin.tissoires@redhat.com>,
	"Bruno Prémont" <bonbons@linux-vserver.org>,
	"Henrik Rydberg" <rydberg@bitmath.org>,
	"Jiri Kosina" <jikos@kernel.org>,
	"Jonathan Cameron" <jic23@kernel.org>,
	"Srinivas Pandruvada" <srinivas.pandruvada@linux.intel.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
	kernel-janitors@vger.kernel.org, Wolfram Sang <wsa@the-dreams.de>
Subject: [PATCH 2/7] HID: sensor-hub: Delete error messages for failed memory allocations in sensor_hub_probe()
Date: Mon, 24 Apr 2017 22:17:54 +0200	[thread overview]
Message-ID: <7f9e0982-90b9-0e74-4732-7e3153813b2b@users.sourceforge.net> (raw)
In-Reply-To: <2d526d72-a740-367b-04a9-ed698435f8ed@users.sourceforge.net>

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 24 Apr 2017 19:45:25 +0200

The script "checkpatch.pl" pointed information out like the following.

WARNING: Possible unnecessary 'out of memory' message

Thus remove such statements here.

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/hid/hid-sensor-hub.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/hid/hid-sensor-hub.c b/drivers/hid/hid-sensor-hub.c
index 349494fc8def..feb4bb8ee3ec 100644
--- a/drivers/hid/hid-sensor-hub.c
+++ b/drivers/hid/hid-sensor-hub.c
@@ -640,10 +640,8 @@ static int sensor_hub_probe(struct hid_device *hdev,
 	struct hid_sensor_hub_device *collection_hsdev = NULL;
 
 	sd = devm_kzalloc(&hdev->dev, sizeof(*sd), GFP_KERNEL);
-	if (!sd) {
-		hid_err(hdev, "cannot allocate Sensor data\n");
+	if (!sd)
 		return -ENOMEM;
-	}
 
 	hid_set_drvdata(hdev, sd);
 	sd->quirks = id->driver_data;
@@ -678,7 +676,6 @@ static int sensor_hub_probe(struct hid_device *hdev,
 			       sizeof(*sd->hid_sensor_hub_client_devs),
 			       GFP_KERNEL);
 	if (sd->hid_sensor_hub_client_devs == NULL) {
-		hid_err(hdev, "Failed to allocate memory for mfd cells\n");
 		ret = -ENOMEM;
 		goto err_stop_hw;
 	}
@@ -692,7 +689,6 @@ static int sensor_hub_probe(struct hid_device *hdev,
 			hsdev = devm_kzalloc(&hdev->dev, sizeof(*hsdev),
 					     GFP_KERNEL);
 			if (!hsdev) {
-				hid_err(hdev, "cannot allocate hid_sensor_hub_device\n");
 				ret = -ENOMEM;
 				goto err_stop_hw;
 			}
-- 
2.12.2

  parent reply	other threads:[~2017-04-24 20:18 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-24 20:12 [PATCH 0/7] HID: Fine-tuning for some function implementations SF Markus Elfring
2017-04-24 20:16 ` [PATCH 1/7] HID: sensor-hub: Use devm_kcalloc() in sensor_hub_probe() SF Markus Elfring
2017-04-24 20:17 ` SF Markus Elfring [this message]
2017-04-27 18:16   ` HID: sensor-hub: Delete error messages for failed memory allocations " SF Markus Elfring
2017-04-24 20:18 ` [PATCH 3/7] HID: sensor-hub: Adjust two checks for null pointers " SF Markus Elfring
2017-04-24 20:20 ` [PATCH 4/7] HID: debug: Replace five seq_printf() calls by seq_putc() SF Markus Elfring
2017-04-24 20:21 ` [PATCH 5/7] HID: debug: Replace 12 seq_printf() calls by seq_puts() SF Markus Elfring
2017-04-24 20:22 ` [PATCH 6/7] HID: debug: Combine two seq_printf() calls into one call in hid_dump_device() SF Markus Elfring
2017-04-24 20:23 ` [PATCH 7/7] HID: picoLCD: Replace two seq_printf() calls by seq_puts() in picolcd_debug_reset_show() SF Markus Elfring
2017-04-25  6:40   ` Bruno Prémont

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=7f9e0982-90b9-0e74-4732-7e3153813b2b@users.sourceforge.net \
    --to=elfring@users.sourceforge.net \
    --cc=benjamin.tissoires@redhat.com \
    --cc=bonbons@linux-vserver.org \
    --cc=jic23@kernel.org \
    --cc=jikos@kernel.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rydberg@bitmath.org \
    --cc=srinivas.pandruvada@linux.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

all inboxes | Powered by JetHome®