public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: richardretanubun <richardretanubun@ruggedcom.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/1] CONFIG_MENUKEY: RFC: Is this how CONFIG_MENUKEY supposed to work?
Date: Thu, 28 Aug 2008 17:20:46 -0400	[thread overview]
Message-ID: <48B716AE.3090009@ruggedcom.com> (raw)

I noticed that CONFIG_MENUKEY aborts autoboot unconditionally
and executes the "menucmd" env.variable if it found a match later on. 
This seems odd.
It is possible that I misunderstood the intent of the logic. The only 
other user of it now is AmigaOneG3SE.

I made a patch to make the logic only aborts autoboot if there is a 
match detected.

If the person who wrote the logic is reading this, did I understood the 
logic correctly?
If so please Sign-off the patch to have it applied.

Signed-off-by: Richard Retanubun <RichardRetanubun_at_ruggedcom.com>
----

diff --git a/common/main.c b/common/main.c
index 187ef8a..5a4308d 100644
--- a/common/main.c
+++ b/common/main.c
@@ -238,14 +238,19 @@ static __inline__ int abortboot(int bootdelay)
                /* delay 100 * 10ms */
                for (i=0; !abort && i<100; ++i) {
                        if (tstc()) {   /* we got a key press   */
-                               abort  = 1;     /* don't auto boot      */
-                               bootdelay = 0;  /* no more delay        */
 # ifdef CONFIG_MENUKEY
                                menukey = getc();
+                               if (menukey == CONFIG_MENUKEY) {        /* we got a match */
+                                       abort  = 1;     /* don't auto boot      */
+                                       bootdelay = 0;  /* no more delay        */
+                                       break;
+                               }
 # else
-                               (void) getc();  /* consume input        */
-# endif
+                               (void) getc();  /* consume input        */
+                               abort  = 1;     /* don't auto boot      */
+                               bootdelay = 0;  /* no more delay        */
                                break;
+# endif
                        }
                        udelay(10000);
                }

                 reply	other threads:[~2008-08-28 21:20 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48B716AE.3090009@ruggedcom.com \
    --to=richardretanubun@ruggedcom.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox