summaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/pmbus
diff options
context:
space:
mode:
authorJiapeng Zhong <abaci-bugfix@linux.alibaba.com>2021-01-26 14:21:40 +0800
committerGuenter Roeck <linux@roeck-us.net>2021-01-27 17:55:46 -0800
commit906ace80c2849d6ef114cfdb98178bd667f16aed (patch)
tree9a7ba781c686eb615cfab522bede527fc41d50d1 /drivers/hwmon/pmbus
parentcbfc6c6177f9208762c7c4acec394214b1e8be0c (diff)
downloadlinux-906ace80c2849d6ef114cfdb98178bd667f16aed.tar.bz2
hwmon: (pmbus) Simplify the calculation of variables
Fix the following coccicheck warnings: ./drivers/hwmon/pmbus/pmbus_core.c:1265:24-26: WARNING !A || A && B is equivalent to !A || B. Reported-by: Abaci Robot <abaci@linux.alibaba.com> Signed-off-by: Jiapeng Zhong <abaci-bugfix@linux.alibaba.com> Link: https://lore.kernel.org/r/1611642100-29937-1-git-send-email-abaci-bugfix@linux.alibaba.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon/pmbus')
-rw-r--r--drivers/hwmon/pmbus/pmbus_core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/hwmon/pmbus/pmbus_core.c b/drivers/hwmon/pmbus/pmbus_core.c
index 906c9fec9cce..1cf7d9e9d089 100644
--- a/drivers/hwmon/pmbus/pmbus_core.c
+++ b/drivers/hwmon/pmbus/pmbus_core.c
@@ -1262,7 +1262,7 @@ static int pmbus_add_sensor_attrs_one(struct i2c_client *client,
* which global bit is set) for this page is accessible.
*/
if (!ret && attr->gbit &&
- (!upper || (upper && data->has_status_word)) &&
+ (!upper || data->has_status_word) &&
pmbus_check_status_register(client, page)) {
ret = pmbus_add_boolean(data, name, "alarm", index,
NULL, NULL,