[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK8P3a1GugkfpM7az6JDs4hQh-7CFz4VjykGspVD=-VSFgAX0Q@mail.gmail.com>
Date: Tue, 9 Apr 2019 08:44:56 +0200
From: Arnd Bergmann <arnd@...db.de>
To: Nathan Chancellor <natechancellor@...il.com>
Cc: Martin Schwidefsky <schwidefsky@...ibm.com>,
Heiko Carstens <heiko.carstens@...ibm.com>,
Julian Wiedmann <jwi@...ux.ibm.com>,
Ursula Braun <ubraun@...ux.ibm.com>,
clang-built-linux@...glegroups.com,
Nick Desaulniers <ndesaulniers@...gle.com>,
linux-s390 <linux-s390@...r.kernel.org>,
"David S. Miller" <davem@...emloft.net>,
Kittipon Meesompop <kmeesomp@...ux.vnet.ibm.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 04/12] s390: qeth: address type mismatch warning
On Tue, Apr 9, 2019 at 12:16 AM Nathan Chancellor
<natechancellor@...il.com> wrote:
>
> On Mon, Apr 08, 2019 at 11:26:17PM +0200, Arnd Bergmann wrote:
> > clang produces a harmless warning for each use for the qeth_adp_supported
> > macro:
> >
> > drivers/s390/net/qeth_l2_main.c:559:31: warning: implicit conversion from enumeration type 'enum qeth_ipa_setadp_cmd' to
> > different enumeration type 'enum qeth_ipa_funcs' [-Wenum-conversion]
> > if (qeth_adp_supported(card, IPA_SETADP_SET_PROMISC_MODE))
> > ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > drivers/s390/net/qeth_core.h:179:41: note: expanded from macro 'qeth_adp_supported'
> > qeth_is_ipa_supported(&c->options.adp, f)
> > ~~~~~~~~~~~~~~~~~~~~~ ^
> >
> > Add a version of this macro that uses the correct types, and
> > remove the unused qeth_adp_enabled() macro that has the same
> > problem.
> >
> > Signed-off-by: Arnd Bergmann <arnd@...db.de>
>
> I wonder if it is better to just change the func parameter to type long.
> I guess it's better to keep the type safety to make sure values aren't
> unintentionally mixed but the body of the functions is the same so does
> the type actually matter?
I think using the right enum type makes most sense here, as this seems
to be something that is easy to confuse.
Arnd
Powered by blists - more mailing lists