From: Javier Martinez Canillas <javier@osg.samsung.com>
To: linux-kernel@vger.kernel.org
Cc: Javier Martinez Canillas <javier@osg.samsung.com>,
Nick Dyer <nick.dyer@itdev.co.uk>,
Dmitry Torokhov <dmitry.torokhov@gmail.com>,
linux-input@vger.kernel.org
Subject: [PATCH 13/18] Input: atmel_mxt_ts - simplify function return logic
Date: Fri, 2 Oct 2015 15:40:24 +0200 [thread overview]
Message-ID: <1443793229-22363-14-git-send-email-javier@osg.samsung.com> (raw)
In-Reply-To: <1443793229-22363-1-git-send-email-javier@osg.samsung.com>
The invoked functions already return zero on success or a negative
errno code so there is no need to open code the logic in the caller.
This also fixes the following make coccicheck warnings:
end returns can be simplified and declaration on line 1470 can be dropped
end returns can be simplified and declaration on line 1485 can be dropped
end returns can be simplified and declaration on line 515 can be dropped
end returns can be simplified
Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
---
drivers/input/touchscreen/atmel_mxt_ts.c | 30 +++++-------------------------
1 file changed, 5 insertions(+), 25 deletions(-)
diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c
index c5622058c22b..34ecbb64319f 100644
--- a/drivers/input/touchscreen/atmel_mxt_ts.c
+++ b/drivers/input/touchscreen/atmel_mxt_ts.c
@@ -512,7 +512,6 @@ recheck:
static int mxt_send_bootloader_cmd(struct mxt_data *data, bool unlock)
{
- int ret;
u8 buf[2];
if (unlock) {
@@ -523,11 +522,7 @@ static int mxt_send_bootloader_cmd(struct mxt_data *data, bool unlock)
buf[1] = 0x01;
}
- ret = mxt_bootloader_write(data, buf, 2);
- if (ret)
- return ret;
-
- return 0;
+ return mxt_bootloader_write(data, buf, 2);
}
static int __mxt_read_reg(struct i2c_client *client,
@@ -1112,12 +1107,8 @@ static int mxt_soft_reset(struct mxt_data *data)
enable_irq(data->irq);
- ret = mxt_wait_for_completion(data, &data->reset_completion,
- MXT_RESET_TIMEOUT);
- if (ret)
- return ret;
-
- return 0;
+ return mxt_wait_for_completion(data, &data->reset_completion,
+ MXT_RESET_TIMEOUT);
}
static void mxt_update_crc(struct mxt_data *data, u8 cmd, u8 value)
@@ -1467,29 +1458,18 @@ release_mem:
static int mxt_acquire_irq(struct mxt_data *data)
{
- int error;
-
enable_irq(data->irq);
- error = mxt_process_messages_until_invalid(data);
- if (error)
- return error;
-
- return 0;
+ return mxt_process_messages_until_invalid(data);
}
static int mxt_get_info(struct mxt_data *data)
{
struct i2c_client *client = data->client;
struct mxt_info *info = &data->info;
- int error;
/* Read 7-byte info block starting at address 0 */
- error = __mxt_read_reg(client, 0, sizeof(*info), info);
- if (error)
- return error;
-
- return 0;
+ return __mxt_read_reg(client, 0, sizeof(*info), info);
}
static void mxt_free_input_device(struct mxt_data *data)
--
2.4.3
next prev parent reply other threads:[~2015-10-02 13:41 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-02 13:40 [PATCH 00/18] Input - Fix make coccicheck warnings Javier Martinez Canillas
2015-10-02 13:40 ` [PATCH 01/18] Input: joydev - use memdup_user() to duplicate memory from user-space Javier Martinez Canillas
2015-10-02 18:21 ` Dmitry Torokhov
2015-10-02 13:40 ` [PATCH 02/18] Input: ads7846 - use PTR_ERR_OR_ZERO() Javier Martinez Canillas
2015-10-02 18:21 ` Dmitry Torokhov
2015-10-02 13:40 ` [PATCH 03/18] Input: cyttsp " Javier Martinez Canillas
2015-10-02 18:21 ` Dmitry Torokhov
2015-10-02 13:40 ` [PATCH 04/18] Input: kxtj9 - remove unneeded retval variable Javier Martinez Canillas
2015-10-02 13:40 ` [PATCH 05/18] Input: retu-pwrbutton - simplify function return logic Javier Martinez Canillas
2015-10-02 13:40 ` [PATCH 06/18] Input: zforce " Javier Martinez Canillas
2015-10-02 13:54 ` Heiko Stübner
2015-10-02 18:15 ` Dmitry Torokhov
2015-10-02 13:40 ` [PATCH 07/18] Input: cap11xx " Javier Martinez Canillas
2015-10-02 13:41 ` Daniel Mack
2015-10-02 18:09 ` Dmitry Torokhov
2015-10-02 18:17 ` Javier Martinez Canillas
2015-10-02 13:40 ` [PATCH 08/18] Input: goldfish " Javier Martinez Canillas
2015-10-02 13:40 ` [PATCH 09/18] Input: jornada720_ts " Javier Martinez Canillas
2015-10-02 13:40 ` [PATCH 10/18] Input: intel-mid-touch " Javier Martinez Canillas
2015-10-02 13:40 ` [PATCH 11/18] Input: da9034-ts " Javier Martinez Canillas
2015-10-02 13:40 ` [PATCH 12/18] Input: pxa27x_keypad " Javier Martinez Canillas
2015-10-02 13:40 ` Javier Martinez Canillas [this message]
2015-10-02 13:40 ` [PATCH 14/18] Input: synaptics_i2c " Javier Martinez Canillas
2015-10-02 13:40 ` [PATCH 15/18] Input: auo-pixcir-ts " Javier Martinez Canillas
2015-10-02 18:19 ` Dmitry Torokhov
2015-10-02 13:40 ` [PATCH 16/18] Input: elan_i2c " Javier Martinez Canillas
2015-10-02 16:46 ` Benson Leung
2015-10-02 13:40 ` [PATCH 17/18] Input: cypress_ps2 " Javier Martinez Canillas
2015-10-02 13:40 ` [PATCH 18/18] Input: tps6507x-ts " Javier Martinez Canillas
2015-10-02 18:20 ` Dmitry Torokhov
2015-10-02 18:25 ` [PATCH 00/18] Input - Fix make coccicheck warnings Dmitry Torokhov
2015-10-03 11:13 ` Javier Martinez Canillas
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=1443793229-22363-14-git-send-email-javier@osg.samsung.com \
--to=javier@osg.samsung.com \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nick.dyer@itdev.co.uk \
/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®