linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM: mach-s3c24xx: Fix boolean expressions in osiris_dvs_notify
@ 2019-01-03 20:14 Gustavo A. R. Silva
  2019-01-04 13:27 ` Krzysztof Kozlowski
  2019-01-07 19:43 ` Krzysztof Kozlowski
  0 siblings, 2 replies; 6+ messages in thread
From: Gustavo A. R. Silva @ 2019-01-03 20:14 UTC (permalink / raw)
  To: Ben Dooks, Kukjin Kim, Krzysztof Kozlowski, Russell King
  Cc: linux-arm-kernel, linux-samsung-soc, linux-kernel, Gustavo A. R. Silva

Fix boolean expressions by using logical AND operator '&&'
instead of bitwise operator '&'.

This issue was detected with the help of Coccinelle.

Fixes: 4fa084af28ca ("ARM: OSIRIS: DVS (Dynamic Voltage Scaling) supoort.")
Cc: stable@vger.kernel.org
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
 arch/arm/mach-s3c24xx/mach-osiris-dvs.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-s3c24xx/mach-osiris-dvs.c b/arch/arm/mach-s3c24xx/mach-osiris-dvs.c
index 058ce73137e8..ccbd7b7965ca 100644
--- a/arch/arm/mach-s3c24xx/mach-osiris-dvs.c
+++ b/arch/arm/mach-s3c24xx/mach-osiris-dvs.c
@@ -65,16 +65,16 @@ static int osiris_dvs_notify(struct notifier_block *nb,
 
 	switch (val) {
 	case CPUFREQ_PRECHANGE:
-		if (old_dvs & !new_dvs ||
-		    cur_dvs & !new_dvs) {
+		if (old_dvs && !new_dvs ||
+		    cur_dvs && !new_dvs) {
 			pr_debug("%s: exiting dvs\n", __func__);
 			cur_dvs = false;
 			gpio_set_value(OSIRIS_GPIO_DVS, 1);
 		}
 		break;
 	case CPUFREQ_POSTCHANGE:
-		if (!old_dvs & new_dvs ||
-		    !cur_dvs & new_dvs) {
+		if (!old_dvs && new_dvs ||
+		    !cur_dvs && new_dvs) {
 			pr_debug("entering dvs\n");
 			cur_dvs = true;
 			gpio_set_value(OSIRIS_GPIO_DVS, 0);
-- 
2.20.1


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

* Re: [PATCH] ARM: mach-s3c24xx: Fix boolean expressions in osiris_dvs_notify
  2019-01-03 20:14 [PATCH] ARM: mach-s3c24xx: Fix boolean expressions in osiris_dvs_notify Gustavo A. R. Silva
@ 2019-01-04 13:27 ` Krzysztof Kozlowski
  2019-01-07 19:43 ` Krzysztof Kozlowski
  1 sibling, 0 replies; 6+ messages in thread
From: Krzysztof Kozlowski @ 2019-01-04 13:27 UTC (permalink / raw)
  To: Gustavo A. R. Silva
  Cc: Ben Dooks, Kukjin Kim, Russell King, linux-arm-kernel,
	linux-samsung-soc, linux-kernel

On Thu, 3 Jan 2019 at 21:46, Gustavo A. R. Silva <gustavo@embeddedor.com> wrote:
>
> Fix boolean expressions by using logical AND operator '&&'
> instead of bitwise operator '&'.
>
> This issue was detected with the help of Coccinelle.
>
> Fixes: 4fa084af28ca ("ARM: OSIRIS: DVS (Dynamic Voltage Scaling) supoort.")
> Cc: stable@vger.kernel.org
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
> ---
>  arch/arm/mach-s3c24xx/mach-osiris-dvs.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/arch/arm/mach-s3c24xx/mach-osiris-dvs.c b/arch/arm/mach-s3c24xx/mach-osiris-dvs.c
> index 058ce73137e8..ccbd7b7965ca 100644
> --- a/arch/arm/mach-s3c24xx/mach-osiris-dvs.c
> +++ b/arch/arm/mach-s3c24xx/mach-osiris-dvs.c
> @@ -65,16 +65,16 @@ static int osiris_dvs_notify(struct notifier_block *nb,
>
>         switch (val) {
>         case CPUFREQ_PRECHANGE:
> -               if (old_dvs & !new_dvs ||
> -                   cur_dvs & !new_dvs) {
> +               if (old_dvs && !new_dvs ||
> +                   cur_dvs && !new_dvs) {

Technically the old code will work fine because all variables are
bools (so 0 or 1). Therefore I am not sure whether this should be
ported to stable.

Anyway the patch is itself okay and I will take it after merge window. Thanks!

Best regards,
Krzysztof

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

* Re: [PATCH] ARM: mach-s3c24xx: Fix boolean expressions in osiris_dvs_notify
  2019-01-03 20:14 [PATCH] ARM: mach-s3c24xx: Fix boolean expressions in osiris_dvs_notify Gustavo A. R. Silva
  2019-01-04 13:27 ` Krzysztof Kozlowski
@ 2019-01-07 19:43 ` Krzysztof Kozlowski
  2019-01-07 20:32   ` Gustavo A. R. Silva
  1 sibling, 1 reply; 6+ messages in thread
From: Krzysztof Kozlowski @ 2019-01-07 19:43 UTC (permalink / raw)
  To: Gustavo A. R. Silva
  Cc: Ben Dooks, Kukjin Kim, Russell King, linux-arm-kernel,
	linux-samsung-soc, linux-kernel

On Thu, Jan 03, 2019 at 02:14:08PM -0600, Gustavo A. R. Silva wrote:
> Fix boolean expressions by using logical AND operator '&&'
> instead of bitwise operator '&'.
> 
> This issue was detected with the help of Coccinelle.
> 
> Fixes: 4fa084af28ca ("ARM: OSIRIS: DVS (Dynamic Voltage Scaling) supoort.")
> Cc: stable@vger.kernel.org
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
> ---
>  arch/arm/mach-s3c24xx/mach-osiris-dvs.c | 8 ++++----

Thanks, applied with fixing up -Wparentheses warning. I think you should
update your GCC.

Best regards,
Krzysztof

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

* Re: [PATCH] ARM: mach-s3c24xx: Fix boolean expressions in osiris_dvs_notify
  2019-01-07 19:43 ` Krzysztof Kozlowski
@ 2019-01-07 20:32   ` Gustavo A. R. Silva
  2019-01-08  7:42     ` Krzysztof Kozlowski
  0 siblings, 1 reply; 6+ messages in thread
From: Gustavo A. R. Silva @ 2019-01-07 20:32 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Ben Dooks, Kukjin Kim, Russell King, linux-arm-kernel,
	linux-samsung-soc, linux-kernel

Hi Krzysztof,

On 1/7/19 1:43 PM, Krzysztof Kozlowski wrote:
> On Thu, Jan 03, 2019 at 02:14:08PM -0600, Gustavo A. R. Silva wrote:
>> Fix boolean expressions by using logical AND operator '&&'
>> instead of bitwise operator '&'.
>>
>> This issue was detected with the help of Coccinelle.
>>
>> Fixes: 4fa084af28ca ("ARM: OSIRIS: DVS (Dynamic Voltage Scaling) supoort.")
>> Cc: stable@vger.kernel.org
>> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
>> ---
>>   arch/arm/mach-s3c24xx/mach-osiris-dvs.c | 8 ++++----
> 
> Thanks, applied with fixing up -Wparentheses warning. I think you should
> update your GCC.
> 

Thanks for that.

I wonder if you could take these too:

https://lore.kernel.org/lkml/418252fcd77472413ce15ac3df167e448a4defe9.1546667177.git.gustavo@embeddedor.com/
https://lore.kernel.org/lkml/2795c5ba939fe23dda6c86135d56e68433f7d68a.1546667177.git.gustavo@embeddedor.com/

Thanks
--
Gustavo

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

* Re: [PATCH] ARM: mach-s3c24xx: Fix boolean expressions in osiris_dvs_notify
  2019-01-07 20:32   ` Gustavo A. R. Silva
@ 2019-01-08  7:42     ` Krzysztof Kozlowski
  2019-01-08 18:14       ` Gustavo A. R. Silva
  0 siblings, 1 reply; 6+ messages in thread
From: Krzysztof Kozlowski @ 2019-01-08  7:42 UTC (permalink / raw)
  To: Gustavo A. R. Silva
  Cc: Ben Dooks, Kukjin Kim, Russell King, linux-arm-kernel,
	linux-samsung-soc, linux-kernel

On Mon, 7 Jan 2019 at 21:33, Gustavo A. R. Silva <gustavo@embeddedor.com> wrote:
>
> Hi Krzysztof,
>
> On 1/7/19 1:43 PM, Krzysztof Kozlowski wrote:
> > On Thu, Jan 03, 2019 at 02:14:08PM -0600, Gustavo A. R. Silva wrote:
> >> Fix boolean expressions by using logical AND operator '&&'
> >> instead of bitwise operator '&'.
> >>
> >> This issue was detected with the help of Coccinelle.
> >>
> >> Fixes: 4fa084af28ca ("ARM: OSIRIS: DVS (Dynamic Voltage Scaling) supoort.")
> >> Cc: stable@vger.kernel.org
> >> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
> >> ---
> >>   arch/arm/mach-s3c24xx/mach-osiris-dvs.c | 8 ++++----
> >
> > Thanks, applied with fixing up -Wparentheses warning. I think you should
> > update your GCC.
> >
>
> Thanks for that.
>
> I wonder if you could take these too:
>
> https://lore.kernel.org/lkml/418252fcd77472413ce15ac3df167e448a4defe9.1546667177.git.gustavo@embeddedor.com/
> https://lore.kernel.org/lkml/2795c5ba939fe23dda6c86135d56e68433f7d68a.1546667177.git.gustavo@embeddedor.com/

Can't do. I am maintainer only for ARM/Samsung platform and these are
for Integrator.

Best regards,
Krzysztof

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

* Re: [PATCH] ARM: mach-s3c24xx: Fix boolean expressions in osiris_dvs_notify
  2019-01-08  7:42     ` Krzysztof Kozlowski
@ 2019-01-08 18:14       ` Gustavo A. R. Silva
  0 siblings, 0 replies; 6+ messages in thread
From: Gustavo A. R. Silva @ 2019-01-08 18:14 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Ben Dooks, Kukjin Kim, Russell King, linux-arm-kernel,
	linux-samsung-soc, linux-kernel



On 1/8/19 1:42 AM, Krzysztof Kozlowski wrote:

>>
>> I wonder if you could take these too:
>>
>> https://lore.kernel.org/lkml/418252fcd77472413ce15ac3df167e448a4defe9.1546667177.git.gustavo@embeddedor.com/
>> https://lore.kernel.org/lkml/2795c5ba939fe23dda6c86135d56e68433f7d68a.1546667177.git.gustavo@embeddedor.com/
> 
> Can't do. I am maintainer only for ARM/Samsung platform and these are
> for Integrator.
> 

Oh Okay. I got it.

Thanks
--
Gustavo

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

end of thread, other threads:[~2019-01-08 18:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-03 20:14 [PATCH] ARM: mach-s3c24xx: Fix boolean expressions in osiris_dvs_notify Gustavo A. R. Silva
2019-01-04 13:27 ` Krzysztof Kozlowski
2019-01-07 19:43 ` Krzysztof Kozlowski
2019-01-07 20:32   ` Gustavo A. R. Silva
2019-01-08  7:42     ` Krzysztof Kozlowski
2019-01-08 18:14       ` Gustavo A. R. Silva

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).