Skip to content

Commit cc86d3a

Browse files
committed
[no-relnote] Adjust for new busid type
The go-nvml v0.13.x update changed the type for the PCI bus ID from [32]int8 to [32]uint8. This requires a minor change in the to-string representation. Signed-off-by: Evan Lezar <[email protected]>
1 parent 43b3086 commit cc86d3a

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

internal/rm/helper.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@
1616

1717
package rm
1818

19-
// int8Slice wraps an []int8 with more functions.
20-
type int8Slice []int8
19+
// uint8Slice wraps an []uint8 with more functions.
20+
type uint8Slice []uint8
2121

22-
// String turns a nil terminated int8Slice into a string
23-
func (s int8Slice) String() string {
22+
// String turns a nil terminated uint8Slice into a string
23+
func (s uint8Slice) String() string {
2424
var b []byte
2525
for _, c := range s {
2626
if c == 0 {
2727
break
2828
}
29-
b = append(b, byte(c))
29+
b = append(b, c)
3030
}
3131
return string(b)
3232
}

internal/rm/nvml_devices.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ func (d nvmlDevice) GetNumaNode() (bool, int, error) {
155155
}
156156

157157
// Discard leading zeros.
158-
busID := strings.ToLower(strings.TrimPrefix(int8Slice(info.BusId[:]).String(), "0000"))
158+
busID := strings.ToLower(strings.TrimPrefix(uint8Slice(info.BusId[:]).String(), "0000"))
159159

160160
b, err := os.ReadFile(fmt.Sprintf("/sys/bus/pci/devices/%s/numa_node", busID))
161161
if err != nil {

0 commit comments

Comments
 (0)