Skip to content

Commit

Permalink
lib: [cpuid] eliminate duplicate condition check
Browse files Browse the repository at this point in the history
  • Loading branch information
tkanteck authored and mdcornu committed Oct 11, 2023
1 parent 2e0698f commit da23616
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/x86_64/cpu_feature.c
Original file line number Diff line number Diff line change
Expand Up @@ -221,11 +221,10 @@ cpu_feature_detect(void)
if (hi_leaf_number >= 1)
mbcpuid(0x1, 0x0, &cpuid_1_0);

if (hi_leaf_number >= 7)
if (hi_leaf_number >= 7) {
mbcpuid(0x7, 0x0, &cpuid_7_0);

if (hi_leaf_number >= 7)
mbcpuid(0x7, 0x1, &cpuid_7_1);
}

for (i = 0; i < IMB_DIM(feat_tab); i++) {
if (hi_leaf_number < feat_tab[i].req_leaf_number)
Expand Down

0 comments on commit da23616

Please sign in to comment.