[PATCH] hwmon: (applesmc) Assign boolean values to a bool variable

Subsystems: apple smc driver, hardware monitoring, the rest

STALE2102d LANDED

Landed in mainline as 0bf6a1e85ddd on 2021-01-28.

2 messages, 2 authors, 2021-01-21 · open the first message on its own page

[PATCH] hwmon: (applesmc) Assign boolean values to a bool variable

From: Jiapeng Zhong <hidden>
Date: 2021-01-20 06:44:14

Fix the following coccicheck warnings:

./drivers/hwmon/applesmc.c:568:6-23: WARNING: Assignment of
0/1 to bool variable.

Reported-by: Abaci Robot <redacted>
Signed-off-by: Jiapeng Zhong <redacted>
---
 drivers/hwmon/applesmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/hwmon/applesmc.c b/drivers/hwmon/applesmc.c
index 89207af..28b137e 100644
--- a/drivers/hwmon/applesmc.c
+++ b/drivers/hwmon/applesmc.c
@@ -565,7 +565,7 @@ static int applesmc_init_index(struct applesmc_registers *s)
 static int applesmc_init_smcreg_try(void)
 {
 	struct applesmc_registers *s = &smcreg;
-	bool left_light_sensor = 0, right_light_sensor = 0;
+	bool left_light_sensor = false, right_light_sensor = false;
 	unsigned int count;
 	u8 tmp[1];
 	int ret;
-- 
1.8.3.1

Re: [PATCH] hwmon: (applesmc) Assign boolean values to a bool variable

From: Guenter Roeck <linux@roeck-us.net>
Date: 2021-01-21 19:36:03

On Wed, Jan 20, 2021 at 02:41:10PM +0800, Jiapeng Zhong wrote:
Fix the following coccicheck warnings:

./drivers/hwmon/applesmc.c:568:6-23: WARNING: Assignment of
0/1 to bool variable.

Reported-by: Abaci Robot <redacted>
Signed-off-by: Jiapeng Zhong <redacted>
Applied.

Thanks,
Guenter
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help