2021-01-11 09:57:22

by Abaci Team

[permalink] [raw]
Subject: [PATCH] hwmon: abx500: style: Simplify bool comparison

Fix the following coccicheck warning:
./drivers/hwmon/abx500.c:84:8-26: WARNING: Comparison to bool

Signed-off-by: YANG LI <[email protected]>
Reported-by: Abaci Robot<[email protected]>
---
drivers/hwmon/abx500.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hwmon/abx500.c b/drivers/hwmon/abx500.c
index 4b96488..3879b13 100644
--- a/drivers/hwmon/abx500.c
+++ b/drivers/hwmon/abx500.c
@@ -81,7 +81,7 @@ static void gpadc_monitor(struct work_struct *work)

if (data->min[i] != 0) {
if (temp < data->min[i]) {
- if (data->min_alarm[i] == false) {
+ if (!data->min_alarm[i]) {
data->min_alarm[i] = true;
updated_min_alarm = true;
}
--
1.8.3.1


2021-01-21 19:31:44

by Guenter Roeck

[permalink] [raw]
Subject: Re: [PATCH] hwmon: abx500: style: Simplify bool comparison

On Mon, Jan 11, 2021 at 05:52:09PM +0800, YANG LI wrote:
> Fix the following coccicheck warning:
> ./drivers/hwmon/abx500.c:84:8-26: WARNING: Comparison to bool
>
> Signed-off-by: YANG LI <[email protected]>
> Reported-by: Abaci Robot<[email protected]>

This driver will be removed in v5.11.

Guenter

> ---
> drivers/hwmon/abx500.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/hwmon/abx500.c b/drivers/hwmon/abx500.c
> index 4b96488..3879b13 100644
> --- a/drivers/hwmon/abx500.c
> +++ b/drivers/hwmon/abx500.c
> @@ -81,7 +81,7 @@ static void gpadc_monitor(struct work_struct *work)
>
> if (data->min[i] != 0) {
> if (temp < data->min[i]) {
> - if (data->min_alarm[i] == false) {
> + if (!data->min_alarm[i]) {
> data->min_alarm[i] = true;
> updated_min_alarm = true;
> }