[openib-general] Re: [PATCH] kDAPL: remove DAT_BOOLEAN
Michael S. Tsirkin
mst at mellanox.co.il
Wed May 11 01:05:47 PDT 2005
Quoting r. Tom Duffy <tduffy at sun.com>:
> Subject: [PATCH] kDAPL: remove DAT_BOOLEAN
>
> I am sending this as a separate patch because I am not sure what the
> "right" thing to do is. Looking around the kernel, it seems booleans
> are handled in different ways. Some places, they are enums, others just
> #defines.
>
> In e1000, ixgb, compaq fc, DAT960, and xfs, they are enums. In jfs and
> arch parisc, a bool is an int and TRUE and FALSE are #define'd. TRUE
> and FALSE are defined so many times in the kernel, it seems rather
> ridiculous. Maybe the right thing to do is fix the whole kernel in a
> consistent way and submit an upstream patch, but this will require quite
> a bit of janitorial work.
Further, include/linux/synclink.h has
#define BOOLEAN int
and include/linux/arcdevice.h has
#define bool int
> I don't mind using either way in kDAPL (or some third -- getting rid of
> bool's all together?),but this patch uses the enum method. At least we
> need to get rid of the DAT_ prefix.
Is this type ever packed and passed on the wire? If yes that would
be a valid reason for something DAT_BOOLEAN, to make sure it has
a specific size.
> Singed-off-by: Tom Duffy <tduffy at sun.com>
Surprisingly, some DAT code just uses "bool" (below).
> Index: linux-kernel/test/dapltest/include/dapl_proto.h
> ===================================================================
> --- linux-kernel/test/dapltest/include/dapl_proto.h (revision 2295)
> +++ linux-kernel/test/dapltest/include/dapl_proto.h (working copy)
> @@ -88,8 +88,8 @@ Bpool * DT_BpoolAlloc (Per_Test_
> DAT_COUNT seg_size,
> DAT_COUNT num_segs,
> DAT_COUNT alignment,
> - DAT_BOOLEAN enable_rdma_write,
> - DAT_BOOLEAN enable_rdma_read);
> + boolean_t enable_rdma_write,
> + boolean_t enable_rdma_read);
>
> bool DT_Bpool_Destroy (Per_Test_Data_t * pt_ptr,
> DT_Tdep_Print_Head *phead,
> @@ -267,13 +267,13 @@ bool DT_Performance_Test_Serv
> bool DT_Performance_Test_Create (Per_Test_Data_t * pt_ptr,
> DAT_IA_HANDLE * ia_handle,
> DAT_IA_ADDRESS_PTR remote_ia_addr,
> - DAT_BOOLEAN is_server,
> - DAT_BOOLEAN is_remote_little_endian,
> + boolean_t is_server,
> + boolean_t is_remote_little_endian,
> Performance_Test_t **perf_test);
>
--
MST - Michael S. Tsirkin
More information about the general
mailing list