From: Vadim Pasternak Date: Tue, 20 Nov 2018 23:16:36 +0000 (+0000) Subject: hwmon: (mlxreg-fan) Modify macros for tachometer fault status reading X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=3f9ffa5c3a25bf2a3c880b07f620c8ef029dc261;p=openwrt%2Fstaging%2Fblogic.git hwmon: (mlxreg-fan) Modify macros for tachometer fault status reading Modify macros for tachometer fault status reading for making it more simple and clear. Signed-off-by: Vadim Pasternak Signed-off-by: Guenter Roeck --- diff --git a/drivers/hwmon/mlxreg-fan.c b/drivers/hwmon/mlxreg-fan.c index d8fa4bea4bc8..db8c6de0b6a0 100644 --- a/drivers/hwmon/mlxreg-fan.c +++ b/drivers/hwmon/mlxreg-fan.c @@ -51,7 +51,7 @@ */ #define MLXREG_FAN_GET_RPM(rval, d, s) (DIV_ROUND_CLOSEST(15000000 * 100, \ ((rval) + (s)) * (d))) -#define MLXREG_FAN_GET_FAULT(val, mask) (!((val) ^ (mask))) +#define MLXREG_FAN_GET_FAULT(val, mask) ((val) == (mask)) #define MLXREG_FAN_PWM_DUTY2STATE(duty) (DIV_ROUND_CLOSEST((duty) * \ MLXREG_FAN_MAX_STATE, \ MLXREG_FAN_MAX_DUTY))