aboutsummaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2011-09-11 18:49:53 +0000
committerWolfgang Denk <wd@denx.de>2011-09-21 23:04:34 +0200
commitff25d32c25acd78bac339254108b132178f294b8 (patch)
treefa27eb1de52b9312c56963d8193aae5a5461875f /net
parentfc77086cf2976eaf73f5b9fe35a55293572428f2 (diff)
downloadu-boot-linaro-stable-ff25d32c25acd78bac339254108b132178f294b8.tar.gz
net: turn name len check into an assert
The new sanity check introduces a printf warning for some systems: eth.c:233: warning: format '%zu' expects type 'size_t', but argument 3 has type 'int' Rather than tweak the format string, use the new assert() helper instead. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'net')
-rw-r--r--net/eth.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/net/eth.c b/net/eth.c
index 5911b1c78..02baa3722 100644
--- a/net/eth.c
+++ b/net/eth.c
@@ -227,12 +227,7 @@ int eth_register(struct eth_device *dev)
{
struct eth_device *d;
- size_t len = strlen(dev->name);
- if (len >= NAMESIZE) {
- printf("Network driver name is too long (%zu >= %zu): %s\n",
- len, NAMESIZE, dev->name);
- return -1;
- }
+ assert(strlen(dev->name) < NAMESIZE);
if (!eth_devices) {
eth_current = eth_devices = dev;