Message ID | 20220809090859.28338-2-jasowang@redhat.com |
---|---|
State | Accepted |
Commit | 7cf745dd9c25f0740dc1009598b58dd8dd989876 |
Headers | show |
Series | [PULL] hw/net/rocker: Avoid undefined shifts with more than 31 ports | expand |
diff --git a/hw/net/rocker/rocker.c b/hw/net/rocker/rocker.c index 31f2340..d8f3f16 100644 --- a/hw/net/rocker/rocker.c +++ b/hw/net/rocker/rocker.c @@ -1010,7 +1010,7 @@ static uint64_t rocker_port_phys_link_status(Rocker *r) FpPort *port = r->fp_port[i]; if (fp_port_get_link_up(port)) { - status |= 1 << (i + 1); + status |= 1ULL << (i + 1); } } return status; @@ -1025,7 +1025,7 @@ static uint64_t rocker_port_phys_enable_read(Rocker *r) FpPort *port = r->fp_port[i]; if (fp_port_enabled(port)) { - ret |= 1 << (i + 1); + ret |= 1ULL << (i + 1); } } return ret;