Skip to content

Commit 89e4776

Browse files
committed
fix: remove unused variables and fix golangci-lint
Signed-off-by: leongross <[email protected]>
1 parent bb23ef8 commit 89e4776

File tree

3 files changed

+18
-32
lines changed

3 files changed

+18
-32
lines changed

cpuid.go

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// Copyright 2015 Intel Corporation.
2+
// Copyright 2025 the u-root Authors. All rights reserved.
23
// Use of this source code is governed by a BSD-style
34
// license that can be found in the LICENSE file.
45

@@ -296,16 +297,22 @@ var brandStrings = map[string]int{
296297
"XenVMMXenVMM": XEN,
297298
}
298299

299-
var maxInputValue uint32
300-
var maxExtendedInputValue uint32
301-
var extendedModelId uint32
302-
var extendedFamilyId uint32
303-
var brandIndex uint32
304-
var brandId int
305-
var featureFlags uint64
306-
var thermalAndPowerFeatureFlags uint32
307-
var extendedFeatureFlags uint64
308-
var extraFeatureFlags uint64
300+
// golanci-lint triggers false positives for ”unused” variables
301+
var (
302+
maxInputValue uint32
303+
maxExtendedInputValue uint32
304+
//nolint:unused
305+
extendedModelId uint32
306+
//nolint:unused
307+
extendedFamilyId uint32
308+
//nolint:unused
309+
brandIndex uint32
310+
brandId int
311+
featureFlags uint64
312+
thermalAndPowerFeatureFlags uint32
313+
extendedFeatureFlags uint64
314+
extraFeatureFlags uint64
315+
)
309316

310317
const (
311318
UKNOWN = iota

cpuid_amd64.go

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// Copyright 2015 Intel Corporation.
2+
// Copyright 2025 the u-root Authors. All rights reserved.
23
// Use of this source code is governed by a BSD-style
34
// license that can be found in the LICENSE file.
45

@@ -39,17 +40,6 @@ func detectFeatures() {
3940
}
4041
}
4142

42-
var leaf02Names = [...]string{
43-
"NULL",
44-
"DATA_CACHE",
45-
"INSTRUCTION_CACHE",
46-
"UNIFIED_CACHE",
47-
"TLB",
48-
"DTLB",
49-
"STLB",
50-
"PREFETCH",
51-
}
52-
5343
func leaf0() {
5444

5545
eax, ebx, ecx, edx := cpuid_low(0, 0)

cpuid_amd64_tinygo.go

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -69,17 +69,6 @@ func detectFeatures() {
6969
}
7070
}
7171

72-
var leaf02Names = [...]string{
73-
"NULL",
74-
"DATA_CACHE",
75-
"INSTRUCTION_CACHE",
76-
"UNIFIED_CACHE",
77-
"TLB",
78-
"DTLB",
79-
"STLB",
80-
"PREFETCH",
81-
}
82-
8372
func leaf0() {
8473

8574
eax, ebx, ecx, edx := cpuid_low(0, 0)

0 commit comments

Comments
 (0)