arch-x86,cpu-kvm: Fix gem5.fast due to unused variable

Detected via this failing workload:
https://github.com/gem5/gem5/actions/runs/5861958237

It caused the following compilation error to be thrown:

```
src/arch/x86/kvm/x86_cpu.cc:1462:22: error: unused variable ‘rv’ [-Werror=unused-variable]
 1462 |                 bool rv = isa->cpuid->doCpuid(tc, function, idx, cpuid);
      |                      ^~
```

`rv` is unused in the .fast compilation as it's only used in the
`assert` statement immediately after.

 To fix this, the `[[maybe_unused]]` annotation is used

Change-Id: Ib98dd859c62f171c8eeefae93502f92a8f133776
This commit is contained in:
Bobby R. Bruce
2023-08-16 01:17:19 -05:00
parent f54777419d
commit c835c9faa3

View File

@@ -1459,7 +1459,8 @@ X86KvmCPU::updateCPUID()
m5_supported.push_back(makeKvmCpuid(function, idx, cpuid));
} else {
while (true) {
bool rv = isa->cpuid->doCpuid(tc, function, idx, cpuid);
[[maybe_unused]] bool rv = isa->cpuid->doCpuid(
tc, function, idx, cpuid);
assert(rv);
if (idx &&
@@ -1493,7 +1494,8 @@ X86KvmCPU::updateCPUID()
m5_supported.push_back(makeKvmCpuid(function, idx, cpuid));
} else {
while (true) {
bool rv = isa->cpuid->doCpuid(tc, function, idx, cpuid);
[[maybe_unused]] bool rv = isa->cpuid->doCpuid(
tc, function, idx, cpuid);
assert(rv);
if (idx &&