mirror of
https://github.com/torvalds/linux.git
synced 2024-11-18 18:11:56 +00:00
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>
This commit is contained in:
parent
3c5189ad70
commit
afe64245af
@ -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. */
|
||||
|
Loading…
Reference in New Issue
Block a user