diff mbox series

[2/2] hwmon: (nct6775) Clean up a condition

Message ID 20180905074655.w6uypipr5lgmpr4g@kili.mountain (mailing list archive)
State Accepted
Headers show
Series [1/2] hwmon: (nct6775) Set weight source to zero correctly | expand

Commit Message

Dan Carpenter Sept. 5, 2018, 7:46 a.m. UTC
I removed the "dsw_en &&" chunk of the condition because we know that
"dsw_en" is set.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Comments

Guenter Roeck Sept. 5, 2018, 9:49 p.m. UTC | #1
On Wed, Sep 05, 2018 at 10:46:55AM +0300, Dan Carpenter wrote:
> I removed the "dsw_en &&" chunk of the condition because we know that
> "dsw_en" is set.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Applied to hwmon-next.

Thanks,
Guenter

> 
> diff --git a/drivers/hwmon/nct6775.c b/drivers/hwmon/nct6775.c
> index 139781ae830b..719effe53ceb 100644
> --- a/drivers/hwmon/nct6775.c
> +++ b/drivers/hwmon/nct6775.c
> @@ -3533,8 +3533,7 @@ nct6775_check_fan_inputs(struct nct6775_data *data)
>  
>  				if (!fan6pin)
>  					fan6pin = (regval_2a & BIT(4)) &&
> -					  (!dsw_en ||
> -					   (dsw_en && (regval_ed & BIT(4))));
> +					  (!dsw_en || (regval_ed & BIT(4)));
>  				if (!pwm6pin)
>  					pwm6pin = (regval_2a & BIT(3)) &&
>  					  (regval_ed & BIT(2));
diff mbox series

Patch

diff --git a/drivers/hwmon/nct6775.c b/drivers/hwmon/nct6775.c
index 139781ae830b..719effe53ceb 100644
--- a/drivers/hwmon/nct6775.c
+++ b/drivers/hwmon/nct6775.c
@@ -3533,8 +3533,7 @@  nct6775_check_fan_inputs(struct nct6775_data *data)
 
 				if (!fan6pin)
 					fan6pin = (regval_2a & BIT(4)) &&
-					  (!dsw_en ||
-					   (dsw_en && (regval_ed & BIT(4))));
+					  (!dsw_en || (regval_ed & BIT(4)));
 				if (!pwm6pin)
 					pwm6pin = (regval_2a & BIT(3)) &&
 					  (regval_ed & BIT(2));