linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: SF Markus Elfring <elfring@users.sourceforge.net>
To: linux-input@vger.kernel.org,
	Andrew Duggan <aduggan@synaptics.com>,
	Benjamin Tissoires <benjamin.tissoires@redhat.com>,
	Christophe Jaillet <christophe.jaillet@wanadoo.fr>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Lyude Paul <thatslyude@gmail.com>, Nick Dyer <nick@shmanahar.org>,
	Wei Yongjun <weiyongjun1@huawei.com>
Cc: LKML <linux-kernel@vger.kernel.org>, kernel-janitors@vger.kernel.org
Subject: [PATCH] input/rmi4: Delete an error message for a failed memory allocation in two functions
Date: Wed, 24 Jan 2018 19:28:44 +0100	[thread overview]
Message-ID: <423a3ec4-eef2-f663-d6b8-9ec9d31ddfc2@users.sourceforge.net> (raw)

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 24 Jan 2018 19:19:14 +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>
---
 drivers/input/rmi4/rmi_driver.c | 4 +---
 drivers/input/rmi4/rmi_f30.c    | 4 +---
 2 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/input/rmi4/rmi_driver.c b/drivers/input/rmi4/rmi_driver.c
index 4f2bb5947a4e..6c47e4f3ca7e 100644
--- a/drivers/input/rmi4/rmi_driver.c
+++ b/drivers/input/rmi4/rmi_driver.c
@@ -1060,10 +1060,8 @@ int rmi_probe_interrupts(struct rmi_driver_data *data)
 
 	size = BITS_TO_LONGS(data->irq_count) * sizeof(unsigned long);
 	data->irq_memory = devm_kzalloc(dev, size * 4, GFP_KERNEL);
-	if (!data->irq_memory) {
-		dev_err(dev, "Failed to allocate memory for irq masks.\n");
+	if (!data->irq_memory)
 		return -ENOMEM;
-	}
 
 	data->irq_status	= data->irq_memory + size * 0;
 	data->fn_irq_bits	= data->irq_memory + size * 1;
diff --git a/drivers/input/rmi4/rmi_f30.c b/drivers/input/rmi4/rmi_f30.c
index 82e0f0d43d55..a111ea370c30 100644
--- a/drivers/input/rmi4/rmi_f30.c
+++ b/drivers/input/rmi4/rmi_f30.c
@@ -238,10 +238,8 @@ static int rmi_f30_map_gpios(struct rmi_function *fn,
 					    button_count,
 					    sizeof(f30->gpioled_key_map[0]),
 					    GFP_KERNEL);
-	if (!f30->gpioled_key_map) {
-		dev_err(&fn->dev, "Failed to allocate gpioled map memory.\n");
+	if (!f30->gpioled_key_map)
 		return -ENOMEM;
-	}
 
 	for (i = 0; i < button_count; i++) {
 		if (!rmi_f30_is_valid_button(i, f30->ctrl))
-- 
2.16.1


             reply	other threads:[~2018-01-24 18:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-24 18:28 SF Markus Elfring [this message]
2018-01-24 20:36 ` [PATCH] input/rmi4: Delete an error message for a failed memory allocation in two functions Nick Dyer

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=423a3ec4-eef2-f663-d6b8-9ec9d31ddfc2@users.sourceforge.net \
    --to=elfring@users.sourceforge.net \
    --cc=aduggan@synaptics.com \
    --cc=benjamin.tissoires@redhat.com \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=dmitry.torokhov@gmail.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nick@shmanahar.org \
    --cc=thatslyude@gmail.com \
    --cc=weiyongjun1@huawei.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).