mirror of
https://github.com/kubernetes-sigs/node-feature-discovery.git
synced 2024-12-14 11:57:51 +00:00
cpu: ignore unknown cpuid flags on non-x86
Avoid trying to create empty "cpu-cpuid." labels for cpuid flags that we
don't have a description for.
(cherry picked from commit 98fd07b117
)
This commit is contained in:
parent
5741fc92e3
commit
1a3bf8423b
4 changed files with 10 additions and 10 deletions
|
@ -95,8 +95,8 @@ func getCpuidFlags() []string {
|
|||
hwcap := uint64(C.gethwcap())
|
||||
for i := uint(0); i < 64; i++ {
|
||||
key := uint64(1 << i)
|
||||
val := flagNames_arm[key]
|
||||
if hwcap&key != 0 {
|
||||
val, ok := flagNames_arm[key]
|
||||
if hwcap&key != 0 && ok {
|
||||
r = append(r, val)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -85,8 +85,8 @@ func getCpuidFlags() []string {
|
|||
hwcap := uint64(C.gethwcap())
|
||||
for i := uint(0); i < 64; i++ {
|
||||
key := uint64(1 << i)
|
||||
val := flagNames_arm64[key]
|
||||
if hwcap&key != 0 {
|
||||
val, ok := flagNames_arm64[key]
|
||||
if hwcap&key != 0 && ok {
|
||||
r = append(r, val)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -132,15 +132,15 @@ func getCpuidFlags() []string {
|
|||
hwcap2 := uint64(C.gethwcap2())
|
||||
for i := uint(0); i < 64; i++ {
|
||||
key := uint64(1 << i)
|
||||
val := flagNames_ppc64le[key]
|
||||
if hwcap&key != 0 {
|
||||
val, ok := flagNames_ppc64le[key]
|
||||
if hwcap&key != 0 && ok {
|
||||
r = append(r, val)
|
||||
}
|
||||
}
|
||||
for i := uint(0); i < 64; i++ {
|
||||
key := uint64(1 << i)
|
||||
val := flag2Names_ppc64le[key]
|
||||
if hwcap2&key != 0 {
|
||||
val, ok := flag2Names_ppc64le[key]
|
||||
if hwcap2&key != 0 && ok {
|
||||
r = append(r, val)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -84,8 +84,8 @@ func getCpuidFlags() []string {
|
|||
hwcap := uint64(C.gethwcap())
|
||||
for i := uint(0); i < 64; i++ {
|
||||
key := uint64(1 << i)
|
||||
val := flagNames_s390x[key]
|
||||
if hwcap&key != 0 {
|
||||
val, ok := flagNames_s390x[key]
|
||||
if hwcap&key != 0 && ok {
|
||||
r = append(r, val)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue