diff mbox series

[RFC] target/arm: Suppress Coverity warning for PRF

Message ID 20180705180403.11928-1-richard.henderson@linaro.org
State Superseded
Headers show
Series [RFC] target/arm: Suppress Coverity warning for PRF | expand

Commit Message

Richard Henderson July 5, 2018, 6:04 p.m. UTC
These instructions must perform the sve_access_check, but
since they are implemented as NOPs there is no generated
code to elide when the access check fails.

Fixes: Coverity issues 1393780 & 1393779.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

---

Does anyone know if this actually works for Coverity?
I'd hate to churn the code without knowing.

---
 target/arm/translate-sve.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

-- 
2.17.1

Comments

Peter Maydell July 6, 2018, 10:43 a.m. UTC | #1
On 5 July 2018 at 19:07, Peter Maydell <peter.maydell@linaro.org> wrote:
> On 5 July 2018 at 19:04, Richard Henderson <richard.henderson@linaro.org> wrote:

>> These instructions must perform the sve_access_check, but

>> since they are implemented as NOPs there is no generated

>> code to elide when the access check fails.

>>

>> Fixes: Coverity issues 1393780 & 1393779.

>> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

>> ---

>>

>> Does anyone know if this actually works for Coverity?

>> I'd hate to churn the code without knowing.

>

> Googling suggests that cast-to-void works. I tend to just mark

> them as false-positive in the Coverity GUI, though...


In this case, since you've written the patch we may as well
use it -- it works for human readers too.

Applied to target-arm.next, thanks.

-- PMM
diff mbox series

Patch

diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c
index c080345b9c..d41f1155f9 100644
--- a/target/arm/translate-sve.c
+++ b/target/arm/translate-sve.c
@@ -5164,7 +5164,7 @@  static bool trans_ST1_zpiz(DisasContext *s, arg_ST1_zpiz *a, uint32_t insn)
 static bool trans_PRF(DisasContext *s, arg_PRF *a, uint32_t insn)
 {
     /* Prefetch is a nop within QEMU.  */
-    sve_access_check(s);
+    (void)sve_access_check(s);
     return true;
 }
 
@@ -5174,7 +5174,7 @@  static bool trans_PRF_rr(DisasContext *s, arg_PRF_rr *a, uint32_t insn)
         return false;
     }
     /* Prefetch is a nop within QEMU.  */
-    sve_access_check(s);
+    (void)sve_access_check(s);
     return true;
 }