Re: [PATCH] IB/mlx4: Avoid implicit enumerated type conversion

2018-10-03 Thread Nick Desaulniers
On Wed, Oct 3, 2018 at 4:01 PM Jason Gunthorpe wrote: > > On Wed, Oct 03, 2018 at 03:53:58PM -0700, Nick Desaulniers wrote: > > On Wed, Oct 3, 2018 at 3:35 PM Jason Gunthorpe wrote: > > > > > > On Mon, Sep 24, 2018 at 12:57:16PM -0700, Nathan Chancellor wrote: > > > > Clang warns when one enumera

Re: [PATCH] IB/mlx4: Avoid implicit enumerated type conversion

2018-10-03 Thread Jason Gunthorpe
On Wed, Oct 03, 2018 at 03:53:58PM -0700, Nick Desaulniers wrote: > On Wed, Oct 3, 2018 at 3:35 PM Jason Gunthorpe wrote: > > > > On Mon, Sep 24, 2018 at 12:57:16PM -0700, Nathan Chancellor wrote: > > > Clang warns when one enumerated type is implicitly converted to another. > > > > > > drivers/in

Re: [PATCH] IB/mlx4: Avoid implicit enumerated type conversion

2018-10-03 Thread Nick Desaulniers
On Wed, Oct 3, 2018 at 3:35 PM Jason Gunthorpe wrote: > > On Mon, Sep 24, 2018 at 12:57:16PM -0700, Nathan Chancellor wrote: > > Clang warns when one enumerated type is implicitly converted to another. > > > > drivers/infiniband/hw/mlx4/mad.c:1811:41: warning: implicit conversion > > from enumerat

Re: [PATCH] IB/mlx4: Avoid implicit enumerated type conversion

2018-10-03 Thread Jason Gunthorpe
On Mon, Sep 24, 2018 at 12:57:16PM -0700, Nathan Chancellor wrote: > Clang warns when one enumerated type is implicitly converted to another. > > drivers/infiniband/hw/mlx4/mad.c:1811:41: warning: implicit conversion > from enumeration type 'enum mlx4_ib_qp_flags' to different enumeration > type '

Re: [PATCH] IB/mlx4: Avoid implicit enumerated type conversion

2018-09-27 Thread Jason Gunthorpe
On Thu, Sep 27, 2018 at 05:55:43PM -0700, Nick Desaulniers wrote: > On Thu, Sep 27, 2018 at 3:58 PM Jason Gunthorpe wrote: > > > > On Thu, Sep 27, 2018 at 03:42:24PM -0700, Nick Desaulniers wrote: > > > On Thu, Sep 27, 2018 at 3:33 PM Bart Van Assche > > > wrote: > > > > > > > > On Thu, 2018-09-

Re: [PATCH] IB/mlx4: Avoid implicit enumerated type conversion

2018-09-27 Thread Nick Desaulniers
On Thu, Sep 27, 2018 at 3:58 PM Jason Gunthorpe wrote: > > On Thu, Sep 27, 2018 at 03:42:24PM -0700, Nick Desaulniers wrote: > > On Thu, Sep 27, 2018 at 3:33 PM Bart Van Assche wrote: > > > > > > On Thu, 2018-09-27 at 16:28 -0600, Jason Gunthorpe wrote: > > > > On Thu, Sep 27, 2018 at 01:34:16PM

Re: [PATCH] IB/mlx4: Avoid implicit enumerated type conversion

2018-09-27 Thread Bart Van Assche
On Thu, 2018-09-27 at 16:58 -0600, Jason Gunthorpe wrote: > Anyhow, the standard is hard to read in this area, but reality is > this: > > #include > > enum a > { > A1 = 1, > A2 = 1ULL<<40, > }; > > int main(int argc, const char *argv[]) > { > printf("%zu\n", sizeof(enum a)); >

Re: [PATCH] IB/mlx4: Avoid implicit enumerated type conversion

