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

Re: [Xen-devel] [PATCH 01/20] xen/const: Introduce _BITUL and _BITULL



Hi,

On 25/04/2019 13:15, Jan Beulich wrote:
On 22.04.19 at 18:49, <julien.grall@xxxxxxx> wrote:
The pattern _AC(1, UL{,L}) << X is commonly used in the headers to make
define usuable in both assembly and C.

So introduce _BITUL and _BITULL to make the code slightly more readable.

I don't particularly like the names, and I specifically object to
the leading underscores. I'm afraid I don't have better
suggestions for the names, but what I'd like to ask for is that
at least the UL / ULL be somehow separated from BIT. One
option might be something like

The _ match the other assembly macro we have defined in const.h. I understand you don't like the leading underscores, but I think consistency is better here.

The more keeping the same generic naming lower down the churn to import code from Linux.


#define BIT(pos, sfx) (_AC(1, sfx) << (pos))

BIT() is already define in Xen and used in code coming from Linux. I would rather not change the prototype for this reason.


albeit BIT may be a little too generic a name, yet something
like DEFINE_BIT looks a little longish. But at least it would also
allow e.g. plain unsigned (non-long) constants to be defined
without yet another new construct.

See above the reason why those names.

Cheers,

--
Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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