Skip to content

Commit b9e42b8

Browse files
committed
chore(sensor): fix lint
Signed-off-by: Huamin Chen <[email protected]>
1 parent b270d64 commit b9e42b8

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

pkg/sensors/accelerator/devices/grace_acpi.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ func (g *gpuGraceACPI) findModulePowerPaths() error {
9797
continue
9898
}
9999

100-
socketNum := -1
100+
var socketNum int
101101
if strings.HasSuffix(label, "Socket 0") {
102102
socketNum = 0
103103
} else if strings.HasSuffix(label, "Socket 1") {

pkg/sensors/components/source/grace_acpi.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,6 @@ const (
3636
graceOemInfoFile = "_oem_info"
3737
graceAverageFile = "_average"
3838

39-
// Grace power component identifiers from hwmon
40-
gracePowerLabel = "Grace Power Socket" // Total socket power including DRAM
41-
graceCPULabel = "CPU Power Socket" // CPU rail power
42-
graceSysIOLabel = "SysIO Power Socket" // SOC rail power
43-
4439
// Conversion factors
4540
microWattToMilliJoule = 1000 // Convert microwatts to mJ assuming 1 second sampling
4641
)
@@ -82,7 +77,7 @@ func (g *GraceACPI) findPowerPathsByLabel() error {
8277

8378
// Extract socket number and power type
8479
// Per docs, Grace has 2 sockets, Grace Hopper has 1 CPU and 1 GPU socket
85-
socketNum := -1
80+
var socketNum int
8681
if strings.HasSuffix(label, "Socket 0") {
8782
socketNum = 0
8883
} else if strings.HasSuffix(label, "Socket 1") {

0 commit comments

Comments
 (0)