From: Zhi-zhou Zhang Date: Sat, 24 Nov 2012 23:07:13 +0800 Subject: [U-Boot] [Patch 2/2] MIPS: do not modify variable before relocate_code In-Reply-To: <1353769633-31374-1-git-send-email-zhizhou.zh@gmail.com> References: <1353769633-31374-1-git-send-email-zhizhou.zh@gmail.com> Message-ID: <1353769633-31374-4-git-send-email-zhizhou.zh@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Because timestamp is declared as `static', we needn't initialize it by writing it a zero. If we do it before relocate_code, we will write into a flash address(0xffffffffbfc0xxxx). Signed-off-by: Zhi-zhou Zhang --- arch/mips/cpu/mips32/time.c | 1 - arch/mips/cpu/mips64/time.c | 1 - 2 files changed, 2 deletions(-) diff --git a/arch/mips/cpu/mips32/time.c b/arch/mips/cpu/mips32/time.c index 350896a..09fc842 100644 --- a/arch/mips/cpu/mips32/time.c +++ b/arch/mips/cpu/mips32/time.c @@ -36,7 +36,6 @@ static unsigned long timestamp; int timer_init(void) { /* Set up the timer for the first expiration. */ - timestamp = 0; write_c0_compare(read_c0_count() + CYCLES_PER_JIFFY); return 0; diff --git a/arch/mips/cpu/mips64/time.c b/arch/mips/cpu/mips64/time.c index 5154280..720f7b7 100644 --- a/arch/mips/cpu/mips64/time.c +++ b/arch/mips/cpu/mips64/time.c @@ -37,7 +37,6 @@ static unsigned long timestamp; int timer_init(void) { /* Set up the timer for the first expiration. */ - timestamp = 0; write_c0_compare(read_c0_count() + CYCLES_PER_JIFFY); return 0; -- 1.7.9.5