[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6acb24504a454638848dd9adff7cb5dc@AcuMS.aculab.com>
Date: Wed, 6 Nov 2024 22:19:55 +0000
From: David Laight <David.Laight@...LAB.COM>
To: 'Thomas Gleixner' <tglx@...utronix.de>, Geert Uytterhoeven
<geert@...ux-m68k.org>
CC: Easwar Hariharan <eahariha@...ux.microsoft.com>, "K. Y. Srinivasan"
<kys@...rosoft.com>, Haiyang Zhang <haiyangz@...rosoft.com>, Wei Liu
<wei.liu@...nel.org>, Dexuan Cui <decui@...rosoft.com>,
"linux-hyperv@...r.kernel.org" <linux-hyperv@...r.kernel.org>, "Anna-Maria
Behnsen" <anna-maria@...utronix.de>, Marcel Holtmann <marcel@...tmann.org>,
Johan Hedberg <johan.hedberg@...il.com>, Luiz Augusto von Dentz
<luiz.dentz@...il.com>, "linux-bluetooth@...r.kernel.org"
<linux-bluetooth@...r.kernel.org>, "linux-kernel@...r.kernel.org"
<linux-kernel@...r.kernel.org>, Michael Kelley <mhklinux@...look.com>
Subject: RE: [PATCH v2 1/2] jiffies: Define secs_to_jiffies()
From: Thomas Gleixner
> Sent: 29 October 2024 17:25
>
> On Tue, Oct 29 2024 at 17:22, Geert Uytterhoeven wrote:
> > On Tue, Oct 29, 2024 at 5:08 PM Thomas Gleixner <tglx@...utronix.de> wrote:
> >> On Mon, Oct 28 2024 at 19:11, Easwar Hariharan wrote:
> >> > diff --git a/include/linux/jiffies.h b/include/linux/jiffies.h
> >> > index 1220f0fbe5bf..e5256bb5f851 100644
> >> > --- a/include/linux/jiffies.h
> >> > +++ b/include/linux/jiffies.h
> >> > @@ -526,6 +526,8 @@ static __always_inline unsigned long msecs_to_jiffies(const unsigned int m)
> >> > }
> >> > }
> >> >
> >> > +#define secs_to_jiffies(_secs) ((_secs) * HZ)
> >>
> >> Can you please make that a static inline, as there is no need for macro
> >> magic like in the other conversions, and add a kernel doc comment which
> >> documents this?
> >
> > Note that a static inline means it cannot be used in e.g. struct initializers,
> > which are substantial users of "<value> * HZ".
>
> Bah. That wants to be mentioned in the change log then.
>
> Still the macro should be documented.
I was wondering if it really had any purpose at all.
It just obfuscates code, doesn't even make it smaller.
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
Powered by blists - more mailing lists