From 3b3b88a746907c75b74aaec445b368ccd2b7d8f9 Mon Sep 17 00:00:00 2001 From: adrianc Date: Thu, 22 Aug 2024 09:01:15 +0300 Subject: [PATCH] Fix: build on 32bit system build with GOARCH=386 fails with error: $ GOARCH=386 go build ./... ./sriovnet_aux.go:137:17: u32Mask (untyped int constant 4294967295) overflows int fix this by modifying u32Mask to be uint32 and proper casting. Signed-off-by: adrianc --- sriovnet_aux.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sriovnet_aux.go b/sriovnet_aux.go index 4614e12..6d2c7e8 100644 --- a/sriovnet_aux.go +++ b/sriovnet_aux.go @@ -26,7 +26,7 @@ import ( ) const ( - u32Mask = 0xffffffff + u32Mask uint32 = 0xffffffff ) // GetNetDeviceFromAux gets auxiliary device name (e.g 'mlx5_core.sf.2') and @@ -134,7 +134,7 @@ func GetAuxSFDevByPciAndSFIndex(pciAddress string, sfIndex uint32) (string, erro continue } - if uint32(idx&u32Mask) == sfIndex { + if uint32(idx)&u32Mask == sfIndex { return dev, nil } }