mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-07-23 19:16:25 +00:00
fix lint: apply De Morgan's laws to simplify conditionals
Signed-off-by: Shingo Omura <everpeace@gmail.com>
This commit is contained in:
@@ -113,7 +113,7 @@ func (p *PCIAddress) resolveSysDevicesPath(sysfs Sysfs) (string, error) {
|
||||
|
||||
// targetAbs must be /sys/devices/pci0000:01/...<intermediate PCI devices>.../0000:00:1f.0
|
||||
devicePathPrefix := sysfs.Devices("pci")
|
||||
if !strings.HasPrefix(targetAbs, devicePathPrefix) || !(filepath.Base(targetAbs) == p.String()) {
|
||||
if !strings.HasPrefix(targetAbs, devicePathPrefix) || filepath.Base(targetAbs) != p.String() {
|
||||
return "", fmt.Errorf("invalid symlink target for PCI device %s: %s", sysBusPath, targetAbs)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user