[coreboot-gerrit] New patch to review for coreboot: soc/marvell/mvmap2315: Mark mvmap2315_reset() as noreturn
Martin Roth (martinroth@google.com)
gerrit at coreboot.org
Wed Jan 11 18:58:03 CET 2017
Martin Roth (martinroth at google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/18103
-gerrit
commit 156bea8805146bc372a6201c76ddd2cdeb66bc3a
Author: Martin Roth <martinroth at google.com>
Date: Wed Jan 11 10:57:09 2017 -0700
soc/marvell/mvmap2315: Mark mvmap2315_reset() as noreturn
mvmap2315_reset() is called from locations where we're checking for NULL
pointers. Because coverity can't tell from the code that the functions
are not returning, it's showing errors of accessing pointers after
we've determined that they're invalid.
Mark it as noreturn, and add a loop in case the reset isn't on the
next instruction. This probably isn't needed, but shouldn't hurt.
Found-by: Coverity Scan #1362809
Change-Id: If93084629d5c2c8dc232558f2559b78b1ca5de7c
Signed-off-by: Martin Roth <martinroth at google.com>
---
src/soc/marvell/mvmap2315/reset.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/soc/marvell/mvmap2315/reset.c b/src/soc/marvell/mvmap2315/reset.c
index 531f4a0..40067ed 100644
--- a/src/soc/marvell/mvmap2315/reset.c
+++ b/src/soc/marvell/mvmap2315/reset.c
@@ -21,8 +21,9 @@
#include <soc/clock.h>
#include <soc/reset.h>
-void mvmap2315_reset(void)
+void __attribute__((noreturn)) mvmap2315_reset(void)
{
clrbits_le32(&mvmap2315_mpmu_clk->resetmcu, MVMAP2315_MCU_RST_EN);
clrbits_le32(&mvmap2315_mpmu_clk->resetap, MVMAP2315_AP_RST_EN);
+ for (;;) ;
}
More information about the coreboot-gerrit
mailing list