From: Ladislav Michl <Ladislav.Michl@seznam.cz>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/5] NetStar: eeprom - be less verbose
Date: Thu, 28 Jan 2010 00:19:23 +0100 [thread overview]
Message-ID: <20100127231923.GC18557@localhost.localdomain> (raw)
In-Reply-To: <20100127231620.GA18557@localhost.localdomain>
From: Ladislav Michl <ladis@linux-mips.org>
Use shorter yet descriptive messages, replace printf() with
puts() where appropriate. This saves few bytes.
Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
---
board/netstar/eeprom.c | 27 +++++++++++++--------------
1 files changed, 13 insertions(+), 14 deletions(-)
diff --git a/board/netstar/eeprom.c b/board/netstar/eeprom.c
index ef530a3..1670a5b 100644
--- a/board/netstar/eeprom.c
+++ b/board/netstar/eeprom.c
@@ -45,7 +45,7 @@ static u16 read_eeprom_reg(u16 reg)
while ((SMC_inw(&dev, CTL_REG) & CTL_RELOAD) && --timeout)
udelay(100);
if (timeout == 0) {
- printf("Timeout Reading EEPROM register %02x\n", reg);
+ printf("Timeout reading register %02x\n", reg);
return 0;
}
@@ -66,7 +66,7 @@ static int write_eeprom_reg(u16 value, u16 reg)
while ((SMC_inw(&dev, CTL_REG) & CTL_STORE) && --timeout)
udelay(100);
if (timeout == 0) {
- printf("Timeout Writing EEPROM register %02x\n", reg);
+ printf("Timeout writing register %02x\n", reg);
return 0;
}
@@ -88,8 +88,7 @@ static int verify_macaddr(char *s)
u16 reg;
int i, err = 0;
- printf("MAC Address: ");
- err = i = 0;
+ puts("HWaddr: ");
for (i = 0; i < 3; i++) {
reg = read_eeprom_reg(0x20 + i);
printf("%02x:%02x%c", reg & 0xff, reg >> 8, i != 2 ? ':' : '\n');
@@ -149,15 +148,15 @@ int eeprom(int argc, char *argv[])
unsigned char buf[58], *p;
app_startup(argv);
- if (get_version() != XF_VERSION) {
- printf("Wrong XF_VERSION.\n");
- printf("Application expects ABI version %d\n", XF_VERSION);
- printf("Actual U-Boot ABI version %d\n", (int)get_version());
+ i = get_version();
+ if (i != XF_VERSION) {
+ printf("Using ABI version %d, but U-Boot provides %d\n",
+ XF_VERSION, i);
return 1;
}
if ((SMC_inw(&dev, BANK_SELECT) & 0xFF00) != 0x3300) {
- printf("SMSC91111 not found.\n");
+ puts("SMSC91111 not found\n");
return 2;
}
@@ -169,9 +168,9 @@ int eeprom(int argc, char *argv[])
/* Print help message */
if (argv[1][1] == 'h') {
- printf("NetStar EEPROM writer\n");
- printf("Built: %s at %s\n", U_BOOT_DATE, U_BOOT_TIME);
- printf("Usage:\n\t<mac_address> [<element_1>] [<...>]\n");
+ puts("NetStar EEPROM writer\n"
+ "Built: " U_BOOT_DATE " at " U_BOOT_TIME "\n"
+ "Usage:\n\t<mac_address> [<element_1>] [<...>]\n");
return 0;
}
@@ -188,7 +187,7 @@ int eeprom(int argc, char *argv[])
printf("Element %d: odd character count\n", i - 1);
return 3;
case -3:
- printf("Out of EEPROM memory\n");
+ puts("Out of EEPROM memory\n");
return 3;
default:
p += ret;
@@ -199,7 +198,7 @@ int eeprom(int argc, char *argv[])
/* First argument (MAC) is mandatory */
set_mac(argv[1]);
if (verify_macaddr(argv[1])) {
- printf("*** MAC address does not match! ***\n");
+ puts("*** HWaddr does not match! ***\n");
return 4;
}
--
1.5.3.8
next prev parent reply other threads:[~2010-01-27 23:19 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-27 23:16 [U-Boot] [PATCH 0/5] NetStar updates Ladislav Michl
2010-01-27 23:18 ` [U-Boot] [PATCH 1/5] NetStar: eeprom - undefined reference to `memset' Ladislav Michl
2010-01-27 23:19 ` Ladislav Michl [this message]
2010-01-27 23:20 ` [U-Boot] [PATCH 3/5] NetStar: eeprom - fix linker error Ladislav Michl
2010-01-27 23:21 ` [U-Boot] [PATCH 4/5] NetStar: fix default environment Ladislav Michl
2010-01-27 23:22 ` [U-Boot] [PATCH 5/5] NetStar: make mtdparts default ready for recent kernels Ladislav Michl
2010-02-08 16:55 ` [U-Boot] [PATCH 0/5] NetStar updates Paulraj, Sandeep
2010-02-08 18:39 ` Ladislav Michl
2010-02-08 19:21 ` Paulraj, Sandeep
2010-02-08 21:41 ` Ladislav Michl
2010-02-08 20:45 ` Paulraj, Sandeep
2010-02-09 9:12 ` [U-Boot] [PATCH] netstar.h: do not exceed 80 columns Ladislav Michl
2010-02-18 2:22 ` Paulraj, Sandeep
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=20100127231923.GC18557@localhost.localdomain \
--to=ladislav.michl@seznam.cz \
--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