Re: [Intel-gfx] [PATCH 2/3] linux/bits.h: Add fixed-width GENMASK and BIT macros

2023-06-27 Thread Yury Norov
Hi Lucas, all! (Thanks, Andy, for pointing to this thread.) On Mon, May 08, 2023 at 10:14:02PM -0700, Lucas De Marchi wrote: > Add GENMASK_U32(), GENMASK_U16() and GENMASK_U8() macros to create > masks for fixed-width types and also the corresponding BIT_U32(), > BIT_U16() and BIT_U8(). Can you

Re: [Intel-gfx] [PATCH 2/3] linux/bits.h: Add fixed-width GENMASK and BIT macros

2023-06-27 Thread Yury Norov
+ Rasmus Villemoes > > -#define __GENMASK(h, l) \ > > - (((~UL(0)) - (UL(1) << (l)) + 1) & \ > > -(~UL(0) >> (BITS_PER_LONG - 1 - (h > > -#define GENMASK(h, l) \ > > - (GENMASK_INPUT_CHECK(h, l) + __GENMASK(h, l)) > > +#define __GENMASK(t, h, l) \ > > + (GENMASK_INPUT_CHECK(h, l) +

Re: [Intel-gfx] [PATCH 2/3] linux/bits.h: Add fixed-width GENMASK and BIT macros

2023-06-21 Thread Lucas De Marchi
On Wed, Jun 21, 2023 at 07:20:59PM -0700, Yury Norov wrote: Hi Lucas, all! (Thanks, Andy, for pointing to this thread.) On Mon, May 08, 2023 at 10:14:02PM -0700, Lucas De Marchi wrote: Add GENMASK_U32(), GENMASK_U16() and GENMASK_U8() macros to create masks for fixed-width types and also the

Re: [Intel-gfx] [PATCH 2/3] linux/bits.h: Add fixed-width GENMASK and BIT macros

2023-06-20 Thread Andy Shevchenko
On Tue, Jun 20, 2023 at 05:47:34PM +0300, Jani Nikula wrote: > On Thu, 15 Jun 2023, Andy Shevchenko > wrote: > > On Fri, May 12, 2023 at 02:45:19PM +0300, Jani Nikula wrote: > >> On Fri, 12 May 2023, Andy Shevchenko > >> wrote: > >> > On Fri, May 12, 2023 at 02:25:18PM +0300, Jani Nikula wrote:

Re: [Intel-gfx] [PATCH 2/3] linux/bits.h: Add fixed-width GENMASK and BIT macros

2023-06-20 Thread Jani Nikula
On Thu, 15 Jun 2023, Andy Shevchenko wrote: > On Fri, May 12, 2023 at 02:45:19PM +0300, Jani Nikula wrote: >> On Fri, 12 May 2023, Andy Shevchenko >> wrote: >> > On Fri, May 12, 2023 at 02:25:18PM +0300, Jani Nikula wrote: >> >> On Fri, 12 May 2023, Andy Shevchenko >> >> wrote: >> >> > On Mon,

Re: [Intel-gfx] [PATCH 2/3] linux/bits.h: Add fixed-width GENMASK and BIT macros

2023-06-15 Thread Andy Shevchenko
On Fri, May 12, 2023 at 09:29:23AM -0700, Lucas De Marchi wrote: > On Fri, May 12, 2023 at 02:14:19PM +0300, Andy Shevchenko wrote: > > On Mon, May 08, 2023 at 10:14:02PM -0700, Lucas De Marchi wrote: > > > Add GENMASK_U32(), GENMASK_U16() and GENMASK_U8() macros to create > > > masks for fixed-wi

Re: [Intel-gfx] [PATCH 2/3] linux/bits.h: Add fixed-width GENMASK and BIT macros

2023-06-15 Thread Andy Shevchenko
On Fri, May 12, 2023 at 02:45:19PM +0300, Jani Nikula wrote: > On Fri, 12 May 2023, Andy Shevchenko > wrote: > > On Fri, May 12, 2023 at 02:25:18PM +0300, Jani Nikula wrote: > >> On Fri, 12 May 2023, Andy Shevchenko > >> wrote: > >> > On Mon, May 08, 2023 at 10:14:02PM -0700, Lucas De Marchi wr

