Re: [U-Boot] [PATCH] cosmetic, post: Codingstyle cleanup

2011-10-23 Thread Heiko Schocher
Hello Wolfgang,

Wolfgang Denk schrieb:
 Dear Heiko Schocher,
 
 In message 1316064766-5385-1-git-send-email...@denx.de you wrote:
 +else
  /* Use old value */
  newword = post_word_load ()  ~POST_COLDBOOT;
 -}
 ...
  if (bootmode == 0)
 -{
  /* We are booting after power-on */
  newword |= POST_COLDBOOT;
 -}
 
 In U-Boot we rewuire braces around multiline comments (even though
 checkpatch does not complain about this).
 
 Please fix and resubmit.

This is already fixed here:
http://patchwork.ozlabs.org/patch/119184/

and found this patch already applied to u-boot-arm, here:
http://git.denx.de/?p=u-boot/u-boot-arm.git;a=commit;h=095bd94ad54bb407459862129ad8cd23367b2a03

bye,
Heiko
-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] cosmetic, post: Codingstyle cleanup

2011-10-21 Thread Wolfgang Denk
Dear Heiko Schocher,

In message 1316064766-5385-1-git-send-email...@denx.de you wrote:

 + else
   /* Use old value */
   newword = post_word_load ()  ~POST_COLDBOOT;
 - }
...
   if (bootmode == 0)
 - {
   /* We are booting after power-on */
   newword |= POST_COLDBOOT;
 - }

In U-Boot we rewuire braces around multiline comments (even though
checkpatch does not complain about this).

Please fix and resubmit.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
Intel told us the Pentium would have RISK features...
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] cosmetic, post: Codingstyle cleanup

2011-09-14 Thread Heiko Schocher
Signed-off-by: Heiko Schocher h...@denx.de
---
 post/post.c |  138 +++---
 1 files changed, 64 insertions(+), 74 deletions(-)

diff --git a/post/post.c b/post/post.c
index 852d6a5..6c59f91 100644
--- a/post/post.c
+++ b/post/post.c
@@ -40,7 +40,7 @@ DECLARE_GLOBAL_DATA_PTR;
 
 #define BOOTMODE_MAGIC 0xDEAD
 
-int post_init_f (void)
+int post_init_f(void)
 {
int res = 0;
unsigned int i;
@@ -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;
 }
@@ -95,102 +93,97 @@ int post_hotkeys_pressed(void)
__attribute__((weak, alias(__post_hotkeys_pressed)));
 
 
-void post_bootmode_init (void)
+void post_bootmode_init(void)
 {
-   int bootmode = post_bootmode_get (0);
+   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);
+   post_word_store(newword);
 
/* Reset activity record */
gd-post_log_word = 0;
 }
 
-int post_bootmode_get (unsigned int *last_test)
+int post_bootmode_get(unsigned int *last_test)
 {
-   unsigned long word = post_word_load ();
+   unsigned long word = post_word_load();
int bootmode;
 
-   if ((word  0x) != BOOTMODE_MAGIC) {
+   if ((word  0x) != 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;
 }
 
 /* POST tests run before relocation only mark status bits  */
-static void post_log_mark_start ( unsigned long testid )
+static void post_log_mark_start(unsigned long testid)
 {
-   gd-post_log_word |= (testid)16;
+   gd-post_log_word |= (testid)  16;
 }
 
-static void post_log_mark_succ ( unsigned long testid )
+static void post_log_mark_succ(unsigned long testid)
 {
gd-post_log_word |= testid;
 }
 
 /* ... and the messages are output once we are relocated */
-void post_output_backlog ( void )
+void post_output_backlog(void)
 {
int j;
 
for (j = 0; j  post_list_size; j++) {
if (gd-post_log_word  (post_list[j].testid16)) {
-   post_log (POST %s , post_list[j].cmd);
+   post_log(POST %s , post_list[j].cmd);
if (gd-post_log_word  post_list[j].testid)
-   post_log (PASSED\n);
+   post_log(PASSED\n);
else {
-   post_log (FAILED\n);
-   show_boot_progress (-31);
+   post_log(FAILED\n);
+   show_boot_progress(-31);
}
}
}
 }
 
-static void post_bootmode_test_on (unsigned int last_test)
+static void post_bootmode_test_on(unsigned int last_test)
 {
-   unsigned long word = post_word_load ();
+   unsigned long word = post_word_load();
 
word |= POST_POWERTEST;
 
word |= (last_test  0xFF)  8;
 
-   post_word_store (word);
+   post_word_store(word);
 }
 
-static void post_bootmode_test_off (void)
+static void post_bootmode_test_off(void)
 {
-   unsigned long word = post_word_load ();
+   unsigned long word = post_word_load();
 
word = ~POST_POWERTEST;
 
-   post_word_store (word);
+   post_word_store(word);
 }
 
-static void post_get_flags (int *test_flags)
+static void post_get_flags(int *test_flags)
 {
int  flag[] = {  POST_POWERON,   POST_NORMAL,   POST_SLOWTEST,
 POST_CRITICAL };
@@ -203,9 +196,8 @@ static void post_get_flags (int *test_flags)
int last;
int i, j;
 
-   for (j = 0; j  post_list_size; j++) {
+   for (j = 0; j  post_list_size; j++)
test_flags[j] = post_list[j].flags;