From: Jean Delvare <jdelvare@suse.de>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: linux-i2c@vger.kernel.org, Wolfram Sang <wsa@the-dreams.de>,
Jean Delvare <jdelvare@suse.com>,
Guenter Roeck <linux@roeck-us.net>,
linux-hwmon@vger.kernel.org
Subject: Re: [PATCH v1 09/15] hwmon: (w83781d) Remove duplicate NULL check
Date: Tue, 31 Oct 2017 19:03:26 +0100 [thread overview]
Message-ID: <20171031190326.28b828b1@endymion> (raw)
In-Reply-To: <20171031142149.32512-9-andriy.shevchenko@linux.intel.com>
On Tue, 31 Oct 2017 16:21:43 +0200, Andy Shevchenko wrote:
> Since i2c_unregister_device() became NULL-aware we may remove duplicate
> NULL check.
>
> Cc: Jean Delvare <jdelvare@suse.com>
> Cc: Guenter Roeck <linux@roeck-us.net>
> Cc: linux-hwmon@vger.kernel.org
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
> drivers/hwmon/w83781d.c | 12 ++++--------
> 1 file changed, 4 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/hwmon/w83781d.c b/drivers/hwmon/w83781d.c
> index 246fb2365126..2b0f182daa87 100644
> --- a/drivers/hwmon/w83781d.c
> +++ b/drivers/hwmon/w83781d.c
> @@ -1246,10 +1246,8 @@ w83781d_probe(struct i2c_client *client, const struct i2c_device_id *id)
>
> exit_remove_files:
> w83781d_remove_files(dev);
> - if (data->lm75[0])
> - i2c_unregister_device(data->lm75[0]);
> - if (data->lm75[1])
> - i2c_unregister_device(data->lm75[1]);
> + i2c_unregister_device(data->lm75[0]);
> + i2c_unregister_device(data->lm75[1]);
> return err;
> }
>
> @@ -1262,10 +1260,8 @@ w83781d_remove(struct i2c_client *client)
> hwmon_device_unregister(data->hwmon_dev);
> w83781d_remove_files(dev);
>
> - if (data->lm75[0])
> - i2c_unregister_device(data->lm75[0]);
> - if (data->lm75[1])
> - i2c_unregister_device(data->lm75[1]);
> + i2c_unregister_device(data->lm75[0]);
> + i2c_unregister_device(data->lm75[1]);
>
> return 0;
> }
Reviewed-by: Jean Delvare <jdelvare@suse.de>
--
Jean Delvare
SUSE L3 Support
next prev parent reply other threads:[~2017-10-31 18:03 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20171031142149.32512-1-andriy.shevchenko@linux.intel.com>
2017-10-31 14:21 ` [PATCH v1 09/15] hwmon: (w83781d) Remove duplicate NULL check Andy Shevchenko
2017-10-31 18:03 ` Jean Delvare [this message]
2017-11-01 13:19 ` Guenter Roeck
2017-11-01 13:26 ` Andy Shevchenko
2017-11-01 23:07 ` Wolfram Sang
2017-11-02 12:23 ` Andy Shevchenko
2017-10-31 14:21 ` [PATCH v1 10/15] hwmon: (w83791d) " Andy Shevchenko
2017-10-31 18:27 ` Jean Delvare
2017-10-31 14:21 ` [PATCH v1 11/15] hwmon: (w83792d) " Andy Shevchenko
2017-10-31 19:32 ` Jean Delvare
2017-10-31 14:21 ` [PATCH v1 12/15] hwmon: (w83793) " Andy Shevchenko
2017-10-31 19:43 ` Jean Delvare
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=20171031190326.28b828b1@endymion \
--to=jdelvare@suse.de \
--cc=andriy.shevchenko@linux.intel.com \
--cc=jdelvare@suse.com \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=wsa@the-dreams.de \
/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