Re: [PATCH v1 03/14] futex: Flag conversion

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux