From: Sascha Hauer <s.hauer@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 4/4] dhcp: replace dhcp_getenv_int with getenv_uint
Date: Fri, 27 Sep 2013 08:30:04 +0200 [thread overview]
Message-ID: <1380263404-23104-5-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1380263404-23104-1-git-send-email-s.hauer@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
net/dhcp.c | 12 +-----------
1 file changed, 1 insertion(+), 11 deletions(-)
diff --git a/net/dhcp.c b/net/dhcp.c
index ff54924..e0c231f 100644
--- a/net/dhcp.c
+++ b/net/dhcp.c
@@ -699,16 +699,6 @@ static int dhcp_global_init(void)
}
late_initcall(dhcp_global_init);
-static void dhcp_getenv_int(const char *name, int *i)
-{
- const char* str = getenv(name);
-
- if (!str)
- return;
-
- *i = simple_strtoul(str, NULL, 10);
-}
-
static int do_dhcp(int argc, char *argv[])
{
int ret, opt;
@@ -716,7 +706,7 @@ static int do_dhcp(int argc, char *argv[])
dhcp_reset_env();
- dhcp_getenv_int("global.dhcp.retries", &retries);
+ getenv_uint("global.dhcp.retries", &retries);
while((opt = getopt(argc, argv, "H:v:c:u:U:r:")) > 0) {
switch(opt) {
--
1.8.4.rc3
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
prev parent reply other threads:[~2013-09-27 6:30 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-27 6:30 getenv helpers Sascha Hauer
2013-09-27 6:30 ` [PATCH 1/4] environment variables: introduce new helpers Sascha Hauer
2013-09-27 6:30 ` [PATCH 2/4] loads: use getenv_bool for 'loads_echo' Sascha Hauer
2013-09-27 6:30 ` [PATCH 3/4] bootm: Replace getenv_loadaddr with getenv_ul Sascha Hauer
2013-09-27 6:30 ` Sascha Hauer [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=1380263404-23104-5-git-send-email-s.hauer@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=barebox@lists.infradead.org \
/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