2018-09-27 Thread Jason Gunthorpe
On Thu, Sep 27, 2018 at 03:42:24PM -0700, Nick Desaulniers wrote: > On Thu, Sep 27, 2018 at 3:33 PM Bart Van Assche wrote: > > > > On Thu, 2018-09-27 at 16:28 -0600, Jason Gunthorpe wrote: > > > On Thu, Sep 27, 2018 at 01:34:16PM -0700, Nick Desaulniers wrote: > > > > > > > > Neither ib_qp_create_

Re: [PATCH] IB/mlx4: Avoid implicit enumerated type conversion

2018-09-27 Thread Nick Desaulniers
On Thu, Sep 27, 2018 at 3:33 PM Bart Van Assche wrote: > > On Thu, 2018-09-27 at 16:28 -0600, Jason Gunthorpe wrote: > > On Thu, Sep 27, 2018 at 01:34:16PM -0700, Nick Desaulniers wrote: > > > > > > Neither ib_qp_create_flags nor mlx4_ib_qp_flags have negative values, is > > > > signedness necessa

Re: [PATCH] IB/mlx4: Avoid implicit enumerated type conversion

2018-09-27 Thread Bart Van Assche
On Thu, 2018-09-27 at 16:28 -0600, Jason Gunthorpe wrote: > On Thu, Sep 27, 2018 at 01:34:16PM -0700, Nick Desaulniers wrote: > > > > Neither ib_qp_create_flags nor mlx4_ib_qp_flags have negative values, is > > > signedness necessary? > > > > enums are by default restricted to the range of ints.

Re: [PATCH] IB/mlx4: Avoid implicit enumerated type conversion

2018-09-27 Thread Jason Gunthorpe
On Thu, Sep 27, 2018 at 01:34:16PM -0700, Nick Desaulniers wrote: > > Neither ib_qp_create_flags nor mlx4_ib_qp_flags have negative values, is > > signedness necessary? > > enums are by default restricted to the range of ints. That's not quite right, the compiler sizes the enum to be able to fi

Re: [PATCH] IB/mlx4: Avoid implicit enumerated type conversion

2018-09-27 Thread Nathan Chancellor
On Thu, Sep 27, 2018 at 01:34:16PM -0700, Nick Desaulniers wrote: > On Thu, Sep 27, 2018 at 1:28 PM Nathan Chancellor > wrote: > > > > On Thu, Sep 27, 2018 at 01:13:31PM -0700, Nick Desaulniers wrote: > > > On Wed, Sep 26, 2018 at 9:48 PM Jason Gunthorpe wrote: > > > > > > > > On Wed, Sep 26, 201

Re: [PATCH] IB/mlx4: Avoid implicit enumerated type conversion

2018-09-27 Thread Nick Desaulniers
On Thu, Sep 27, 2018 at 1:28 PM Nathan Chancellor wrote: > > On Thu, Sep 27, 2018 at 01:13:31PM -0700, Nick Desaulniers wrote: > > On Wed, Sep 26, 2018 at 9:48 PM Jason Gunthorpe wrote: > > > > > > On Wed, Sep 26, 2018 at 06:08:03PM -0700, Nathan Chancellor wrote: > > > > On Mon, Sep 24, 2018 at

Re: [PATCH] IB/mlx4: Avoid implicit enumerated type conversion

2018-09-27 Thread Nathan Chancellor
On Thu, Sep 27, 2018 at 01:13:31PM -0700, Nick Desaulniers wrote: > On Wed, Sep 26, 2018 at 9:48 PM Jason Gunthorpe wrote: > > > > On Wed, Sep 26, 2018 at 06:08:03PM -0700, Nathan Chancellor wrote: > > > On Mon, Sep 24, 2018 at 08:37:22PM -0600, Jason Gunthorpe wrote: > > > > On Mon, Sep 24, 2018

Re: [PATCH] IB/mlx4: Avoid implicit enumerated type conversion

