diff options
| author | Kevin Bowling <kbowling@FreeBSD.org> | 2026-08-11 19:40:56 +0000 |
|---|---|---|
| committer | Kevin Bowling <kbowling@FreeBSD.org> | 2026-08-11 20:59:33 +0000 |
| commit | f5fd839fe688181e57171850ce51e4dec71e62fd (patch) | |
| tree | e35f9b893a676210da27d1830679e19dfdd7d1ec | |
| parent | 13a7470096567480676e24545b3c1d6404f3f2ec (diff) | |
igc: Avoid a signed shift while assembling the PHY ID
The PHY identifier word is promoted to signed int when the cast is
applied after the shift. Cast the 16-bit register value first so
identifiers with their high bit set are assembled as unsigned data.
MFC after: 2 weeks
| -rw-r--r-- | sys/dev/igc/igc_phy.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/dev/igc/igc_phy.c b/sys/dev/igc/igc_phy.c index 24ecefb2c625..fffdfad3b237 100644 --- a/sys/dev/igc/igc_phy.c +++ b/sys/dev/igc/igc_phy.c @@ -143,7 +143,7 @@ s32 igc_get_phy_id(struct igc_hw *hw) if (ret_val) return ret_val; - phy->id = (u32)(phy_id << 16); + phy->id = (u32)phy_id << 16; usec_delay(200); ret_val = phy->ops.read_reg(hw, PHY_ID2, &phy_id); if (ret_val) |
