s390: qeth: address type mismatch warning
authorArnd Bergmann <arnd@arndb.de>
Thu, 25 Apr 2019 16:25:54 +0000 (18:25 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 26 Apr 2019 15:14:06 +0000 (11:14 -0400)
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.

Reviewed-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/s390/net/qeth_core.h

index fbaf434e2e3449c028a5d3f2aaf7c81c6d1cb56d..86cae5e8e2c20a055f45db3a78495a08d4017361 100644 (file)
@@ -165,6 +165,12 @@ struct qeth_vnicc_info {
        bool rx_bcast_enabled;
 };
 
+static inline int qeth_is_adp_supported(struct qeth_ipa_info *ipa,
+               enum qeth_ipa_setadp_cmd func)
+{
+       return (ipa->supported_funcs & func);
+}
+
 static inline int qeth_is_ipa_supported(struct qeth_ipa_info *ipa,
                enum qeth_ipa_funcs func)
 {
@@ -178,9 +184,7 @@ static inline int qeth_is_ipa_enabled(struct qeth_ipa_info *ipa,
 }
 
 #define qeth_adp_supported(c, f) \
-       qeth_is_ipa_supported(&c->options.adp, f)
-#define qeth_adp_enabled(c, f) \
-       qeth_is_ipa_enabled(&c->options.adp, f)
+       qeth_is_adp_supported(&c->options.adp, f)
 #define qeth_is_supported(c, f) \
        qeth_is_ipa_supported(&c->options.ipa4, f)
 #define qeth_is_enabled(c, f) \