Re: [PATCH v7 06/19] xen/bitops: put __ffs() into linux compatible header

2024-04-12 Thread Shawn Anastasio
Hi Oleksii, On 4/3/24 5:19 AM, Oleksii Kurochko wrote: > The mentioned macros exist only because of Linux compatible purpose. > > The patch defines __ffs() in terms of Xen bitops and it is safe > to define in this way ( as __ffs() - 1 ) as considering that __ffs() > was defined as

Re: [PATCH v7 06/19] xen/bitops: put __ffs() into linux compatible header

2024-04-04 Thread Jan Beulich
On 03.04.2024 12:19, Oleksii Kurochko wrote: > --- a/xen/include/xen/linux-compat.h > +++ b/xen/include/xen/linux-compat.h > @@ -19,4 +19,6 @@ typedef int64_t __s64; > > typedef paddr_t phys_addr_t; > > +#define __ffs(x) (ffsl(x) - 1) To be truly Linux-compatible, the result type would

[PATCH v7 06/19] xen/bitops: put __ffs() into linux compatible header

2024-04-03 Thread Oleksii Kurochko
The mentioned macros exist only because of Linux compatible purpose. The patch defines __ffs() in terms of Xen bitops and it is safe to define in this way ( as __ffs() - 1 ) as considering that __ffs() was defined as __builtin_ctzl(x), which has undefined behavior when x=0, so it is assumed that