linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
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>,
	Guenter Roeck <linux@roeck-us.net>,
	linux-hwmon@vger.kernel.org
Subject: Re: [PATCH v1 11/15] hwmon: (w83792d) Remove duplicate NULL check
Date: Tue, 31 Oct 2017 20:32:33 +0100	[thread overview]
Message-ID: <20171031203233.25a5daac@endymion> (raw)
In-Reply-To: <20171031142149.32512-11-andriy.shevchenko@linux.intel.com>

On Tue, 31 Oct 2017 16:21:45 +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/w83792d.c | 15 +++++----------
>  1 file changed, 5 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/hwmon/w83792d.c b/drivers/hwmon/w83792d.c
> index d764602d70db..76aa39e537e0 100644
> --- a/drivers/hwmon/w83792d.c
> +++ b/drivers/hwmon/w83792d.c
> @@ -981,8 +981,7 @@ w83792d_detect_subclients(struct i2c_client *new_client)
>  /* Undo inits in case of errors */
>  
>  ERROR_SC_1:
> -	if (data->lm75[0] != NULL)
> -		i2c_unregister_device(data->lm75[0]);
> +	i2c_unregister_device(data->lm75[0]);
>  ERROR_SC_0:
>  	return err;
>  }
> @@ -1456,10 +1455,8 @@ w83792d_probe(struct i2c_client *client, const struct i2c_device_id *id)
>  	for (i = 0; i < ARRAY_SIZE(w83792d_group_fan); i++)
>  		sysfs_remove_group(&dev->kobj, &w83792d_group_fan[i]);
>  exit_i2c_unregister:
> -	if (data->lm75[0] != NULL)
> -		i2c_unregister_device(data->lm75[0]);
> -	if (data->lm75[1] != NULL)
> -		i2c_unregister_device(data->lm75[1]);
> +	i2c_unregister_device(data->lm75[0]);
> +	i2c_unregister_device(data->lm75[1]);
>  	return err;
>  }
>  
> @@ -1475,10 +1472,8 @@ w83792d_remove(struct i2c_client *client)
>  		sysfs_remove_group(&client->dev.kobj,
>  				   &w83792d_group_fan[i]);
>  
> -	if (data->lm75[0] != NULL)
> -		i2c_unregister_device(data->lm75[0]);
> -	if (data->lm75[1] != NULL)
> -		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

  reply	other threads:[~2017-10-31 19:32 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-31 14:21 [PATCH v1 01/15] i2c: Make i2c_unregister_device() NULL-aware Andy Shevchenko
2017-10-31 14:21 ` [PATCH v1 02/15] i2c: taos-evm: Remove duplicate NULL check Andy Shevchenko
2017-10-31 17:34   ` Jean Delvare
2017-11-01 23:04   ` Wolfram Sang
2017-10-31 14:21 ` [PATCH v1 03/15] i2c: thunderx: " Andy Shevchenko
2017-11-01 23:04   ` Wolfram Sang
2017-10-31 14:21 ` [PATCH v1 04/15] ipmi_ssif: " Andy Shevchenko
2018-01-18 15:29   ` Andy Shevchenko
2018-01-18 15:41     ` Corey Minyard
2018-01-18 16:46       ` Andy Shevchenko
2017-10-31 14:21 ` [PATCH v1 05/15] gpio: max732x: " Andy Shevchenko
2017-11-29 12:26   ` Linus Walleij
2017-10-31 14:21 ` [PATCH v1 06/15] drm/bridge: analogix-anx78xx: " Andy Shevchenko
2017-10-31 14:21 ` [PATCH v1 07/15] drm/i2c/sil164: " Andy Shevchenko
2017-10-31 14:21 ` [PATCH v1 08/15] drm/i2c: tda998x: " Andy Shevchenko
2017-10-31 17:03   ` Russell King - ARM Linux
2018-01-18 15:21     ` Ville Syrjälä
2018-01-18 15:27       ` Andy Shevchenko
2017-10-31 14:21 ` [PATCH v1 09/15] hwmon: (w83781d) " Andy Shevchenko
2017-10-31 18:03   ` Jean Delvare
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 [this message]
2017-10-31 14:21 ` [PATCH v1 12/15] hwmon: (w83793) " Andy Shevchenko
2017-10-31 19:43   ` Jean Delvare
     [not found] ` <20171031142149.32512-1-andriy.shevchenko-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2017-10-31 14:21   ` [PATCH v1 13/15] iio: imu: inv_mpu6050: " Andy Shevchenko
2017-11-19 16:04     ` Jonathan Cameron
2017-10-31 14:21 ` [PATCH v1 14/15] media: adv7180: Remove duplicate checks Andy Shevchenko
2017-10-31 14:21 ` [PATCH v1 15/15] media: i2c: adv748x: Remove duplicate NULL check Andy Shevchenko
2017-11-03 23:41   ` Kieran Bingham
2017-11-01 23:04 ` [PATCH v1 01/15] i2c: Make i2c_unregister_device() NULL-aware Wolfram Sang

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=20171031203233.25a5daac@endymion \
    --to=jdelvare@suse.de \
    --cc=andriy.shevchenko@linux.intel.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;
as well as URLs for NNTP newsgroup(s).