[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230731162646.GO29590@hirez.programming.kicks-ass.net>
Date: Mon, 31 Jul 2023 18:26:46 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Thomas Gleixner <tglx@...utronix.de>
Cc: axboe@...nel.dk, linux-kernel@...r.kernel.org, mingo@...hat.com,
dvhart@...radead.org, dave@...olabs.net, andrealmeid@...lia.com,
Andrew Morton <akpm@...ux-foundation.org>, urezki@...il.com,
hch@...radead.org, lstoakes@...il.com,
Arnd Bergmann <arnd@...db.de>, linux-api@...r.kernel.org,
linux-mm@...ck.org, linux-arch@...r.kernel.org,
malteskarupke@....de
Subject: Re: [PATCH v1 03/14] futex: Flag conversion
On Mon, Jul 31, 2023 at 06:21:56PM +0200, Thomas Gleixner wrote:
> On Fri, Jul 21 2023 at 12:22, Peter Zijlstra wrote:
> > +
> > +static inline bool futex_flags_valid(unsigned int flags)
> > +{
> > + /* Only 64bit futexes for 64bit code */
> > + if (!IS_ENABLED(CONFIG_64BIT) || in_compat_syscall()) {
> > + if ((flags & FLAGS_SIZE_MASK) == FLAGS_SIZE_64)
> > + return false;
> > + }
> > +
> > + /* Only 32bit futexes are implemented -- for now */
> > + if ((flags & FLAGS_SIZE_MASK) != FLAGS_SIZE_32)
> > + return false;
> > +
> > + return true;
> > +}
> > +
> > +static inline unsigned int futex_size(unsigned int flags)
> > +{
> > + unsigned int size = flags & FLAGS_SIZE_MASK;
> > + return 1 << size; /* {0,1,2,3} -> {1,2,4,8} */
>
> Lacks a new line and the comment is both misplaced and kinda obvious, no?
Yeah, it was a more complicated transform at some point, I'll fix.
Powered by blists - more mailing lists