From 2f52fa2eb9c71e4feadcbfd53c94d3d2aa22a951 Mon Sep 17 00:00:00 2001 From: Renan DelValle Date: Sat, 4 Jan 2020 18:11:43 -0800 Subject: [PATCH] Renaming arguments to be more descriptive. --- rapl-daemon/util.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/rapl-daemon/util.go b/rapl-daemon/util.go index 0a031c0..5deee2c 100644 --- a/rapl-daemon/util.go +++ b/rapl-daemon/util.go @@ -62,8 +62,8 @@ func capNode(base string, percentage int) error { // maxPower returns the value in float of the maximum watts a power zone // can use. -func maxPower(zone string) (uint64, error) { - maxPower, err := ioutil.ReadFile(zone) +func maxPower(maxFile string) (uint64, error) { + maxPower, err := ioutil.ReadFile(maxFile) if err != nil { return 0.0, err } @@ -74,12 +74,11 @@ func maxPower(zone string) (uint64, error) { } return maxPoweruW, nil - } // capZone caps a power zone to a specific amount of watts specified by value -func capZone(zone string, value uint64) error { - err := ioutil.WriteFile(zone, []byte(strconv.FormatUint(value, 10)), 0644) +func capZone(limitFile string, value uint64) error { + err := ioutil.WriteFile(limitFile, []byte(strconv.FormatUint(value, 10)), 0644) if err != nil { return err }