1
0
mirror of https://github.com/google/cpu_features.git synced 2025-04-27 15:12:30 +02:00

[NFC] fix unused and shadowing variables

This commit is contained in:
Guillaume Chatelet 2019-11-13 11:15:40 +01:00
parent 3d07d083f2
commit be306b7b15

View File

@ -150,7 +150,6 @@ static CacheLevelInfo GetCacheLevelInfo(const uint32_t reg) {
const int UNDEF = -1;
const int KiB = 1024;
const int MiB = 1024 * KiB;
const int GiB = 1024 * MiB;
switch (reg) {
case 0x01:
return MakeX86CacheLevelInfo(UNDEF, CPU_FEATURE_CACHE_TLB, 4 * KiB, 4,
@ -490,10 +489,10 @@ static void ParseLeaf2(const int max_cpuid_leaf, CacheInfo* info) {
}
uint32_t bytes[4];
GetByteArrayFromRegister(bytes, registers[i]);
for (int i = 0; i < 4; ++i) {
if (bytes[i] == 0xFF)
for (int j = 0; j < 4; ++j) {
if (bytes[j] == 0xFF)
break; // leaf 4 should be used to fetch cache information
info->levels[info->size] = GetCacheLevelInfo(bytes[i]);
info->levels[info->size] = GetCacheLevelInfo(bytes[j]);
}
info->size++;
}