[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87bk0eidiz.fsf@somnus>
Date: Mon, 23 Sep 2024 17:40:52 +0200
From: Anna-Maria Behnsen <anna-maria@...utronix.de>
To: Frederic Weisbecker <frederic@...nel.org>, Thomas Gleixner
<tglx@...utronix.de>, Jonathan Corbet <corbet@....net>
Cc: linux-kernel@...r.kernel.org, Len Brown <len.brown@...el.com>, "Rafael
J. Wysocki" <rafael@...nel.org>
Subject: Re: [PATCH v2 06/15] delay: Rework udelay and ndelay
Anna-Maria Behnsen <anna-maria@...utronix.de> writes:
> udelay() as well as ndelay() are defines and no functions and are using
> constants to be able to transform a sleep time into loops and to prevent
> too long udelays/ndelays. There was a compiler error with non-const 8 bit
> arguments which was fixed by commit a87e553fabe8 ("asm-generic: delay.h fix
> udelay and ndelay for 8 bit args"). When using a function, the non-const 8
> bit argument is type casted and the problem would be gone.
>
> Transform udelay() and ndelay() into proper functions, remove the no longer
> and confusing division, add defines for the magic values and add some
> explanations as well.
>
> Suggested-by: Thomas Gleixner <tglx@...utronix.de>
> Signed-off-by: Anna-Maria Behnsen <anna-maria@...utronix.de>
> ---
> v2: New in v2 (as suggested by Thomas)
> ---
> include/asm-generic/delay.h | 64 +++++++++++++++++++++++++--------------------
> 1 file changed, 36 insertions(+), 28 deletions(-)
>
> diff --git a/include/asm-generic/delay.h b/include/asm-generic/delay.h
> index 70a1b20f3e1a..40d30dc2488b 100644
> --- a/include/asm-generic/delay.h
> +++ b/include/asm-generic/delay.h
> @@ -2,6 +2,8 @@
> #ifndef __ASM_GENERIC_DELAY_H
> #define __ASM_GENERIC_DELAY_H
>
> +#include <vdso/time64.h>
There was a build failure for i386 (missing include
<linux/math.h>). Will be updated with v3.
Thanks,
Anna-Maria
Powered by blists - more mailing lists