[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1554734927-15522-2-git-send-email-mzhivich@akamai.com>
Date: Mon, 8 Apr 2019 10:48:45 -0400
From: Michael Zhivich <mzhivich@...mai.com>
To: <davem@...emloft.net>
CC: <siva.kallam@...adcom.com>, <prashant@...adcom.com>,
<mchan@...adcom.com>, <shshaikh@...vell.com>,
<manishc@...vell.com>, <netdev@...r.kernel.org>,
Michael Zhivich <mzhivich@...mai.com>
Subject: [PATCH v2 1/3] ethtool: avoid signed-unsigned comparison in ethtool_validate_speed()
When building C++ userspace code that includes ethtool.h
with "-Werror -Wall", g++ complains about signed-unsigned comparison in
ethtool_validate_speed() due to definition of SPEED_UNKNOWN as -1.
Explicitly cast SPEED_UNKNOWN to __u32 to match type of
ethtool_validate_speed() argument.
Signed-off-by: Michael Zhivich <mzhivich@...mai.com>
---
include/uapi/linux/ethtool.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/uapi/linux/ethtool.h b/include/uapi/linux/ethtool.h
index 3652b239..d473e5e 100644
--- a/include/uapi/linux/ethtool.h
+++ b/include/uapi/linux/ethtool.h
@@ -1591,7 +1591,7 @@ enum ethtool_link_mode_bit_indices {
static inline int ethtool_validate_speed(__u32 speed)
{
- return speed <= INT_MAX || speed == SPEED_UNKNOWN;
+ return speed <= INT_MAX || speed == (__u32)SPEED_UNKNOWN;
}
/* Duplex, half or full. */
--
2.7.4
Powered by blists - more mailing lists