From: SF Markus Elfring <elfring@users.sourceforge.net>
To: linux-input@vger.kernel.org,
"Akinobu Mita" <akinobu.mita@gmail.com>,
"Dmitry Torokhov" <dmitry.torokhov@gmail.com>,
"Günter Röck" <linux@roeck-us.net>,
"Zhang Jiejing" <jiejing.zhang@freescale.com>
Cc: LKML <linux-kernel@vger.kernel.org>, kernel-janitors@vger.kernel.org
Subject: [PATCH] Input-mpr121: Use common error handling code in mpr_touchkey_interrupt()
Date: Thu, 26 Oct 2017 21:23:56 +0200 [thread overview]
Message-ID: <38f2360b-5f45-b6e6-4e7d-a9cc1a43939a@users.sourceforge.net> (raw)
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Thu, 26 Oct 2017 21:16:53 +0200
Add a jump target so that an error message can be better reused
in an if branch of this function.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/input/keyboard/mpr121_touchkey.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/input/keyboard/mpr121_touchkey.c b/drivers/input/keyboard/mpr121_touchkey.c
index 884a74d8a7ed..af840a842246 100644
--- a/drivers/input/keyboard/mpr121_touchkey.c
+++ b/drivers/input/keyboard/mpr121_touchkey.c
@@ -129,14 +129,13 @@ static irqreturn_t mpr_touchkey_interrupt(int irq, void *dev_id)
int reg;
reg = i2c_smbus_read_byte_data(client, ELE_TOUCH_STATUS_1_ADDR);
- if (reg < 0) {
- dev_err(&client->dev, "i2c read error [%d]\n", reg);
- goto out;
- }
+ if (reg < 0)
+ goto report_read_failure;
reg <<= 8;
reg |= i2c_smbus_read_byte_data(client, ELE_TOUCH_STATUS_0_ADDR);
if (reg < 0) {
+report_read_failure:
dev_err(&client->dev, "i2c read error [%d]\n", reg);
goto out;
}
--
2.14.3
reply other threads:[~2017-10-26 19:24 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=38f2360b-5f45-b6e6-4e7d-a9cc1a43939a@users.sourceforge.net \
--to=elfring@users.sourceforge.net \
--cc=akinobu.mita@gmail.com \
--cc=dmitry.torokhov@gmail.com \
--cc=jiejing.zhang@freescale.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.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
all inboxes | Powered by JetHome®