public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@gentoo.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [RFC] Add 'led' command
Date: Thu, 18 Nov 2010 05:37:57 -0500	[thread overview]
Message-ID: <201011180537.58224.vapier@gentoo.org> (raw)
In-Reply-To: <201011131831.40670.vapier@gentoo.org>

On Saturday, November 13, 2010 18:31:39 Mike Frysinger wrote:
> On Friday, November 12, 2010 09:42:52 Jason Kridner wrote:
> > On Tue, Nov 9, 2010 at 8:52 AM, Mike Frysinger wrote:
> > > On Friday, November 05, 2010 01:50:36 Jason Kridner wrote:
> > >> +     if (strcmp(argv[2], "off") == 0) {
> > >> +             state = 0;
> > >> +     } else if (strcmp(argv[2], "on") == 0) {
> > >> +             state = 1;
> > > 
> > > i could have sworn we had a helper somewhere to handle "boolean
> > > strings" ...
> > 
> > common/cmd_cache.c has an internal on_off function.  All other places
> > seem to do individual strcmp.  Let me know if you find such a helper.
> > Is there value to putting this in a function like the one in
> > cmd_cache.c?
> 
> i think there's value in moving this to generalizing and moving to common
> code.  there are other places where we handle env vars which could have the
> value "on" or "off".

ah, i found what i was thinking of.  there is a "getenv_yesno" helper.  
obviously not the same as "on/off", but should be a good model for a new 
"str_onoff" helper.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20101118/6f40acc3/attachment.pgp 

      reply	other threads:[~2010-11-18 10:37 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-05  5:50 [U-Boot] [RFC] Add 'led' command Jason Kridner
2010-11-05 12:21 ` Wolfgang Denk
2010-11-05 13:13   ` Reinhard Meyer
2010-11-05 17:04     ` Jason Kridner
2011-12-13 23:55   ` Ulf Samuelsson
2011-12-14 19:11     ` Simon Glass
     [not found]       ` <4EE8FB51.8010108@telia.com>
2011-12-14 21:31         ` Simon Glass
2011-12-15 18:17           ` Jason Kridner
2011-12-16  7:58             ` Ulf Samuelsson
2010-11-09 13:52 ` Mike Frysinger
2010-11-12 14:42   ` Jason Kridner
2010-11-13 23:31     ` Mike Frysinger
2010-11-18 10:37       ` Mike Frysinger [this message]

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=201011180537.58224.vapier@gentoo.org \
    --to=vapier@gentoo.org \
    --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