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

2024-01-19 Thread Lucas De Marchi
On Thu, Jan 18, 2024 at 06:01:58PM -0800, Yury Norov wrote: On Thu, Jan 18, 2024 at 05:25:00PM -0600, Lucas De Marchi wrote: SA2PR11MB4874 X-OriginatorOrg: intel.com Status: RO Content-Length: 6257 Lines: 150 On Thu, Jan 18, 2024 at 01:48:43PM -0800, Yury Norov wrote: > On Thu, Jan 18, 2024 at

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

2024-01-18 Thread Yury Norov
On Thu, Jan 18, 2024 at 05:25:00PM -0600, Lucas De Marchi wrote: > SA2PR11MB4874 > X-OriginatorOrg: intel.com > Status: RO > Content-Length: 6257 > Lines: 150 > > On Thu, Jan 18, 2024 at 01:48:43PM -0800, Yury Norov wrote: > > On Thu, Jan 18, 2024 at 02:42:12PM -0600, Lucas De Marchi wrote: > > >

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

2024-01-18 Thread Lucas De Marchi
On Thu, Jan 18, 2024 at 01:48:43PM -0800, Yury Norov wrote: On Thu, Jan 18, 2024 at 02:42:12PM -0600, Lucas De Marchi wrote: Hi, Reviving this thread as now with xe driver merged we have 2 users for a fixed-width BIT/GENMASK. Can you point where and why? See users of REG_GENMASK and

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

2024-01-18 Thread Yury Norov
On Thu, Jan 18, 2024 at 02:42:12PM -0600, Lucas De Marchi wrote: > Hi, > > Reviving this thread as now with xe driver merged we have 2 users for > a fixed-width BIT/GENMASK. Can you point where and why? > On Wed, Jun 21, 2023 at 07:20:59PM -0700, Yury Norov wrote: > > Hi Lucas, all! > > > >

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

2024-01-18 Thread Lucas De Marchi
Hi, Reviving this thread as now with xe driver merged we have 2 users for a fixed-width BIT/GENMASK. 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

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

2023-06-22 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: [PATCH 2/3] linux/bits.h: Add fixed-width GENMASK and BIT macros

2023-06-22 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: [PATCH 2/3] linux/bits.h: Add fixed-width GENMASK and BIT macros

2023-06-21 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

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

2023-06-20 Thread Jani Nikula
On Tue, 20 Jun 2023, Andy Shevchenko wrote: > So, what does prevent you from using GENMASK_ULL()? > > Another point, you may teach GENMASK() to issue a warning if hi and/or lo > bigger than BITS_PER_LONG. What good does that do if you want the warning for a fixed size different from unsigned

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

2023-06-20 Thread Lucas De Marchi
On Tue, Jun 20, 2023 at 08:41:10PM +0300, Andy Shevchenko wrote: On Tue, Jun 20, 2023 at 10:25:21AM -0700, Lucas De Marchi wrote: On Tue, Jun 20, 2023 at 05:55:19PM +0300, Andy Shevchenko wrote: > On Tue, Jun 20, 2023 at 05:47:34PM +0300, Jani Nikula wrote: > > On Thu, 15 Jun 2023, Andy

Re: [Intel-xe] [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 10:25:21AM -0700, Lucas De Marchi wrote: > On Tue, Jun 20, 2023 at 05:55:19PM +0300, Andy Shevchenko wrote: > > 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

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

2023-06-20 Thread Lucas De Marchi
On Tue, Jun 20, 2023 at 05:55:19PM +0300, Andy Shevchenko wrote: 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,

Re: [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

Re: [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

Re: [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

Re: [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

Re: [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: [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

Re: [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: [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

Re: [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: [PATCH 2/3] linux/bits.h: Add fixed-width GENMASK and BIT macros

2023-05-10 Thread kernel test robot
-8/20230509-131544 base: git://anongit.freedesktop.org/drm-intel for-linux-next patch link: https://lore.kernel.org/r/20230509051403.2748545-3-lucas.demarchi%40intel.com patch subject: [PATCH 2/3] linux/bits.h: Add fixed-width GENMASK and BIT macros config: arm64-randconfig-r021-20230509

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

2023-05-09 Thread Lucas De Marchi
On Tue, May 09, 2023 at 11:00:36AM -0300, Gustavo Sousa wrote: Quoting Lucas De Marchi (2023-05-09 02:14:02) 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

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

2023-05-09 Thread Gustavo Sousa
Quoting Lucas De Marchi (2023-05-09 02:14:02) >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

[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