[lustre-devel] [PATCH 33/34] lnet: use BIT() macro for LNET_MD_* flags

NeilBrown neilb at suse.com
Mon Oct 1 20:31:59 PDT 2018


On Fri, Sep 28 2018, James Simmons wrote:

>> As these are bit flags, it aids clarity to use the BIT()
>> macro.
>
> Nak. BIT is not for UAPI headers. Including this will break building
> userland applications.

Apparently not everyone knows this:

$ git grep  '[^A-Z_]BIT(' include/uapi/ | wc -l
11

However, it makes sense - thanks.
I've removed all the BITs that I added.

NeilBrown

>  
>> Signed-off-by: NeilBrown <neilb at suse.com>
>> ---
>>  .../lustre/include/uapi/linux/lnet/lnet-types.h    |   18 +++++++++---------
>>  1 file changed, 9 insertions(+), 9 deletions(-)
>> 
>> diff --git a/drivers/staging/lustre/include/uapi/linux/lnet/lnet-types.h b/drivers/staging/lustre/include/uapi/linux/lnet/lnet-types.h
>> index e80ef4182e5d..62f062c0d1bf 100644
>> --- a/drivers/staging/lustre/include/uapi/linux/lnet/lnet-types.h
>> +++ b/drivers/staging/lustre/include/uapi/linux/lnet/lnet-types.h
>> @@ -483,22 +483,22 @@ struct lnet_md {
>>  /**
>>   * Options for the MD structure. See lnet_md::options.
>>   */
>> -#define LNET_MD_OP_PUT		(1 << 0)
>> +#define LNET_MD_OP_PUT		BIT(0)
>>  /** See lnet_md::options. */
>> -#define LNET_MD_OP_GET		(1 << 1)
>> +#define LNET_MD_OP_GET		BIT(1)
>>  /** See lnet_md::options. */
>> -#define LNET_MD_MANAGE_REMOTE	(1 << 2)
>> -/* unused			(1 << 3) */
>> +#define LNET_MD_MANAGE_REMOTE	BIT(2)
>> +/* unused			BIT(3) */
>>  /** See lnet_md::options. */
>> -#define LNET_MD_TRUNCATE	(1 << 4)
>> +#define LNET_MD_TRUNCATE	BIT(4)
>>  /** See lnet_md::options. */
>> -#define LNET_MD_ACK_DISABLE	(1 << 5)
>> +#define LNET_MD_ACK_DISABLE	BIT(5)
>>  /** See lnet_md::options. */
>> -#define LNET_MD_IOVEC		(1 << 6)
>> +#define LNET_MD_IOVEC		BIT(6)
>>  /** See lnet_md::options. */
>> -#define LNET_MD_MAX_SIZE	(1 << 7)
>> +#define LNET_MD_MAX_SIZE	BIT(7)
>>  /** See lnet_md::options. */
>> -#define LNET_MD_KIOV		(1 << 8)
>> +#define LNET_MD_KIOV		BIT(8)
>>  
>>  /* For compatibility with Cray Portals */
>>  #define LNET_MD_PHYS		0
>> 
>> 
>> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <http://lists.lustre.org/pipermail/lustre-devel-lustre.org/attachments/20181002/ac115ffd/attachment.sig>


More information about the lustre-devel mailing list