lkml.org 
[lkml]   [2019]   [May]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC][PATCH] kernel.h: Add generic roundup_64() macro
From
Date

On 23/05/2019 16:27, Steven Rostedt wrote:
>
> I haven't yet tested this, but what about something like the following:
>
> ...perhaps forget about the constant check, and just force
> the power of two check:
>
> \
> if (!(__y & (__y >> 1))) { \
> __x = round_up(x, y); \
> } else { \

You probably want

           if (!(__y & (__y - 1))

--

Roger


\
 
 \ /
  Last update: 2019-05-24 17:21    [W:0.058 / U:1.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site