Dont show boot delay info if boot delay is 0s
authorPiotr Dymacz <pepe2k@gmail.com>
Sun, 9 Feb 2014 23:25:42 +0000 (00:25 +0100)
committerPiotr Dymacz <pepe2k@gmail.com>
Sun, 9 Feb 2014 23:25:42 +0000 (00:25 +0100)
u-boot/common/main.c

index 47de5a90345a8890dc01ec4056de5dae9c60ccae..0ae2c4d30d7d334dd27a3f39d63d1225aa9e9bce 100755 (executable)
@@ -64,38 +64,40 @@ static __inline__ int abortboot(int bootdelay){
        }
 #endif
 
+       if(bootdelay > 0){
 #ifdef CONFIG_MENUPROMPT
-       printf(CONFIG_MENUPROMPT, bootdelay);
+               printf(CONFIG_MENUPROMPT, bootdelay);
 #else
-       printf("Hit any key to stop autoboot: %d ", bootdelay);
+               printf("Hit any key to stop autoboot: %d ", bootdelay);
 #endif
 
-       while((bootdelay > 0) && (!abort)){
-               int i;
+               while((bootdelay > 0) && (!abort)){
+                       int i;
 
-               --bootdelay;
+                       --bootdelay;
 
-               /* delay 100 * 10ms */
-               for(i = 0; !abort && i < 100; ++i){
+                       /* delay 100 * 10ms */
+                       for(i = 0; !abort && i < 100; ++i){
 
-                       /* we got a key press   */
-                       if(tstc()){
-                               /* don't auto boot      */
-                               abort = 1;
-                               /* no more delay        */
-                               bootdelay = 0;
-                               /* consume input        */
-                               (void) getc();
-                               break;
+                               /* we got a key press   */
+                               if(tstc()){
+                                       /* don't auto boot      */
+                                       abort = 1;
+                                       /* no more delay        */
+                                       bootdelay = 0;
+                                       /* consume input        */
+                                       (void) getc();
+                                       break;
+                               }
+                               udelay(10000);
                        }
-                       udelay(10000);
+
+                       printf("\b\b%d ", bootdelay);
                }
 
-               printf("\b\b%d ", bootdelay);
+               printf("\n\n");
        }
 
-       printf("\n\n");
-
 #ifdef CONFIG_SILENT_CONSOLE
        if(abort){
                /* permanently enable normal console output */