diff mbox

[U-Boot,8/9] ARM: MXS: fix Uninitialized variable error

Message ID 1415278985-8482-9-git-send-email-wd@denx.de
State Accepted
Delegated to: Tom Rini
Headers show

Commit Message

Wolfgang Denk Nov. 6, 2014, 1:03 p.m. UTC
cppcheck reports:

[arch/arm/cpu/arm926ejs/mxs/timer.c:96]: (error) Uninitialized
variable: now

Signed-off-by: Wolfgang Denk <wd@denx.de>
Cc: Marek Vasut <marex@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
---
 arch/arm/cpu/arm926ejs/mxs/timer.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Tom Rini Nov. 10, 2014, 9:28 p.m. UTC | #1
On Thu, Nov 06, 2014 at 02:03:04PM +0100, Wolfgang Denk wrote:

> cppcheck reports:
> 
> [arch/arm/cpu/arm926ejs/mxs/timer.c:96]: (error) Uninitialized
> variable: now
> 
> Signed-off-by: Wolfgang Denk <wd@denx.de>
> Cc: Marek Vasut <marex@denx.de>
> Cc: Stefano Babic <sbabic@denx.de>

Applied to u-boot/master, thanks!
diff mbox

Patch

diff --git a/arch/arm/cpu/arm926ejs/mxs/timer.c b/arch/arm/cpu/arm926ejs/mxs/timer.c
index 99d3fb8..f2e7225 100644
--- a/arch/arm/cpu/arm926ejs/mxs/timer.c
+++ b/arch/arm/cpu/arm926ejs/mxs/timer.c
@@ -91,6 +91,8 @@  unsigned long long get_ticks(void)
 		TIMROT_RUNNING_COUNTn_RUNNING_COUNT_OFFSET;
 #elif defined(CONFIG_MX28)
 	now = readl(&timrot_regs->hw_timrot_running_count0);
+#else
+#error "Don't know how to read timrot_regs"
 #endif
 
 	if (lastdec >= now) {