Re: [PATCH v2 06/15] delay: Rework udelay and ndelay

From: Frederic Weisbecker
Date: Tue Oct 08 2024 - 10:29:28 EST


Le Wed, Sep 11, 2024 at 07:13:32AM +0200, Anna-Maria Behnsen a écrit :
> 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@xxxxxxxxxxxxx>
> Signed-off-by: Anna-Maria Behnsen <anna-maria@xxxxxxxxxxxxx>

More light at the end of the tunnel for my brain!

Reviewed-by: Frederic Weisbecker <frederic@xxxxxxxxxx>