From: Jason Gunthorpe <jgg@mellanox.com>
To: Nathan Chancellor <natechancellor@gmail.com>
Cc: Moni Shoua <monis@mellanox.com>,
Doug Ledford <dledford@redhat.com>,
"linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Nick Desaulniers <ndesaulniers@google.com>
Subject: Re: [PATCH v3] IB/rxe: Remove unnecessary enum values
Date: Wed, 17 Oct 2018 10:23:32 +0000 [thread overview]
Message-ID: <20181017102331.GA30105@mellanox.com> (raw)
In-Reply-To: <20180927051222.23084-1-natechancellor@gmail.com>
On Wed, Sep 26, 2018 at 10:12:23PM -0700, Nathan Chancellor wrote:
> Clang warns when an emumerated type is implicitly converted to another.
>
> drivers/infiniband/sw/rxe/rxe.c:106:27: warning: implicit conversion
> from enumeration type 'enum rxe_device_param' to different enumeration
> type 'enum ib_atomic_cap' [-Wenum-conversion]
> rxe->attr.atomic_cap = RXE_ATOMIC_CAP;
> ~ ^~~~~~~~~~~~~~
> drivers/infiniband/sw/rxe/rxe.c:131:22: warning: implicit conversion
> from enumeration type 'enum rxe_port_param' to different enumeration
> type 'enum ib_port_state' [-Wenum-conversion]
> port->attr.state = RXE_PORT_STATE;
> ~ ^~~~~~~~~~~~~~
> drivers/infiniband/sw/rxe/rxe.c:132:24: warning: implicit conversion
> from enumeration type 'enum rxe_port_param' to different enumeration
> type 'enum ib_mtu' [-Wenum-conversion]
> port->attr.max_mtu = RXE_PORT_MAX_MTU;
> ~ ^~~~~~~~~~~~~~~~
> drivers/infiniband/sw/rxe/rxe.c:133:27: warning: implicit conversion
> from enumeration type 'enum rxe_port_param' to different enumeration
> type 'enum ib_mtu' [-Wenum-conversion]
> port->attr.active_mtu = RXE_PORT_ACTIVE_MTU;
> ~ ^~~~~~~~~~~~~~~~~~~
> drivers/infiniband/sw/rxe/rxe.c:151:24: warning: implicit conversion
> from enumeration type 'enum rxe_port_param' to different enumeration
> type 'enum ib_mtu' [-Wenum-conversion]
> ib_mtu_enum_to_int(RXE_PORT_ACTIVE_MTU);
> ~~~~~~~~~~~~~~~~~~ ^~~~~~~~~~~~~~~~~~~
> 5 warnings generated.
>
> Use the appropriate values from the expected enumerated type so no
> conversion needs to happen then remove the unneeded definitions.
>
> Reported-by: Nick Desaulniers <ndesaulniers@google.com>
> Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
> Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
> ---
Applied to for-next
Thanks,
Jason
prev parent reply other threads:[~2018-10-17 10:23 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20180927011010.8373-1-natechancellor@gmail.com>
2018-09-27 5:01 ` [PATCH v2] IB/rxe: Avoid implicit enum conversions in rxe_init functions Nathan Chancellor
2018-09-27 5:05 ` Jason Gunthorpe
2018-09-27 5:12 ` [PATCH v3] IB/rxe: Remove unnecessary enum values Nathan Chancellor
2018-09-27 20:18 ` Nick Desaulniers
2018-10-17 10:23 ` Jason Gunthorpe [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181017102331.GA30105@mellanox.com \
--to=jgg@mellanox.com \
--cc=dledford@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=monis@mellanox.com \
--cc=natechancellor@gmail.com \
--cc=ndesaulniers@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.