[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RISC-V] Coverity 1390849, Logically dead code
From: |
Michael Clark |
Subject: |
Re: [Qemu-devel] [RISC-V] Coverity 1390849, Logically dead code |
Date: |
Fri, 25 May 2018 18:18:03 +1200 |
On Fri, May 25, 2018 at 9:54 AM, Richard Henderson <address@hidden> wrote:
> In the latest Coverity scan, it reports
>
> 405 if (csrno >= CSR_MHPMCOUNTER3 && csrno <= CSR_MHPMCOUNTER31) {
> 406 return 0;
> 407 }
> 408#if defined(TARGET_RISCV32)
> 409 if (csrno >= CSR_MHPMCOUNTER3 && csrno <= CSR_MHPMCOUNTER31) {
>
> CID 1390849 (#1 of 1): Logically dead code (DEADCODE)
> dead_error_line: Execution cannot reach this statement: return 0U;.
>
> 410 return 0;
> 411 }
> 412#endif
>
>
> I believe the condition at op_helper.c:409 should be testing
> CSR_MHPMCOUNTER3H
> and CSR_MHPMCOUNTER31H. Must run now, otherwise I'd also send the trivial
> patch.
Thanks! Yes indeed they should be the H versions.
I will send the trivial patch...