Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1562000 > unrolled thread
| Started by | Guenter Roeck <linux@roeck-us.net> |
|---|---|
| First post | 2017-01-18 18:50 +0100 |
| Last post | 2017-01-19 10:20 +0100 |
| Articles | 14 on this page of 54 — 4 participants |
Back to article view | Back to linux.kernel
[PATCH 00/33] Input: Automated coccinelle cleanup Guenter Roeck <linux@roeck-us.net> - 2017-01-18 18:50 +0100
[PATCH 02/33] Input: bcm-keypad - Drop unnecessary call to platform_set_drvdata and other changes Guenter Roeck <linux@roeck-us.net> - 2017-01-18 18:50 +0100
[PATCH 29/33] Input: melfas_mip4 - Use devm_add_action_or_reset and other changes Guenter Roeck <linux@roeck-us.net> - 2017-01-18 18:50 +0100
Re: [PATCH 29/33] Input: melfas_mip4 - Use devm_add_action_or_reset and other changes Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2017-01-18 20:30 +0100
[PATCH 04/33] Input: cros_ec_keyb - Drop unnecessary call to dev_set_drvdata and other changes Guenter Roeck <linux@roeck-us.net> - 2017-01-18 18:50 +0100
Re: [PATCH 04/33] Input: cros_ec_keyb - Drop unnecessary call to dev_set_drvdata and other changes Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2017-01-18 19:40 +0100
[PATCH 23/33] Input: xilinx_ps2 - Use 'dev' instead of dereferencing it and other changes Guenter Roeck <linux@roeck-us.net> - 2017-01-18 19:00 +0100
Re: [PATCH 23/33] Input: xilinx_ps2 - Use 'dev' instead of dereferencing it and other changes Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2017-01-18 20:30 +0100
[PATCH 12/33] Input: axp20x-pek - Use devm_add_action_or_reset and other changes Guenter Roeck <linux@roeck-us.net> - 2017-01-18 19:00 +0100
[PATCH 20/33] Input: elan_i2c_core - Use 'dev' instead of dereferencing it and other changes Guenter Roeck <linux@roeck-us.net> - 2017-01-18 19:00 +0100
[PATCH 22/33] Input: at32psif - Drop unnecessary error messages and other changes Guenter Roeck <linux@roeck-us.net> - 2017-01-18 19:00 +0100
Re: [PATCH 22/33] Input: at32psif - Drop unnecessary error messages and other changes Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2017-01-18 20:20 +0100
[PATCH 10/33] Input: twl4030_keypad - Drop unnecessary call to platform_set_drvdata and other changes Guenter Roeck <linux@roeck-us.net> - 2017-01-18 19:00 +0100
Re: [PATCH 10/33] Input: twl4030_keypad - Drop unnecessary call to platform_set_drvdata and other changes Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2017-01-18 20:50 +0100
[PATCH 14/33] Input: gpio_decoder - Drop unnecessary call to platform_set_drvdata and other changes Guenter Roeck <linux@roeck-us.net> - 2017-01-18 19:00 +0100
Re: [PATCH 14/33] Input: gpio_decoder - Drop unnecessary call to platform_set_drvdata and other changes Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2017-01-18 20:50 +0100
[PATCH 15/33] Input: kxtj9 - Drop unnecessary error messages and other changes Guenter Roeck <linux@roeck-us.net> - 2017-01-18 19:00 +0100
[PATCH 27/33] Input: eeti_ts - Drop unnecessary error messages and other changes Guenter Roeck <linux@roeck-us.net> - 2017-01-18 19:00 +0100
Re: [PATCH 27/33] Input: eeti_ts - Drop unnecessary error messages and other changes Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2017-01-18 20:30 +0100
[PATCH 08/33] Input: spear-keyboard - Drop unnecessary error messages and other changes Guenter Roeck <linux@roeck-us.net> - 2017-01-18 19:00 +0100
Re: [PATCH 08/33] Input: spear-keyboard - Drop unnecessary error messages and other changes Viresh Kumar <viresh.kumar@linaro.org> - 2017-01-19 05:00 +0100
[PATCH 19/33] Input: tps65218-pwrbutton - Drop unnecessary call to platform_set_drvdata and other changes Guenter Roeck <linux@roeck-us.net> - 2017-01-18 19:00 +0100
Re: [PATCH 19/33] Input: tps65218-pwrbutton - Drop unnecessary call to platform_set_drvdata and other changes Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2017-01-18 20:50 +0100
[PATCH 07/33] Input: sh_keysc - Drop unnecessary error messages and other changes Guenter Roeck <linux@roeck-us.net> - 2017-01-18 19:00 +0100
[PATCH 28/33] Input: egalax_ts - Drop unnecessary call to i2c_set_clientdata and other changes Guenter Roeck <linux@roeck-us.net> - 2017-01-18 19:00 +0100
Re: [PATCH 28/33] Input: egalax_ts - Drop unnecessary call to i2c_set_clientdata and other changes Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2017-01-18 20:40 +0100
Re: [PATCH 28/33] Input: egalax_ts - Drop unnecessary call to i2c_set_clientdata and other changes Guenter Roeck <linux@roeck-us.net> - 2017-01-18 21:40 +0100
[PATCH 11/33] Input: ab8500-ponkey - Drop unnecessary call to platform_set_drvdata and other changes Guenter Roeck <linux@roeck-us.net> - 2017-01-18 19:00 +0100
Re: [PATCH 11/33] Input: ab8500-ponkey - Drop unnecessary call to platform_set_drvdata and other changes Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2017-01-18 20:50 +0100
[PATCH 17/33] Input: retu-pwrbutton - Simplify error return and other changes Guenter Roeck <linux@roeck-us.net> - 2017-01-18 19:00 +0100
[PATCH 13/33] Input: bfin_rotary - Use 'dev' instead of dereferencing it and other changes Guenter Roeck <linux@roeck-us.net> - 2017-01-18 19:00 +0100
Re: [PATCH 13/33] Input: bfin_rotary - Use 'dev' instead of dereferencing it and other changes Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2017-01-18 20:50 +0100
Re: [PATCH 13/33] Input: bfin_rotary - Use 'dev' instead of dereferencing it and other changes Guenter Roeck <linux@roeck-us.net> - 2017-01-18 21:40 +0100
Re: [PATCH 13/33] Input: bfin_rotary - Use 'dev' instead of dereferencing it and other changes Joe Perches <joe@perches.com> - 2017-01-19 06:10 +0100
Re: [PATCH 13/33] Input: bfin_rotary - Use 'dev' instead of dereferencing it and other changes Guenter Roeck <linux@roeck-us.net> - 2017-01-19 09:30 +0100
[PATCH 25/33] Input: atmel-wm97xx - Drop unnecessary error messages and other changes Guenter Roeck <linux@roeck-us.net> - 2017-01-18 19:00 +0100
Re: [PATCH 25/33] Input: atmel-wm97xx - Drop unnecessary error messages and other changes Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2017-01-18 20:30 +0100
[PATCH 09/33] Input: sun4i-lradc-keys - Drop unnecessary call to platform_set_drvdata and other changes Guenter Roeck <linux@roeck-us.net> - 2017-01-18 19:00 +0100
[PATCH 16/33] Input: mma8450 - Drop unnecessary call to i2c_set_clientdata and other changes Guenter Roeck <linux@roeck-us.net> - 2017-01-18 19:00 +0100
Re: [PATCH 16/33] Input: mma8450 - Drop unnecessary call to i2c_set_clientdata and other changes Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2017-01-18 20:50 +0100
[PATCH 18/33] Input: soc_button_array - Use 'dev' instead of dereferencing it and other changes Guenter Roeck <linux@roeck-us.net> - 2017-01-18 19:00 +0100
Re: [PATCH 18/33] Input: soc_button_array - Use 'dev' instead of dereferencing it and other changes Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2017-01-18 20:50 +0100
[PATCH 26/33] Input: atmel_mxt_ts - Drop unnecessary error messages and other changes Guenter Roeck <linux@roeck-us.net> - 2017-01-18 19:00 +0100
[PATCH 24/33] Input: ar1021_i2c - Drop unnecessary call to i2c_set_clientdata and other changes Guenter Roeck <linux@roeck-us.net> - 2017-01-18 19:00 +0100
Re: [PATCH 24/33] Input: ar1021_i2c - Drop unnecessary call to i2c_set_clientdata and other changes Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2017-01-18 20:30 +0100
[PATCH 32/33] Input: sis_i2c - Drop unnecessary call to i2c_set_clientdata and other changes Guenter Roeck <linux@roeck-us.net> - 2017-01-18 21:40 +0100
Re: [PATCH 32/33] Input: sis_i2c - Drop unnecessary call to i2c_set_clientdata and other changes Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2017-01-18 23:30 +0100
[PATCH 33/33] Input: sx8654 - Drop unnecessary call to i2c_set_clientdata and other changes Guenter Roeck <linux@roeck-us.net> - 2017-01-18 21:40 +0100
[PATCH 31/33] Input: rohm_bu21023 - Use 'dev' instead of dereferencing it and other changes Guenter Roeck <linux@roeck-us.net> - 2017-01-18 21:40 +0100
[PATCH 30/33] Input: raydium_i2c_ts - Simplify error return and other changes Guenter Roeck <linux@roeck-us.net> - 2017-01-18 21:40 +0100
Re: [PATCH 00/33] Input: Automated coccinelle cleanup Joe Perches <joe@perches.com> - 2017-01-19 02:50 +0100
Re: [PATCH 00/33] Input: Automated coccinelle cleanup Guenter Roeck <linux@roeck-us.net> - 2017-01-19 06:10 +0100
Re: [PATCH 00/33] Input: Automated coccinelle cleanup Joe Perches <joe@perches.com> - 2017-01-19 06:10 +0100
Re: [PATCH 00/33] Input: Automated coccinelle cleanup Guenter Roeck <linux@roeck-us.net> - 2017-01-19 10:20 +0100
Page 3 of 3 — ← Prev page 1 2 [3]
| From | Guenter Roeck <linux@roeck-us.net> |
|---|---|
| Date | 2017-01-18 19:00 +0100 |
| Subject | [PATCH 18/33] Input: soc_button_array - Use 'dev' instead of dereferencing it and other changes |
| Message-ID | <t12GD-76Z-45@gated-at.bofh.it> |
| In reply to | #1562000 |
Use local variable 'dev' instead of dereferencing it several times.
This conversion was done automatically with coccinelle using the
following semantic patches. The semantic patches and the scripts
used to generate this commit log are available at
https://github.com/groeck/coccinelle-patches
- Use local variable 'struct device *dev' consistently
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
drivers/input/misc/soc_button_array.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/input/misc/soc_button_array.c b/drivers/input/misc/soc_button_array.c
index 908b51089dee..fb3219a8d3c0 100644
--- a/drivers/input/misc/soc_button_array.c
+++ b/drivers/input/misc/soc_button_array.c
@@ -167,12 +167,12 @@ static int soc_button_probe(struct platform_device *pdev)
button_info = (struct soc_button_info *)id->driver_data;
- if (gpiod_count(&pdev->dev, KBUILD_MODNAME) <= 0) {
- dev_dbg(&pdev->dev, "no GPIO attached, ignoring...\n");
+ if (gpiod_count(dev, KBUILD_MODNAME) <= 0) {
+ dev_dbg(dev, "no GPIO attached, ignoring...\n");
return -ENODEV;
}
- priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
+ priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
if (!priv)
return -ENOMEM;
--
2.7.4
[toc] | [prev] | [next] | [standalone]
| From | Dmitry Torokhov <dmitry.torokhov@gmail.com> |
|---|---|
| Date | 2017-01-18 20:50 +0100 |
| Subject | Re: [PATCH 18/33] Input: soc_button_array - Use 'dev' instead of dereferencing it and other changes |
| Message-ID | <t14p5-8e2-27@gated-at.bofh.it> |
| In reply to | #1562026 |
On Wed, Jan 18, 2017 at 09:46:39AM -0800, Guenter Roeck wrote:
> Use local variable 'dev' instead of dereferencing it several times.
>
> This conversion was done automatically with coccinelle using the
> following semantic patches. The semantic patches and the scripts
> used to generate this commit log are available at
> https://github.com/groeck/coccinelle-patches
>
> - Use local variable 'struct device *dev' consistently
Applied, thank you.
>
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
> ---
> drivers/input/misc/soc_button_array.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/input/misc/soc_button_array.c b/drivers/input/misc/soc_button_array.c
> index 908b51089dee..fb3219a8d3c0 100644
> --- a/drivers/input/misc/soc_button_array.c
> +++ b/drivers/input/misc/soc_button_array.c
> @@ -167,12 +167,12 @@ static int soc_button_probe(struct platform_device *pdev)
>
> button_info = (struct soc_button_info *)id->driver_data;
>
> - if (gpiod_count(&pdev->dev, KBUILD_MODNAME) <= 0) {
> - dev_dbg(&pdev->dev, "no GPIO attached, ignoring...\n");
> + if (gpiod_count(dev, KBUILD_MODNAME) <= 0) {
> + dev_dbg(dev, "no GPIO attached, ignoring...\n");
> return -ENODEV;
> }
>
> - priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
> + priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
> if (!priv)
> return -ENOMEM;
>
> --
> 2.7.4
>
--
Dmitry
[toc] | [prev] | [next] | [standalone]
| From | Guenter Roeck <linux@roeck-us.net> |
|---|---|
| Date | 2017-01-18 19:00 +0100 |
| Subject | [PATCH 26/33] Input: atmel_mxt_ts - Drop unnecessary error messages and other changes |
| Message-ID | <t12GD-76Z-49@gated-at.bofh.it> |
| In reply to | #1562000 |
Error messages after memory allocation failures are unnecessary and
can be dropped.
Other relevant changes:
Simplify error return
This conversion was done automatically with coccinelle using the
following semantic patches. The semantic patches and the scripts
used to generate this commit log are available at
https://github.com/groeck/coccinelle-patches
- Drop unused variables
- Drop unnecessary braces around conditional return statements
- Use local structure pointers consistently
- Drop error message after devm_kzalloc() failure
- Replace 'if (e) return e; return 0;' with 'return e;'
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
drivers/input/touchscreen/atmel_mxt_ts.c | 47 +++++++-------------------------
1 file changed, 10 insertions(+), 37 deletions(-)
diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c
index e5d185fe69b9..ca027503627e 100644
--- a/drivers/input/touchscreen/atmel_mxt_ts.c
+++ b/drivers/input/touchscreen/atmel_mxt_ts.c
@@ -585,7 +585,6 @@ static int mxt_check_bootloader(struct mxt_data *data, unsigned int state,
static int mxt_send_bootloader_cmd(struct mxt_data *data, bool unlock)
{
- int ret;
u8 buf[2];
if (unlock) {
@@ -596,11 +595,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,
@@ -1167,15 +1162,9 @@ static int mxt_t6_command(struct mxt_data *data, u16 cmd_offset,
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_soft_reset(struct mxt_data *data)
@@ -1198,12 +1187,8 @@ static int mxt_soft_reset(struct mxt_data *data)
mxt_acquire_irq(data);
- 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)
@@ -1504,10 +1489,8 @@ static int mxt_update_cfg(struct mxt_data *data, const struct firmware *cfg)
MXT_INFO_CHECKSUM_SIZE;
config_mem_size = data->mem_size - cfg_start_ofs;
config_mem = kzalloc(config_mem_size, GFP_KERNEL);
- if (!config_mem) {
- dev_err(dev, "Failed to allocate memory\n");
+ if (!config_mem)
return -ENOMEM;
- }
ret = mxt_prepare_cfg_mem(data, cfg, data_pos, cfg_start_ofs,
config_mem, config_mem_size);
@@ -1555,14 +1538,9 @@ 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)
@@ -1609,10 +1587,8 @@ static int mxt_get_object_table(struct mxt_data *data)
table_size = data->info.object_num * sizeof(struct mxt_object);
object_table = kzalloc(table_size, GFP_KERNEL);
- if (!object_table) {
- dev_err(&data->client->dev, "Failed to allocate memory\n");
+ if (!object_table)
return -ENOMEM;
- }
error = __mxt_read_reg(client, MXT_OBJECT_START, table_size,
object_table);
@@ -2045,10 +2021,9 @@ static int mxt_initialize(struct mxt_data *data)
if (error) {
dev_info(&client->dev, "Trying alternate bootloader address\n");
error = mxt_probe_bootloader(data, true);
- if (error) {
+ if (error)
/* Chip is not in appmode or bootloader mode */
return error;
- }
}
/* OK, we are in bootloader, see if we can recover */
@@ -2509,7 +2484,7 @@ static void mxt_debug_init(struct mxt_data *data)
dbg->t37_pages = MXT1386_COLUMNS * MXT1386_PAGES_PER_COLUMN;
else
dbg->t37_pages = DIV_ROUND_UP(data->xsize *
- data->info.matrix_ysize *
+ info->matrix_ysize *
sizeof(u16),
sizeof(dbg->t37_buf->data));
@@ -3117,10 +3092,8 @@ static int mxt_probe(struct i2c_client *client, const struct i2c_device_id *id)
return PTR_ERR(pdata);
data = kzalloc(sizeof(struct mxt_data), GFP_KERNEL);
- if (!data) {
- dev_err(&client->dev, "Failed to allocate memory\n");
+ if (!data)
return -ENOMEM;
- }
snprintf(data->phys, sizeof(data->phys), "i2c-%u-%04x/input0",
client->adapter->nr, client->addr);
--
2.7.4
[toc] | [prev] | [next] | [standalone]
| From | Guenter Roeck <linux@roeck-us.net> |
|---|---|
| Date | 2017-01-18 19:00 +0100 |
| Subject | [PATCH 24/33] Input: ar1021_i2c - Drop unnecessary call to i2c_set_clientdata and other changes |
| Message-ID | <t12GE-76Z-63@gated-at.bofh.it> |
| In reply to | #1562000 |
There is no call to i2c_get_clientdata() or dev_get_drvdata(). Drop the unnecessary call to i2c_set_clientdata(). This conversion was done automatically with coccinelle using the following semantic patches. The semantic patches and the scripts used to generate this commit log are available at https://github.com/groeck/coccinelle-patches - Replace 'goto l; ... l: return e;' with 'return e;' - Drop i2c_set_clientdata() Signed-off-by: Guenter Roeck <linux@roeck-us.net> --- drivers/input/touchscreen/ar1021_i2c.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/input/touchscreen/ar1021_i2c.c b/drivers/input/touchscreen/ar1021_i2c.c index 71b5a634cf6d..b289eca2b797 100644 --- a/drivers/input/touchscreen/ar1021_i2c.c +++ b/drivers/input/touchscreen/ar1021_i2c.c @@ -35,11 +35,11 @@ static irqreturn_t ar1021_i2c_irq(int irq, void *dev_id) retval = i2c_master_recv(ar1021->client, ar1021->data, sizeof(ar1021->data)); if (retval != sizeof(ar1021->data)) - goto out; + return IRQ_HANDLED; /* sync bit set ? */ if ((data[0] & 0x80) == 0) - goto out; + return IRQ_HANDLED; button = data[0] & BIT(0); x = ((data[2] & 0x1f) << 7) | (data[1] & 0x7f); @@ -50,7 +50,6 @@ static irqreturn_t ar1021_i2c_irq(int irq, void *dev_id) input_report_key(input, BTN_TOUCH, button); input_sync(input); -out: return IRQ_HANDLED; } @@ -127,7 +126,6 @@ static int ar1021_i2c_probe(struct i2c_client *client, return error; } - i2c_set_clientdata(client, ar1021); return 0; } -- 2.7.4
[toc] | [prev] | [next] | [standalone]
| From | Dmitry Torokhov <dmitry.torokhov@gmail.com> |
|---|---|
| Date | 2017-01-18 20:30 +0100 |
| Subject | Re: [PATCH 24/33] Input: ar1021_i2c - Drop unnecessary call to i2c_set_clientdata and other changes |
| Message-ID | <t145I-86O-29@gated-at.bofh.it> |
| In reply to | #1562028 |
On Wed, Jan 18, 2017 at 09:46:45AM -0800, Guenter Roeck wrote: > There is no call to i2c_get_clientdata() or dev_get_drvdata(). > Drop the unnecessary call to i2c_set_clientdata(). Kept just this part and applied. > > This conversion was done automatically with coccinelle using the > following semantic patches. The semantic patches and the scripts > used to generate this commit log are available at > https://github.com/groeck/coccinelle-patches > > - Replace 'goto l; ... l: return e;' with 'return e;' > - Drop i2c_set_clientdata() > > Signed-off-by: Guenter Roeck <linux@roeck-us.net> > --- > drivers/input/touchscreen/ar1021_i2c.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/drivers/input/touchscreen/ar1021_i2c.c b/drivers/input/touchscreen/ar1021_i2c.c > index 71b5a634cf6d..b289eca2b797 100644 > --- a/drivers/input/touchscreen/ar1021_i2c.c > +++ b/drivers/input/touchscreen/ar1021_i2c.c > @@ -35,11 +35,11 @@ static irqreturn_t ar1021_i2c_irq(int irq, void *dev_id) > retval = i2c_master_recv(ar1021->client, > ar1021->data, sizeof(ar1021->data)); > if (retval != sizeof(ar1021->data)) > - goto out; > + return IRQ_HANDLED; > > /* sync bit set ? */ > if ((data[0] & 0x80) == 0) > - goto out; > + return IRQ_HANDLED; > > button = data[0] & BIT(0); > x = ((data[2] & 0x1f) << 7) | (data[1] & 0x7f); > @@ -50,7 +50,6 @@ static irqreturn_t ar1021_i2c_irq(int irq, void *dev_id) > input_report_key(input, BTN_TOUCH, button); > input_sync(input); > > -out: > return IRQ_HANDLED; > } > > @@ -127,7 +126,6 @@ static int ar1021_i2c_probe(struct i2c_client *client, > return error; > } > > - i2c_set_clientdata(client, ar1021); > return 0; > } > > -- > 2.7.4 > -- Dmitry
[toc] | [prev] | [next] | [standalone]
| From | Guenter Roeck <linux@roeck-us.net> |
|---|---|
| Date | 2017-01-18 21:40 +0100 |
| Subject | [PATCH 32/33] Input: sis_i2c - Drop unnecessary call to i2c_set_clientdata and other changes |
| Message-ID | <t15br-o6-3@gated-at.bofh.it> |
| In reply to | #1562000 |
There is no call to i2c_get_clientdata() or dev_get_drvdata(). Drop the unnecessary call to i2c_set_clientdata(). This conversion was done automatically with coccinelle using the following semantic patches. The semantic patches and the scripts used to generate this commit log are available at https://github.com/groeck/coccinelle-patches - Drop i2c_set_clientdata() Signed-off-by: Guenter Roeck <linux@roeck-us.net> --- drivers/input/touchscreen/sis_i2c.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/input/touchscreen/sis_i2c.c b/drivers/input/touchscreen/sis_i2c.c index 8d93f8c9a403..67c2563031d6 100644 --- a/drivers/input/touchscreen/sis_i2c.c +++ b/drivers/input/touchscreen/sis_i2c.c @@ -316,7 +316,6 @@ static int sis_ts_probe(struct i2c_client *client, return -ENOMEM; ts->client = client; - i2c_set_clientdata(client, ts); ts->attn_gpio = devm_gpiod_get_optional(&client->dev, "attn", GPIOD_IN); -- 2.7.4
[toc] | [prev] | [next] | [standalone]
| From | Dmitry Torokhov <dmitry.torokhov@gmail.com> |
|---|---|
| Date | 2017-01-18 23:30 +0100 |
| Subject | Re: [PATCH 32/33] Input: sis_i2c - Drop unnecessary call to i2c_set_clientdata and other changes |
| Message-ID | <t16TV-1vQ-31@gated-at.bofh.it> |
| In reply to | #1562138 |
On Wed, Jan 18, 2017 at 12:36:49PM -0800, Guenter Roeck wrote: > There is no call to i2c_get_clientdata() or dev_get_drvdata(). > Drop the unnecessary call to i2c_set_clientdata(). > > This conversion was done automatically with coccinelle using the > following semantic patches. The semantic patches and the scripts > used to generate this commit log are available at > https://github.com/groeck/coccinelle-patches > > - Drop i2c_set_clientdata() > > Signed-off-by: Guenter Roeck <linux@roeck-us.net> Applied, thank you. > --- > drivers/input/touchscreen/sis_i2c.c | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/drivers/input/touchscreen/sis_i2c.c b/drivers/input/touchscreen/sis_i2c.c > index 8d93f8c9a403..67c2563031d6 100644 > --- a/drivers/input/touchscreen/sis_i2c.c > +++ b/drivers/input/touchscreen/sis_i2c.c > @@ -316,7 +316,6 @@ static int sis_ts_probe(struct i2c_client *client, > return -ENOMEM; > > ts->client = client; > - i2c_set_clientdata(client, ts); > > ts->attn_gpio = devm_gpiod_get_optional(&client->dev, > "attn", GPIOD_IN); > -- > 2.7.4 > -- Dmitry
[toc] | [prev] | [next] | [standalone]
| From | Guenter Roeck <linux@roeck-us.net> |
|---|---|
| Date | 2017-01-18 21:40 +0100 |
| Subject | [PATCH 33/33] Input: sx8654 - Drop unnecessary call to i2c_set_clientdata and other changes |
| Message-ID | <t15br-o6-11@gated-at.bofh.it> |
| In reply to | #1562000 |
There is no call to i2c_get_clientdata() or dev_get_drvdata().
Drop the unnecessary call to i2c_set_clientdata().
Other relevant changes:
Simplify error return
This conversion was done automatically with coccinelle using the
following semantic patches. The semantic patches and the scripts
used to generate this commit log are available at
https://github.com/groeck/coccinelle-patches
- Replace 'goto l; ... l: return e;' with 'return e;'
- Replace 'if (e) return e; return 0;' with 'return e;'
- Drop i2c_set_clientdata()
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
drivers/input/touchscreen/sx8654.c | 14 ++++----------
1 file changed, 4 insertions(+), 10 deletions(-)
diff --git a/drivers/input/touchscreen/sx8654.c b/drivers/input/touchscreen/sx8654.c
index 642f4a53de50..c6ce3352da21 100644
--- a/drivers/input/touchscreen/sx8654.c
+++ b/drivers/input/touchscreen/sx8654.c
@@ -89,7 +89,7 @@ static irqreturn_t sx8654_irq(int irq, void *handle)
dev_dbg(&sx8654->client->dev, "irqsrc = 0x%x", irqsrc);
if (irqsrc < 0)
- goto out;
+ return IRQ_HANDLED;
if (irqsrc & IRQ_PENRELEASE) {
dev_dbg(&sx8654->client->dev, "pen release interrupt");
@@ -103,11 +103,11 @@ static irqreturn_t sx8654_irq(int irq, void *handle)
retval = i2c_master_recv(sx8654->client, data, sizeof(data));
if (retval != sizeof(data))
- goto out;
+ return IRQ_HANDLED;
/* invalid data */
if (unlikely(data[0] & 0x80 || data[2] & 0x80))
- goto out;
+ return IRQ_HANDLED;
x = ((data[0] & 0xf) << 8) | (data[1]);
y = ((data[2] & 0xf) << 8) | (data[3]);
@@ -120,7 +120,6 @@ static irqreturn_t sx8654_irq(int irq, void *handle)
dev_dbg(&sx8654->client->dev, "point(%4d,%4d)\n", x, y);
}
-out:
return IRQ_HANDLED;
}
@@ -249,12 +248,7 @@ static int sx8654_probe(struct i2c_client *client,
/* Disable the IRQ, we'll enable it in sx8654_open() */
disable_irq(client->irq);
- error = input_register_device(sx8654->input);
- if (error)
- return error;
-
- i2c_set_clientdata(client, sx8654);
- return 0;
+ return input_register_device(sx8654->input);
}
#ifdef CONFIG_OF
--
2.7.4
[toc] | [prev] | [next] | [standalone]
| From | Guenter Roeck <linux@roeck-us.net> |
|---|---|
| Date | 2017-01-18 21:40 +0100 |
| Subject | [PATCH 31/33] Input: rohm_bu21023 - Use 'dev' instead of dereferencing it and other changes |
| Message-ID | <t15bs-o6-29@gated-at.bofh.it> |
| In reply to | #1562000 |
Use local variable 'dev' instead of dereferencing it several times.
Other relevant changes:
Replace devm_add_action() with devm_add_action_or_reset()
This conversion was done automatically with coccinelle using the
following semantic patches. The semantic patches and the scripts
used to generate this commit log are available at
https://github.com/groeck/coccinelle-patches
- Replace devm_add_action() followed by failure action with
devm_add_action_or_reset()
- Use local variable 'struct device *dev' consistently
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
drivers/input/touchscreen/rohm_bu21023.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/drivers/input/touchscreen/rohm_bu21023.c b/drivers/input/touchscreen/rohm_bu21023.c
index 611156a2ef80..cce3ef94c1ab 100644
--- a/drivers/input/touchscreen/rohm_bu21023.c
+++ b/drivers/input/touchscreen/rohm_bu21023.c
@@ -1166,9 +1166,9 @@ static int rohm_bu21023_i2c_probe(struct i2c_client *client,
return error;
}
- error = devm_request_threaded_irq(dev, client->irq,
- NULL, rohm_ts_soft_irq,
- IRQF_ONESHOT, client->name, ts);
+ error = devm_request_threaded_irq(dev, client->irq, NULL,
+ rohm_ts_soft_irq, IRQF_ONESHOT,
+ client->name, ts);
if (error) {
dev_err(dev, "failed to request IRQ: %d\n", error);
return error;
@@ -1186,11 +1186,9 @@ static int rohm_bu21023_i2c_probe(struct i2c_client *client,
return error;
}
- error = devm_add_action(dev, rohm_ts_remove_sysfs_group, dev);
+ error = devm_add_action_or_reset(dev, rohm_ts_remove_sysfs_group, dev);
if (error) {
- rohm_ts_remove_sysfs_group(dev);
- dev_err(&client->dev,
- "Failed to add sysfs cleanup action: %d\n",
+ dev_err(dev, "Failed to add sysfs cleanup action: %d\n",
error);
return error;
}
--
2.7.4
[toc] | [prev] | [next] | [standalone]
| From | Guenter Roeck <linux@roeck-us.net> |
|---|---|
| Date | 2017-01-18 21:40 +0100 |
| Subject | [PATCH 30/33] Input: raydium_i2c_ts - Simplify error return and other changes |
| Message-ID | <t15br-o6-5@gated-at.bofh.it> |
| In reply to | #1562000 |
Simplify error return if the code returns anyway.
Other relevant changes:
Replace devm_add_action() with devm_add_action_or_reset()
This conversion was done automatically with coccinelle using the
following semantic patches. The semantic patches and the scripts
used to generate this commit log are available at
https://github.com/groeck/coccinelle-patches
- Replace devm_add_action() followed by failure action with
devm_add_action_or_reset()
- Replace 'goto l; ... l: return e;' with 'return e;'
- Replace 'if (e) return e; return 0;' with 'return e;'
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
drivers/input/touchscreen/raydium_i2c_ts.c | 18 ++++++------------
1 file changed, 6 insertions(+), 12 deletions(-)
diff --git a/drivers/input/touchscreen/raydium_i2c_ts.c b/drivers/input/touchscreen/raydium_i2c_ts.c
index 2658afa016c9..84507a882fa1 100644
--- a/drivers/input/touchscreen/raydium_i2c_ts.c
+++ b/drivers/input/touchscreen/raydium_i2c_ts.c
@@ -741,11 +741,7 @@ static int raydium_i2c_do_update_firmware(struct raydium_data *ts,
fw_checksum = raydium_calc_chksum(fw->data, fw->size);
- error = raydium_i2c_write_checksum(client, fw->size, fw_checksum);
- if (error)
- return error;
-
- return 0;
+ return raydium_i2c_write_checksum(client, fw->size, fw_checksum);
}
static int raydium_i2c_fw_update(struct raydium_data *ts)
@@ -831,12 +827,12 @@ static irqreturn_t raydium_i2c_irq(int irq, void *_dev)
u16 calc_crc;
if (ts->boot_mode != RAYDIUM_TS_MAIN)
- goto out;
+ return IRQ_HANDLED;
error = raydium_i2c_read_message(ts->client, ts->data_bank_addr,
ts->report_data, ts->pkg_size);
if (error)
- goto out;
+ return IRQ_HANDLED;
fw_crc = get_unaligned_le16(&ts->report_data[ts->report_size]);
calc_crc = raydium_calc_chksum(ts->report_data, ts->report_size);
@@ -844,12 +840,11 @@ static irqreturn_t raydium_i2c_irq(int irq, void *_dev)
dev_warn(&ts->client->dev,
"%s: invalid packet crc %#04x vs %#04x\n",
__func__, calc_crc, fw_crc);
- goto out;
+ return IRQ_HANDLED;
}
raydium_mt_event(ts);
-out:
return IRQ_HANDLED;
}
@@ -1130,10 +1125,9 @@ static int raydium_i2c_probe(struct i2c_client *client,
return error;
}
- error = devm_add_action(&client->dev,
- raydium_i2c_remove_sysfs_group, ts);
+ error = devm_add_action_or_reset(&client->dev,
+ raydium_i2c_remove_sysfs_group, ts);
if (error) {
- raydium_i2c_remove_sysfs_group(ts);
dev_err(&client->dev,
"Failed to add sysfs cleanup action: %d\n", error);
return error;
--
2.7.4
[toc] | [prev] | [next] | [standalone]
| From | Joe Perches <joe@perches.com> |
|---|---|
| Date | 2017-01-19 02:50 +0100 |
| Message-ID | <t1a1s-3mo-13@gated-at.bofh.it> |
| In reply to | #1562000 |
On Wed, 2017-01-18 at 09:46 -0800, Guenter Roeck wrote: > The conversion was done automatically with coccinelle using several semantic > patches. The semantic patches and the scripts used to generate this commit > log are available at https://github.com/groeck/coccinelle-patches. It'd be better to include the script in this 0/n patch so that if github entry changes, the 0/n patch is useful.
[toc] | [prev] | [next] | [standalone]
| From | Guenter Roeck <linux@roeck-us.net> |
|---|---|
| Date | 2017-01-19 06:10 +0100 |
| Message-ID | <t1d8Z-5va-11@gated-at.bofh.it> |
| In reply to | #1562366 |
On 01/18/2017 05:42 PM, Joe Perches wrote: > On Wed, 2017-01-18 at 09:46 -0800, Guenter Roeck wrote: >> The conversion was done automatically with coccinelle using several semantic >> patches. The semantic patches and the scripts used to generate this commit >> log are available at https://github.com/groeck/coccinelle-patches. > > It'd be better to include the script in this 0/n patch > so that if github entry changes, the 0/n patch is useful. > For this set it would have been possible, though even the rules used here add up to more than 1,000 lines. The underlying larger set (the one I am using to generate devm transformations) currently has ~5,000 lines of coccinelle rules. Are you sure you want to see that in an e-mail ? It might make more sense if I add the reference SHA from the repository. Thanks, Guenter
[toc] | [prev] | [next] | [standalone]
| From | Joe Perches <joe@perches.com> |
|---|---|
| Date | 2017-01-19 06:10 +0100 |
| Message-ID | <t1d8Z-5va-9@gated-at.bofh.it> |
| In reply to | #1562421 |
On Wed, 2017-01-18 at 21:04 -0800, Guenter Roeck wrote: > On 01/18/2017 05:42 PM, Joe Perches wrote: > > On Wed, 2017-01-18 at 09:46 -0800, Guenter Roeck wrote: > > > The conversion was done automatically with coccinelle using several semantic > > > patches. The semantic patches and the scripts used to generate this commit > > > log are available at https://github.com/groeck/coccinelle-patches. > > > > It'd be better to include the script in this 0/n patch > > so that if github entry changes, the 0/n patch is useful. > > > For this set it would have been possible, though even the rules used here add > up to more than 1,000 lines. How many errors do you think are in the script? 1000+ lines, likely there 10+ errors/defects.
[toc] | [prev] | [next] | [standalone]
| From | Guenter Roeck <linux@roeck-us.net> |
|---|---|
| Date | 2017-01-19 10:20 +0100 |
| Message-ID | <t1h2W-83w-27@gated-at.bofh.it> |
| In reply to | #1562423 |
On 01/18/2017 09:06 PM, Joe Perches wrote: > On Wed, 2017-01-18 at 21:04 -0800, Guenter Roeck wrote: >> On 01/18/2017 05:42 PM, Joe Perches wrote: >>> On Wed, 2017-01-18 at 09:46 -0800, Guenter Roeck wrote: >>>> The conversion was done automatically with coccinelle using several semantic >>>> patches. The semantic patches and the scripts used to generate this commit >>>> log are available at https://github.com/groeck/coccinelle-patches. >>> >>> It'd be better to include the script in this 0/n patch >>> so that if github entry changes, the 0/n patch is useful. >>> >> For this set it would have been possible, though even the rules used here add >> up to more than 1,000 lines. > > How many errors do you think are in the script? > 1000+ lines, likely there 10+ errors/defects. > Most of it is to limit the scope to ensure that there are none, so in this case the argument is a bit self-defeating. Guenter
[toc] | [prev] | [standalone]
Page 3 of 3 — ← Prev page 1 2 [3]
Back to top | Article view | linux.kernel
csiph-web