From 243af848bce47bb1436b0224f2bd8c4e9c808a22 Mon Sep 17 00:00:00 2001 From: Martin Roth Date: Thu, 26 Jan 2017 15:37:10 -0700 Subject: [PATCH] UPSTREAM: riscv: Suppress invalid coverity errors Coverity is detecting 'sp' as a variable which has not been initialized. This is obviously not correct, so this patch *TRIES* to mark it as false I'm not positive that this will work because the annotation needs to go on the line above the error, but this error is inside of a # define. Does the whole #define count as one line? Can it go on the line above the #define in the .h file? Does it have to precede every line where the #define is used? The documentation doesn't make this clear. Should suppress coverity issues: 1368525 & 1368527 uninit_use: Using uninitialized value sp. BUG=none BRANCH=none TEST=none Change-Id: I8fa056af3e829218d8139f3899b7291e62ea6796 Signed-off-by: Patrick Georgi Original-Commit-Id: f797a1ac6a72a571ba76bff8b7c451cc090778a9 Original-Change-Id: Ibae5e206c4ff47991ea8a11b6b59972b24b71796 Original-Signed-off-by: Martin Roth Original-Reviewed-on: https://review.coreboot.org/18247 Original-Tested-by: build bot (Jenkins) Original-Reviewed-by: Jonathan Neuschfer Reviewed-on: https://chromium-review.googlesource.com/445149 --- src/arch/riscv/include/mcall.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/arch/riscv/include/mcall.h b/src/arch/riscv/include/mcall.h index 1e74ed345d..cdd9bd38eb 100644 --- a/src/arch/riscv/include/mcall.h +++ b/src/arch/riscv/include/mcall.h @@ -70,6 +70,7 @@ typedef struct { } hls_t; #define MACHINE_STACK_TOP() ({ \ + /* coverity[uninit_use] : FALSE */ \ register uintptr_t sp asm ("sp"); \ (void*)((sp + RISCV_PGSIZE) & -RISCV_PGSIZE); })