* [PATCH] drivers/macintosh: Use true for boolean value
@ 2018-01-23 17:43 Gustavo A. R. Silva
2018-01-24 0:47 ` Michael Ellerman
0 siblings, 1 reply; 4+ messages in thread
From: Gustavo A. R. Silva @ 2018-01-23 17:43 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev, linux-kernel, Gustavo A. R. Silva
Assign true or false to boolean variables instead of an integer value.
This issue was detected with the help of Coccinelle.
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
drivers/macintosh/windfarm_pm72.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/macintosh/windfarm_pm72.c b/drivers/macintosh/windfarm_pm72.c
index e88cfb3..8330215 100644
--- a/drivers/macintosh/windfarm_pm72.c
+++ b/drivers/macintosh/windfarm_pm72.c
@@ -611,7 +611,7 @@ static void pm72_tick(void)
int i, last_failure;
if (!started) {
- started = 1;
+ started = true;
printk(KERN_INFO "windfarm: CPUs control loops started.\n");
for (i = 0; i < nr_chips; ++i) {
if (cpu_setup_pid(i) < 0) {
--
2.7.4
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] drivers/macintosh: Use true for boolean value
2018-01-23 17:43 [PATCH] drivers/macintosh: Use true for boolean value Gustavo A. R. Silva
@ 2018-01-24 0:47 ` Michael Ellerman
2018-01-24 0:57 ` Gustavo A. R. Silva
0 siblings, 1 reply; 4+ messages in thread
From: Michael Ellerman @ 2018-01-24 0:47 UTC (permalink / raw)
To: Gustavo A. R. Silva, Benjamin Herrenschmidt
Cc: Gustavo A. R. Silva, linuxppc-dev, linux-kernel
"Gustavo A. R. Silva" <gustavo@embeddedor.com> writes:
> Assign true or false to boolean variables instead of an integer value.
>
> This issue was detected with the help of Coccinelle.
>
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
> ---
> drivers/macintosh/windfarm_pm72.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
This seems to be common across all those drivers. Can you please send
one patch to fix them all to use bool:
$ git grep "started = " drivers/macintosh/
drivers/macintosh/therm_adt746x.c: int started = 0;
drivers/macintosh/therm_adt746x.c: started = 1;
drivers/macintosh/windfarm_pm112.c: slots_started = 1;
drivers/macintosh/windfarm_pm112.c: started = 1;
drivers/macintosh/windfarm_pm121.c: pm121_started = 1;
drivers/macintosh/windfarm_pm72.c: started = 1;
drivers/macintosh/windfarm_pm81.c: wf_smu_started = 1;
drivers/macintosh/windfarm_pm91.c: wf_smu_started = 1;
drivers/macintosh/windfarm_rm31.c: started = 1;
cheers
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] drivers/macintosh: Use true for boolean value
2018-01-24 0:47 ` Michael Ellerman
@ 2018-01-24 0:57 ` Gustavo A. R. Silva
2018-01-24 1:50 ` Gustavo A. R. Silva
0 siblings, 1 reply; 4+ messages in thread
From: Gustavo A. R. Silva @ 2018-01-24 0:57 UTC (permalink / raw)
To: Michael Ellerman
Cc: Gustavo A. R. Silva, Benjamin Herrenschmidt, linuxppc-dev,
linux-kernel
Quoting Michael Ellerman <mpe@ellerman.id.au>:
> "Gustavo A. R. Silva" <gustavo@embeddedor.com> writes:
>
>> Assign true or false to boolean variables instead of an integer value.
>>
>> This issue was detected with the help of Coccinelle.
>>
>> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
>> ---
>> drivers/macintosh/windfarm_pm72.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> This seems to be common across all those drivers. Can you please send
> one patch to fix them all to use bool:
>
> $ git grep "started = " drivers/macintosh/
> drivers/macintosh/therm_adt746x.c: int started = 0;
> drivers/macintosh/therm_adt746x.c: started = 1;
> drivers/macintosh/windfarm_pm112.c: slots_started = 1;
> drivers/macintosh/windfarm_pm112.c: started = 1;
> drivers/macintosh/windfarm_pm121.c: pm121_started = 1;
> drivers/macintosh/windfarm_pm72.c: started = 1;
> drivers/macintosh/windfarm_pm81.c: wf_smu_started = 1;
> drivers/macintosh/windfarm_pm91.c: wf_smu_started = 1;
> drivers/macintosh/windfarm_rm31.c: started = 1;
>
> cheers
Sure, no problem.
By the way, I've just found the following similar case:
--- a/drivers/macintosh/ams/ams-input.c
+++ b/drivers/macintosh/ams/ams-input.c
@@ -91,7 +91,7 @@ static int ams_input_enable(void)
return error;
}
- joystick = 1;
+ joystick = true;
return 0;
}
@@ -104,7 +104,7 @@ static void ams_input_disable(void)
ams_info.idev = NULL;
}
- joystick = 0;
+ joystick = false;
}
Do you want me to include them all in the same patch?
Thanks
--
Gustavo
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] drivers/macintosh: Use true for boolean value
2018-01-24 0:57 ` Gustavo A. R. Silva
@ 2018-01-24 1:50 ` Gustavo A. R. Silva
0 siblings, 0 replies; 4+ messages in thread
From: Gustavo A. R. Silva @ 2018-01-24 1:50 UTC (permalink / raw)
To: Michael Ellerman
Cc: Gustavo A. R. Silva, Benjamin Herrenschmidt, linuxppc-dev,
linux-kernel
Quoting "Gustavo A. R. Silva" <garsilva@embeddedor.com>:
> Quoting Michael Ellerman <mpe@ellerman.id.au>:
>
>> "Gustavo A. R. Silva" <gustavo@embeddedor.com> writes:
>>
>>> Assign true or false to boolean variables instead of an integer value.
>>>
>>> This issue was detected with the help of Coccinelle.
>>>
>>> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
>>> ---
>>> drivers/macintosh/windfarm_pm72.c | 2 +-
>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> This seems to be common across all those drivers. Can you please send
>> one patch to fix them all to use bool:
>>
>> $ git grep "started = " drivers/macintosh/
>> drivers/macintosh/therm_adt746x.c: int started = 0;
>> drivers/macintosh/therm_adt746x.c: started = 1;
>> drivers/macintosh/windfarm_pm112.c: slots_started = 1;
>> drivers/macintosh/windfarm_pm112.c: started = 1;
>> drivers/macintosh/windfarm_pm121.c: pm121_started = 1;
>> drivers/macintosh/windfarm_pm72.c: started = 1;
>> drivers/macintosh/windfarm_pm81.c: wf_smu_started = 1;
>> drivers/macintosh/windfarm_pm91.c: wf_smu_started = 1;
>> drivers/macintosh/windfarm_rm31.c: started = 1;
>>
>> cheers
>
> Sure, no problem.
>
> By the way, I've just found the following similar case:
>
> --- a/drivers/macintosh/ams/ams-input.c
> +++ b/drivers/macintosh/ams/ams-input.c
> @@ -91,7 +91,7 @@ static int ams_input_enable(void)
> return error;
> }
>
> - joystick = 1;
> + joystick = true;
>
> return 0;
> }
> @@ -104,7 +104,7 @@ static void ams_input_disable(void)
> ams_info.idev = NULL;
> }
>
> - joystick = 0;
> + joystick = false;
> }
>
> Do you want me to include them all in the same patch?
>
I sent separate patches for this.
Thanks
--
Gustavo
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-01-24 1:50 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-23 17:43 [PATCH] drivers/macintosh: Use true for boolean value Gustavo A. R. Silva
2018-01-24 0:47 ` Michael Ellerman
2018-01-24 0:57 ` Gustavo A. R. Silva
2018-01-24 1:50 ` Gustavo A. R. Silva
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.