linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] m68k: Fix ndelay() macro
@ 2016-10-28 15:12 Boris Brezillon
  2016-10-28 16:09 ` Geert Uytterhoeven
  2016-10-28 21:03 ` Philippe De Muyter
  0 siblings, 2 replies; 4+ messages in thread
From: Boris Brezillon @ 2016-10-28 15:12 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: linux-m68k, linux-kernel, Boris Brezillon

The current ndelay() macro definition has an extra semi-colon at the
end of the line thus leading to a compilation error when ndelay is used
in a conditional block with curly braces like this one:

	if (cond)
		ndelay(t);
	else
		...

which, after the preprocessor pass gives:

	if (cond)
		m68k_ndelay(t);;
	else
		...

thus leading to the following gcc error:

	error: 'else' without a previous 'if'

Remove this extra semi-colon.

Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Fixes: c8ee038bd1488 ("m68k: Implement ndelay() based on the existing udelay() logic")
---
 arch/m68k/include/asm/delay.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/m68k/include/asm/delay.h b/arch/m68k/include/asm/delay.h
index d28fa8fe26fe..c598d847d56b 100644
--- a/arch/m68k/include/asm/delay.h
+++ b/arch/m68k/include/asm/delay.h
@@ -114,6 +114,6 @@ static inline void __udelay(unsigned long usecs)
  */
 #define	HZSCALE		(268435456 / (1000000 / HZ))
 
-#define ndelay(n) __delay(DIV_ROUND_UP((n) * ((((HZSCALE) >> 11) * (loops_per_jiffy >> 11)) >> 6), 1000));
+#define ndelay(n) __delay(DIV_ROUND_UP((n) * ((((HZSCALE) >> 11) * (loops_per_jiffy >> 11)) >> 6), 1000))
 
 #endif /* defined(_M68K_DELAY_H) */
-- 
2.7.4

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

* Re: [PATCH] m68k: Fix ndelay() macro
  2016-10-28 15:12 [PATCH] m68k: Fix ndelay() macro Boris Brezillon
@ 2016-10-28 16:09 ` Geert Uytterhoeven
  2016-10-28 21:03 ` Philippe De Muyter
  1 sibling, 0 replies; 4+ messages in thread
From: Geert Uytterhoeven @ 2016-10-28 16:09 UTC (permalink / raw)
  To: Boris Brezillon; +Cc: linux-m68k, linux-kernel

Hi Boris,

On Fri, Oct 28, 2016 at 5:12 PM, Boris Brezillon
<boris.brezillon@free-electrons.com> wrote:
> The current ndelay() macro definition has an extra semi-colon at the
> end of the line thus leading to a compilation error when ndelay is used
> in a conditional block with curly braces like this one:
>
>         if (cond)
>                 ndelay(t);
>         else
>                 ...
>
> which, after the preprocessor pass gives:
>
>         if (cond)
>                 m68k_ndelay(t);;
>         else
>                 ...
>
> thus leading to the following gcc error:
>
>         error: 'else' without a previous 'if'
>
> Remove this extra semi-colon.
>
> Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>

Thank you, will apply and queue for v4.9.

> Fixes: c8ee038bd1488 ("m68k: Implement ndelay() based on the existing udelay() logic")

Wow, that's even a quite recent commit. Needs backporting only to v3.10+...

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [PATCH] m68k: Fix ndelay() macro
  2016-10-28 15:12 [PATCH] m68k: Fix ndelay() macro Boris Brezillon
  2016-10-28 16:09 ` Geert Uytterhoeven
@ 2016-10-28 21:03 ` Philippe De Muyter
  2016-10-28 21:08   ` Geert Uytterhoeven
  1 sibling, 1 reply; 4+ messages in thread
From: Philippe De Muyter @ 2016-10-28 21:03 UTC (permalink / raw)
  To: Boris Brezillon; +Cc: Geert Uytterhoeven, linux-m68k, linux-kernel

On Fri, Oct 28, 2016 at 05:12:28PM +0200, Boris Brezillon wrote:
> The current ndelay() macro definition has an extra semi-colon at the
> end of the line thus leading to a compilation error when ndelay is used
> in a conditional block with curly braces like this one:

without curly braces

> 
> 	if (cond)
> 		ndelay(t);
> 	else
> 		...
> 

Philippe

-- 
Philippe De Muyter +32 2 6101532 Macq SA rue de l'Aeronef 2 B-1140 Bruxelles

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

* Re: [PATCH] m68k: Fix ndelay() macro
  2016-10-28 21:03 ` Philippe De Muyter
@ 2016-10-28 21:08   ` Geert Uytterhoeven
  0 siblings, 0 replies; 4+ messages in thread
From: Geert Uytterhoeven @ 2016-10-28 21:08 UTC (permalink / raw)
  To: Philippe De Muyter; +Cc: Boris Brezillon, linux-m68k, linux-kernel

Hi Philippe,

On Fri, Oct 28, 2016 at 11:03 PM, Philippe De Muyter <phdm@macq.eu> wrote:
> On Fri, Oct 28, 2016 at 05:12:28PM +0200, Boris Brezillon wrote:
>> The current ndelay() macro definition has an extra semi-colon at the
>> end of the line thus leading to a compilation error when ndelay is used
>> in a conditional block with curly braces like this one:
>
> without curly braces

Thanks, I'm fixing that up.

Boris: No need to resend.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

end of thread, other threads:[~2016-10-28 21:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-28 15:12 [PATCH] m68k: Fix ndelay() macro Boris Brezillon
2016-10-28 16:09 ` Geert Uytterhoeven
2016-10-28 21:03 ` Philippe De Muyter
2016-10-28 21:08   ` Geert Uytterhoeven

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).