diff options
| author | Alistair Francis <alistair23@gmail.com> | 2024-01-08 10:13:26 +1000 |
|---|---|---|
| committer | Alistair Francis <alistair.francis@wdc.com> | 2024-01-10 18:47:47 +1000 |
| commit | 9a7c6da4cd8458c76f619d84542f91d308ecb15f (patch) | |
| tree | a2840e97ecb67e995cf2204e661cb629c0380fe1 /docs/sphinx-static | |
| parent | 1a25e59c621f77cf21ad7dd9a86606170ff6e4b6 (diff) | |
| download | focaccia-qemu-9a7c6da4cd8458c76f619d84542f91d308ecb15f.tar.gz focaccia-qemu-9a7c6da4cd8458c76f619d84542f91d308ecb15f.zip | |
target/riscv: Assert that the CSR numbers will be correct
The CSRs will always be between either CSR_MHPMCOUNTER3 and CSR_MHPMCOUNTER31 or CSR_MHPMCOUNTER3H and CSR_MHPMCOUNTER31H. So although ctr_index can't be negative, Coverity doesn't know this and it isn't obvious to human readers either. Let's add an assert to ensure that Coverity knows the values will be within range. To simplify the code let's also change the RV32 adjustment. Fixes: Coverity CID 1523910 Signed-off-by: Alistair Francis <alistair.francis@wdc.com> Reviewed-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com> Message-ID: <20240108001328.280222-2-alistair.francis@wdc.com> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Diffstat (limited to 'docs/sphinx-static')
0 files changed, 0 insertions, 0 deletions