Skip to content

Commit d63da85

Browse files
michaelzhivichdavem330
authored andcommitted
qlogic: qlcnic: fix use of SPEED_UNKNOWN ethtool constant
qlcnic driver uses u16 to store SPEED_UKNOWN ethtool constant, which is defined as -1, resulting in value truncation and thus incorrect test results against SPEED_UNKNOWN. For example, the following test will print "False": u16 speed = SPEED_UNKNOWN; if (speed == SPEED_UNKNOWN) printf("True"); else printf("False"); Change storage of speed to use u32 to avoid this issue. Signed-off-by: Michael Zhivich <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent caf2c52 commit d63da85

File tree

1 file changed

+1
-1
lines changed
  • drivers/net/ethernet/qlogic/qlcnic

1 file changed

+1
-1
lines changed

drivers/net/ethernet/qlogic/qlcnic/qlcnic.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ struct qlcnic_hardware_context {
497497
u16 board_type;
498498
u16 supported_type;
499499

500-
u16 link_speed;
500+
u32 link_speed;
501501
u16 link_duplex;
502502
u16 link_autoneg;
503503
u16 module_type;

0 commit comments

Comments
 (0)