Re: [Intel-gfx] [PATCH 2/3] linux/bits.h: Add fixed-width GENMASK and BIT macros

2023-05-12 Thread Lucas De Marchi
On Fri, May 12, 2023 at 02:14:19PM +0300, Andy Shevchenko wrote: On Mon, May 08, 2023 at 10:14:02PM -0700, Lucas De Marchi wrote: Add GENMASK_U32(), GENMASK_U16() and GENMASK_U8() macros to create masks for fixed-width types and also the corresponding BIT_U32(), BIT_U16() and BIT_U8(). Why?

Re: [Intel-gfx] [PATCH 2/3] linux/bits.h: Add fixed-width GENMASK and BIT macros

2023-05-12 Thread Jani Nikula
On Fri, 12 May 2023, Andy Shevchenko wrote: > On Fri, May 12, 2023 at 02:25:18PM +0300, Jani Nikula wrote: >> On Fri, 12 May 2023, Andy Shevchenko >> wrote: >> > On Mon, May 08, 2023 at 10:14:02PM -0700, Lucas De Marchi wrote: >> >> Add GENMASK_U32(), GENMASK_U16() and GENMASK_U8() macros to cr

Re: [Intel-gfx] [PATCH 2/3] linux/bits.h: Add fixed-width GENMASK and BIT macros

2023-05-12 Thread Andy Shevchenko
On Fri, May 12, 2023 at 02:25:18PM +0300, Jani Nikula wrote: > On Fri, 12 May 2023, Andy Shevchenko > wrote: > > On Mon, May 08, 2023 at 10:14:02PM -0700, Lucas De Marchi wrote: > >> Add GENMASK_U32(), GENMASK_U16() and GENMASK_U8() macros to create > >> masks for fixed-width types and also the

Re: [Intel-gfx] [PATCH 2/3] linux/bits.h: Add fixed-width GENMASK and BIT macros

2023-05-12 Thread Jani Nikula
On Fri, 12 May 2023, Andy Shevchenko wrote: > On Mon, May 08, 2023 at 10:14:02PM -0700, Lucas De Marchi wrote: >> Add GENMASK_U32(), GENMASK_U16() and GENMASK_U8() macros to create >> masks for fixed-width types and also the corresponding BIT_U32(), >> BIT_U16() and BIT_U8(). > > Why? The main r

Re: [Intel-gfx] [PATCH 2/3] linux/bits.h: Add fixed-width GENMASK and BIT macros

2023-05-12 Thread Andy Shevchenko
On Mon, May 08, 2023 at 10:14:02PM -0700, Lucas De Marchi wrote: > Add GENMASK_U32(), GENMASK_U16() and GENMASK_U8() macros to create > masks for fixed-width types and also the corresponding BIT_U32(), > BIT_U16() and BIT_U8(). Why? > All of those depend on a new "U" suffix added to the integer

Re: [Intel-gfx] [PATCH 2/3] linux/bits.h: Add fixed-width GENMASK and BIT macros

2023-05-10 Thread kernel test robot
Hi Lucas, kernel test robot noticed the following build errors: [auto build test ERROR on drm-intel/for-linux-next] [also build test ERROR on drm-intel/for-linux-next-fixes drm-tip/drm-tip linus/master v6.4-rc1 next-20230510] [cannot apply to drm-misc/drm-misc-next] [If your patch is applied to

[Intel-gfx] [PATCH 2/3] linux/bits.h: Add fixed-width GENMASK and BIT macros

2023-05-08 Thread Lucas De Marchi
Add GENMASK_U32(), GENMASK_U16() and GENMASK_U8() macros to create masks for fixed-width types and also the corresponding BIT_U32(), BIT_U16() and BIT_U8(). All of those depend on a new "U" suffix added to the integer constant. Due to naming clashes it's better to call the macro U32. Since C does