linux-hwmon.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] hwmon (lm63) Do not overwrite data->kind
@ 2018-11-13  4:36 Nicolin Chen
  0 siblings, 0 replies; 2+ messages in thread
From: Nicolin Chen @ 2018-11-13  4:36 UTC (permalink / raw)
  To: jdelvare, linux; +Cc: linux-hwmon, linux-kernel

According to the code right before the removed line, data->kind
should be either from DT or from id pointer. So there shouldn't
be an additional overwriting after the if-else statement.

So this patch just removes the overwriting line.

Signed-off-by: Nicolin Chen <nicoleotsuka@gmail.com>
---
Guenter,
    I have not really tested this change but still sent it out
    since it looks obvious. Please feel free to drop it if you
    have concern at an untested change. Thanks.

 drivers/hwmon/lm63.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/hwmon/lm63.c b/drivers/hwmon/lm63.c
index 4c1770920d29..eac54b9cdeec 100644
--- a/drivers/hwmon/lm63.c
+++ b/drivers/hwmon/lm63.c
@@ -1120,7 +1120,6 @@ static int lm63_probe(struct i2c_client *client,
 		data->kind = (enum chips)of_device_get_match_data(&client->dev);
 	else
 		data->kind = id->driver_data;
-	data->kind = id->driver_data;
 	if (data->kind == lm64)
 		data->temp2_offset = 16000;
 
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] hwmon (lm63) Do not overwrite data->kind
@ 2018-11-13 17:12 Guenter Roeck
  0 siblings, 0 replies; 2+ messages in thread
From: Guenter Roeck @ 2018-11-13 17:12 UTC (permalink / raw)
  To: Nicolin Chen; +Cc: jdelvare, linux-hwmon, linux-kernel

On Mon, Nov 12, 2018 at 08:36:56PM -0800, Nicolin Chen wrote:
> According to the code right before the removed line, data->kind
> should be either from DT or from id pointer. So there shouldn't
> be an additional overwriting after the if-else statement.
> 
> So this patch just removes the overwriting line.
> 
> Signed-off-by: Nicolin Chen <nicoleotsuka@gmail.com>
> ---
> Guenter,
>     I have not really tested this change but still sent it out
>     since it looks obvious. Please feel free to drop it if you
>     have concern at an untested change. Thanks.

Good find. You are right, the patch introducing the DT code didn't
really do anything. Given that no one (including me) noticed that
commit b25f663b91f1a was effectively a no-op, I'll queue this up
for the next kernel release.

Thanks,
Guenter

> 
>  drivers/hwmon/lm63.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/hwmon/lm63.c b/drivers/hwmon/lm63.c
> index 4c1770920d29..eac54b9cdeec 100644
> --- a/drivers/hwmon/lm63.c
> +++ b/drivers/hwmon/lm63.c
> @@ -1120,7 +1120,6 @@ static int lm63_probe(struct i2c_client *client,
>  		data->kind = (enum chips)of_device_get_match_data(&client->dev);
>  	else
>  		data->kind = id->driver_data;
> -	data->kind = id->driver_data;
>  	if (data->kind == lm64)
>  		data->temp2_offset = 16000;
>  
> -- 
> 2.17.1
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-11-14  3:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-13  4:36 [PATCH] hwmon (lm63) Do not overwrite data->kind Nicolin Chen
2018-11-13 17:12 Guenter Roeck

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).