search for: round_up_sizebad

Displaying 3 results from an estimated 3 matches for "round_up_sizebad".

2019 May 23
4
[RFC][PATCH] kernel.h: Add generic roundup_64() macro
On Thu, 23 May 2019 08:10:44 -0700 Linus Torvalds <torvalds at linux-foundation.org> wrote: > On Thu, May 23, 2019 at 7:00 AM Steven Rostedt <rostedt at goodmis.org> wrote: > > > > +# define roundup_64(x, y) ( \ > > +{ \ > > + typeof(y) __y = y;
2019 May 23
0
[RFC][PATCH] kernel.h: Add generic roundup_64() macro
...prefix##_s, __VA_ARGS__); \ __ret; }) which would allow typed integer functions like this. So you could do something like #define round_up(x, y) size_fn(x, round_up_size, x, y) and then you define functions for round_up_size8/16/32/64 (and you have toi declare - but not define - round_up_sizebad()). Of course, you probably want the usual "at least use 'int'" semantics, in which case the "type" should be "(x)+0": #define round_up(x, y) size_fn((x)+0, round_up_size, x, y) and the 8-bit and 16-bit cases will never be used. We have a lot of cases...
2019 May 23
1
[RFC][PATCH] kernel.h: Add generic roundup_64() macro
...like this. So you could do > something like > > #define round_up(x, y) size_fn(x, round_up_size, x, y) > > and then you define functions for round_up_size8/16/32/64 (and you You mean define functions for round_up_size_{u|s}8/16/32/64 > have toi declare - but not define - round_up_sizebad()). > > Of course, you probably want the usual "at least use 'int'" semantics, > in which case the "type" should be "(x)+0": > > #define round_up(x, y) size_fn((x)+0, round_up_size, x, y) > > and the 8-bit and 16-bit cases will nev...