[cmdline] Minor tidy-ups to shell_banner.c
authorMichael Brown <mcb30@etherboot.org>
Thu, 24 Jul 2008 19:00:43 +0000 (20:00 +0100)
committerMichael Brown <mcb30@etherboot.org>
Thu, 24 Jul 2008 19:00:43 +0000 (20:00 +0100)
src/hci/shell_banner.c

index f96f2a5..3271c48 100644 (file)
@@ -20,6 +20,7 @@
 #include <console.h>
 #include <unistd.h>
 #include <config/general.h>
+#include <gpxe/keys.h>
 #include <gpxe/shell_banner.h>
 
 /** @file
  * @ret        enter_shell             User wants to enter shell
  */
 int shell_banner ( void ) {
-       int wait_count = 0;
        int enter_shell = 0;
+       int wait_count;
        int key;
 
        printf ( "\nPress Ctrl-B for the gPXE command line..." );
 
        /* Wait for key */
-       while ( wait_count < BANNER_TIMEOUT ) {
+       for ( wait_count = 0 ; wait_count < BANNER_TIMEOUT ; wait_count++ ) {
                if ( iskey() ) {
                        key = getchar();
-                       if ( key == 0x02 /* Ctrl-B */ )
+                       if ( key == CTRL_B )
                                enter_shell = 1;
                        break;
                }
                mdelay(100);
-               wait_count++;
        }
 
        /* Clear the "Press Ctrl-B" line */