Skip to content

Commit

Permalink
chore(sensor): fix lint
Browse files Browse the repository at this point in the history
Signed-off-by: Huamin Chen <[email protected]>
  • Loading branch information
rootfs committed Dec 11, 2024
1 parent b270d64 commit b9e42b8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pkg/sensors/accelerator/devices/grace_acpi.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func (g *gpuGraceACPI) findModulePowerPaths() error {
continue
}

socketNum := -1
var socketNum int
if strings.HasSuffix(label, "Socket 0") {
socketNum = 0
} else if strings.HasSuffix(label, "Socket 1") {
Expand Down
7 changes: 1 addition & 6 deletions pkg/sensors/components/source/grace_acpi.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,6 @@ const (
graceOemInfoFile = "_oem_info"
graceAverageFile = "_average"

// Grace power component identifiers from hwmon
gracePowerLabel = "Grace Power Socket" // Total socket power including DRAM
graceCPULabel = "CPU Power Socket" // CPU rail power
graceSysIOLabel = "SysIO Power Socket" // SOC rail power

// Conversion factors
microWattToMilliJoule = 1000 // Convert microwatts to mJ assuming 1 second sampling
)
Expand Down Expand Up @@ -82,7 +77,7 @@ func (g *GraceACPI) findPowerPathsByLabel() error {

// Extract socket number and power type
// Per docs, Grace has 2 sockets, Grace Hopper has 1 CPU and 1 GPU socket
socketNum := -1
var socketNum int
if strings.HasSuffix(label, "Socket 0") {
socketNum = 0
} else if strings.HasSuffix(label, "Socket 1") {
Expand Down

0 comments on commit b9e42b8

Please sign in to comment.