Linux Hardware Monitor development
 help / color / mirror / Atom feed
* [PATCH] hwmon: (pmbus) Simplify the calculation of variables
@ 2021-01-26  6:21 Jiapeng Zhong
  2021-01-28  1:56 ` Guenter Roeck
  0 siblings, 1 reply; 2+ messages in thread
From: Jiapeng Zhong @ 2021-01-26  6:21 UTC (permalink / raw)
  To: linux; +Cc: jdelvare, linux-hwmon, linux-kernel, Jiapeng Zhong

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>
---
 drivers/hwmon/pmbus/pmbus_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hwmon/pmbus/pmbus_core.c b/drivers/hwmon/pmbus/pmbus_core.c
index 192442b..a78ae70 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,
-- 
1.8.3.1


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

* Re: [PATCH] hwmon: (pmbus) Simplify the calculation of variables
  2021-01-26  6:21 [PATCH] hwmon: (pmbus) Simplify the calculation of variables Jiapeng Zhong
@ 2021-01-28  1:56 ` Guenter Roeck
  0 siblings, 0 replies; 2+ messages in thread
From: Guenter Roeck @ 2021-01-28  1:56 UTC (permalink / raw)
  To: Jiapeng Zhong; +Cc: jdelvare, linux-hwmon, linux-kernel

On Tue, Jan 26, 2021 at 02:21:40PM +0800, Jiapeng Zhong wrote:
> 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>

Applied.

Thanks,
Guenter

> ---
>  drivers/hwmon/pmbus/pmbus_core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/hwmon/pmbus/pmbus_core.c b/drivers/hwmon/pmbus/pmbus_core.c
> index 192442b..a78ae70 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,

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

end of thread, other threads:[~2021-01-28  1:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-01-26  6:21 [PATCH] hwmon: (pmbus) Simplify the calculation of variables Jiapeng Zhong
2021-01-28  1:56 ` Guenter Roeck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox