lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <9BE4B49389AB2F41A64A32DFC844F1DF74CC8ADF@RADHCMS5.corp.rad-ic.com>
Date:   Tue, 14 Mar 2017 06:43:58 +0000
From:   Jeffrey Lin (林義章) 
        <Jeffrey.Lin@...-ic.com>
To:     Guenter Roeck <linux@...ck-us.net>,
        Dmitry Torokhov <dmitry.torokhov@...il.com>
CC:     "linux-input@...r.kernel.org" <linux-input@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Colin Ian King <colin.king@...onical.com>,
        Rob Herring <robh@...nel.org>
Subject: RE: [PATCH 30/33] Input: raydium_i2c_ts - Simplify error return and
 other changes

Hi sirs:
We're found raydium I2C driver not been kernel version v4.4, just found in v3.18. Should I commit again to V4.4??

Best Regards
----------------------------------------------------------------------
Jeffrey Lin,林義章
瑞鼎科技
Raydium Semiconductor Corporation
Tel:(03)666-1818 Ext.4163
Fax:(03)666-1919

-----Original Message-----
From: Guenter Roeck [mailto:linux@...ck-us.net]
Sent: Thursday, January 19, 2017 4:37 AM
To: Dmitry Torokhov
Cc: linux-input@...r.kernel.org; linux-kernel@...r.kernel.org; Guenter Roeck; Colin Ian King; Jeffrey Lin (林義章); Rob Herring
Subject: [PATCH 30/33] Input: raydium_i2c_ts - Simplify error return and other changes

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@...ck-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

CONFIDENTIALITY AND PROPRIETARY REMINDER:
This message and any attachment may contain confidential information. All rights including intellectual property rights arising out of this correspondence shall belong to Raydium Semiconductor Corp. Any unauthorized disclosure, forwarding, using, modifying, spreading, publishing or copying this email and the content is illegal and strictly prohibited.
If you are not the intended recipient, please notify the sender by replying to this message and delete all copies of it from your system. Thank you for cooperation.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