UPSTREAM: 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.

BUG=none
BRANCH=none
TEST=none

Change-Id: Icabde50124ed8206a0a114cd10002ef81a770f57
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Commit-Id: 3051cd9265
Original-Found-by: Coverity Scan #1362809
Original-Change-Id: If93084629d5c2c8dc232558f2559b78b1ca5de7c
Original-Signed-off-by: Martin Roth <martinroth@google.com>
Original-Reviewed-on: https://review.coreboot.org/18103
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Original-Reviewed-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://chromium-review.googlesource.com/428257
Commit-Ready: Aaron Durbin <adurbin@chromium.org>
This commit is contained in:
Martin Roth 2017-01-11 10:57:09 -07:00 committed by chrome-bot
parent 17b61437bb
commit b268d78f2a

View file

@ -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 (;;) ;
}