[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v6 08/14] arm/mem_access: Introduce GENMASK_ULL bit operation



>>> On 06.07.17 at 13:50, <proskurin@xxxxxxxxxxxxx> wrote:
> --- a/xen/include/asm-arm/config.h
> +++ b/xen/include/asm-arm/config.h
> @@ -19,6 +19,8 @@
>  #define BITS_PER_LONG (BYTES_PER_LONG << 3)
>  #define POINTER_ALIGN BYTES_PER_LONG
>  
> +#define BITS_PER_LONG_LONG 64

If we really want to be prepared for architectures where long long
is other than 64 bits wide, you'll have to also add this to x86.
Otherwise it's not needed here either.

Also how about BITS_PER_LLONG?

> @@ -128,7 +131,7 @@ static inline int generic_fls64(__u64 x)
>  static __inline__ int get_bitmask_order(unsigned int count)
>  {
>      int order;
> -    
> +
>      order = fls(count);
>      return order;   /* We could be slightly more clever with -1 here... */
>  }

If you really want to do cleanup here, please shrink the function
body to a single return statement. But then again I'm unconvinced
the function is actually correct (which could easily be the case for
an unused one), in particular for power-of-2 counts. Nor can I see
how this would be useful with anything more narrow than size_t
or unsigned long as parameter type.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.