2018-09-27 Thread Nick Desaulniers
On Wed, Sep 26, 2018 at 9:48 PM Jason Gunthorpe wrote: > > On Wed, Sep 26, 2018 at 06:08:03PM -0700, Nathan Chancellor wrote: > > On Mon, Sep 24, 2018 at 08:37:22PM -0600, Jason Gunthorpe wrote: > > > On Mon, Sep 24, 2018 at 03:29:38PM -0700, Nick Desaulniers wrote: > > > > On Mon, Sep 24, 2018 at

Re: [PATCH] IB/mlx4: Avoid implicit enumerated type conversion

2018-09-26 Thread Jason Gunthorpe
On Wed, Sep 26, 2018 at 06:08:03PM -0700, Nathan Chancellor wrote: > On Mon, Sep 24, 2018 at 08:37:22PM -0600, Jason Gunthorpe wrote: > > On Mon, Sep 24, 2018 at 03:29:38PM -0700, Nick Desaulniers wrote: > > > On Mon, Sep 24, 2018 at 3:27 PM Nathan Chancellor > > > wrote: > > > > > > > > On Mon, S

Re: [PATCH] IB/mlx4: Avoid implicit enumerated type conversion

2018-09-26 Thread Nathan Chancellor
On Mon, Sep 24, 2018 at 08:37:22PM -0600, Jason Gunthorpe wrote: > On Mon, Sep 24, 2018 at 03:29:38PM -0700, Nick Desaulniers wrote: > > On Mon, Sep 24, 2018 at 3:27 PM Nathan Chancellor > > wrote: > > > > > > On Mon, Sep 24, 2018 at 03:24:36PM -0700, Nick Desaulniers wrote: > > > > On Mon, Sep 24

Re: [PATCH] IB/mlx4: Avoid implicit enumerated type conversion

2018-09-24 Thread Jason Gunthorpe
On Mon, Sep 24, 2018 at 03:29:38PM -0700, Nick Desaulniers wrote: > On Mon, Sep 24, 2018 at 3:27 PM Nathan Chancellor > wrote: > > > > On Mon, Sep 24, 2018 at 03:24:36PM -0700, Nick Desaulniers wrote: > > > On Mon, Sep 24, 2018 at 12:57 PM Nathan Chancellor > > > wrote: > > > > > > > > Clang warn

Re: [PATCH] IB/mlx4: Avoid implicit enumerated type conversion

2018-09-24 Thread Nick Desaulniers
On Mon, Sep 24, 2018 at 3:27 PM Nathan Chancellor wrote: > > On Mon, Sep 24, 2018 at 03:24:36PM -0700, Nick Desaulniers wrote: > > On Mon, Sep 24, 2018 at 12:57 PM Nathan Chancellor > > wrote: > > > > > > Clang warns when one enumerated type is implicitly converted to another. > > > > > > drivers

Re: [PATCH] IB/mlx4: Avoid implicit enumerated type conversion

2018-09-24 Thread Nathan Chancellor
On Mon, Sep 24, 2018 at 03:24:36PM -0700, Nick Desaulniers wrote: > On Mon, Sep 24, 2018 at 12:57 PM Nathan Chancellor > wrote: > > > > Clang warns when one enumerated type is implicitly converted to another. > > > > drivers/infiniband/hw/mlx4/mad.c:1811:41: warning: implicit conversion > > from e

Re: [PATCH] IB/mlx4: Avoid implicit enumerated type conversion

2018-09-24 Thread Nick Desaulniers
On Mon, Sep 24, 2018 at 12:57 PM Nathan Chancellor wrote: > > Clang warns when one enumerated type is implicitly converted to another. > > drivers/infiniband/hw/mlx4/mad.c:1811:41: warning: implicit conversion > from enumeration type 'enum mlx4_ib_qp_flags' to different enumeration > type 'enum ib

[PATCH] IB/mlx4: Avoid implicit enumerated type conversion

2018-09-24 Thread Nathan Chancellor
Clang warns when one enumerated type is implicitly converted to another. drivers/infiniband/hw/mlx4/mad.c:1811:41: warning: implicit conversion from enumeration type 'enum mlx4_ib_qp_flags' to different enumeration type 'enum ib_qp_create_flags' [-Wenum-conversion] qp_init_attr.ini