diff --git a/oem/smc/drive.go b/oem/smc/drive.go index 9013910b..dd2f20fc 100644 --- a/oem/smc/drive.go +++ b/oem/smc/drive.go @@ -1,3 +1,7 @@ +// +// SPDX-License-Identifier: BSD-3-Clause +// + package smc import ( @@ -61,7 +65,7 @@ func FromDrive(drive *redfish.Drive) (Drive, error) { // in the Oem sections - certain models and bmc firmwares will mix // these up, so we check both smcDrive.indicateTarget = t.Actions.Oem.DriveIndicate.Target - if len(t.Actions.Oem.SmcDriveIndicate.Target) > 0 { + if t.Actions.Oem.SmcDriveIndicate.Target != "" { smcDrive.indicateTarget = t.Actions.Oem.SmcDriveIndicate.Target } @@ -69,7 +73,7 @@ func FromDrive(drive *redfish.Drive) (Drive, error) { } // Indicate will set the indicator light activity, true for on, false for off -func (d Drive) Indicate(active bool) error { +func (d *Drive) Indicate(active bool) error { // Return a common error to let the user try falling back on the normal gofish path if d.indicateTarget == "" { return ErrActionNotSupported diff --git a/oem/smc/drive_test.go b/oem/smc/drive_test.go index 0a6fb010..f61a4793 100644 --- a/oem/smc/drive_test.go +++ b/oem/smc/drive_test.go @@ -1,3 +1,7 @@ +// +// SPDX-License-Identifier: BSD-3-Clause +// + package smc import ( @@ -58,7 +62,7 @@ func TestSmcDriveOem(t *testing.T) { } if smcDrive.Temperature != 33 { - t.Errorf("unexpected oem drive temerature: %d", smcDrive.Temperature) + t.Errorf("unexpected oem drive temperature: %d", smcDrive.Temperature) } if smcDrive.indicateTarget != "/redfish/v1/Chassis/NVMeSSD.0.Group.0.StorageBackplane/Drives/Disk.Bay.22/Actions/Oem/Drive.Indicate" {