1
0
Fork 0

cosmetic, post: Codingstyle cleanup

Signed-off-by: Heiko Schocher <hs@denx.de>
utp
Heiko Schocher 2011-10-12 01:18:05 +00:00 committed by Albert ARIBAUD
parent ee4014b005
commit e92372c8a7
1 changed files with 59 additions and 68 deletions

View File

@ -55,9 +55,7 @@ int post_init_f (void)
gd->post_init_f_time = post_time_ms(0);
if (!gd->post_init_f_time)
{
printf("post/post.c: post_time_ms seems not to be implemented\n");
}
printf("%s: post_time_ms not implemented\n", __FILE__);
return res;
}
@ -100,22 +98,19 @@ void post_bootmode_init (void)
int bootmode = post_bootmode_get(0);
int newword;
if (post_hotkeys_pressed() && !(bootmode & POST_POWERTEST)) {
if (post_hotkeys_pressed() && !(bootmode & POST_POWERTEST))
newword = BOOTMODE_MAGIC | POST_SLOWTEST;
} else if (bootmode == 0) {
else if (bootmode == 0)
newword = BOOTMODE_MAGIC | POST_POWERON;
} else if (bootmode == POST_POWERON || bootmode == POST_SLOWTEST) {
else if (bootmode == POST_POWERON || bootmode == POST_SLOWTEST)
newword = BOOTMODE_MAGIC | POST_NORMAL;
} else {
else
/* Use old value */
newword = post_word_load () & ~POST_COLDBOOT;
}
if (bootmode == 0)
{
/* We are booting after power-on */
newword |= POST_COLDBOOT;
}
post_word_store(newword);
@ -129,15 +124,13 @@ int post_bootmode_get (unsigned int *last_test)
unsigned long word = post_word_load();
int bootmode;
if ((word & 0xFFFF0000) != BOOTMODE_MAGIC) {
if ((word & 0xFFFF0000) != BOOTMODE_MAGIC)
return 0;
}
bootmode = word & 0x7F;
if (last_test && (bootmode & POST_POWERTEST)) {
if (last_test && (bootmode & POST_POWERTEST))
*last_test = (word >> 8) & 0xFF;
}
return bootmode;
}
@ -235,9 +228,8 @@ static void post_get_env_flags(int *test_flags)
}
}
if (j == post_list_size) {
if (j == post_list_size)
printf ("No such test: %s\n", name);
}
name = s + 1;
}
@ -256,12 +248,10 @@ static void post_get_flags(int *test_flags)
post_get_env_flags(test_flags);
#endif
for (j = 0; j < post_list_size; j++) {
if (test_flags[j] & POST_POWERON) {
for (j = 0; j < post_list_size; j++)
if (test_flags[j] & POST_POWERON)
test_flags[j] |= POST_SLOWTEST;
}
}
}
void __show_post_progress(unsigned int test_num, int before, int result)
{
@ -277,7 +267,8 @@ static int post_run_single (struct post_test *test,
WATCHDOG_RESET ();
if (!(flags & POST_REBOOT)) {
if ((test_flags & POST_REBOOT) && !(flags & POST_MANUAL)) {
if ((test_flags & POST_REBOOT) &&
!(flags & POST_MANUAL)) {
post_bootmode_test_on(
(gd->flags & GD_FLG_POSTFAIL) ?
POST_FAIL_SAVE | i : i);
@ -410,9 +401,8 @@ int post_info (char *name)
unsigned int i;
if (name == NULL) {
for (i = 0; i < post_list_size; i++) {
for (i = 0; i < post_list_size; i++)
post_info_single(post_list + i, 0);
}
return 0;
} else {
@ -511,7 +501,8 @@ void post_reloc (void)
unsigned long post_time_ms(unsigned long base)
{
#ifdef CONFIG_PPC
return (unsigned long)(get_ticks () / (get_tbclk () / CONFIG_SYS_HZ)) - base;
return (unsigned long)(get_ticks() / (get_tbclk() / CONFIG_SYS_HZ))
- base;
#else
#warning "Not implemented yet"
return 0; /* Not implemented yet */