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

Re: [PATCH v1 20/29] xen/asm-generic: introduce stub header div64.h



On Thu, 2023-10-19 at 13:12 +0200, Jan Beulich wrote:
> On 14.09.2023 16:56, Oleksii Kurochko wrote:
> > --- /dev/null
> > +++ b/xen/include/asm-generic/div64.h
> > @@ -0,0 +1,24 @@
> > +/* SPDX-License-Identifier: GPL-2.0-only */
> > +#ifndef __ASM_GENERIC_DIV64
> > +#define __ASM_GENERIC_DIV64
> > +
> > +#include <xen/types.h>
> > +
> > +# define do_div(n,base) ({                                      \
> > +        uint32_t __base = (base);                               \
> > +        uint32_t __rem;                                         \
> > +        __rem = ((uint64_t)(n)) % __base;                       \
> > +        (n) = ((uint64_t)(n)) / __base;                         \
> > +        __rem;                                                  \
> > + })
> 
> While I'm fine with having just the BITS_PER_LONG == 64
> implementation
> here, this then still needs to have the #if retained that Arm has.
> Only
> with that will it then be fine to have a blank between # and define.
> 
> There are style issues though: A blank is missing after the comma,
> and according to recent agreement leading underscores should not be
> used for symbols like the ones here anymore (I also wonder whether
> "base" is really a good name for the symbol; "divisor" may be more to
> the point). There are also excess parentheses around the two cast
> expressions.
Thanks. I'll take mentioned into account.

~ Oleskii

 


Rackspace

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