Skip to content

Commit e64285f

Browse files
dmantipovkuba-moo
authored andcommitted
rocker: fix link status detection in rocker_carrier_init()
Since '1 << rocker_port->pport' may be undefined for port >= 32, cast the left operand to 'unsigned long long' like it's done in 'rocker_port_set_enable()' above. Compile tested only. Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Dmitry Antipov <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent a0c80d5 commit e64285f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/ethernet/rocker/rocker_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2502,7 +2502,7 @@ static void rocker_carrier_init(const struct rocker_port *rocker_port)
25022502
u64 link_status = rocker_read64(rocker, PORT_PHYS_LINK_STATUS);
25032503
bool link_up;
25042504

2505-
link_up = link_status & (1 << rocker_port->pport);
2505+
link_up = link_status & (1ULL << rocker_port->pport);
25062506
if (link_up)
25072507
netif_carrier_on(rocker_port->dev);
25082508
else

0 commit comments

Comments
 (0)