aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Zhivich <mzhivich@akamai.com>2019-04-08 10:48:45 -0400
committerDavid S. Miller <davem@davemloft.net>2019-04-08 16:30:43 -0700
commitafe64245af9f58267e7fa8fb76ad5650ee7ec25f (patch)
tree2163e312bce8d9f0288132da3c97ecf679fe6d24
parent3c5189ad70995200bb5c15b5fc9bc81a35febcf4 (diff)
download96b-common-afe64245af9f58267e7fa8fb76ad5650ee7ec25f.tar.gz
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@akamai.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--include/uapi/linux/ethtool.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/uapi/linux/ethtool.h b/include/uapi/linux/ethtool.h
index 3652b239dad1..d473e5ed044c 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. */