From ff25d32c25acd78bac339254108b132178f294b8 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sun, 11 Sep 2011 18:49:53 +0000 Subject: [PATCH] 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 --- net/eth.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/net/eth.c b/net/eth.c index 5911b1c786..02baa3722f 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; -- 2.34.1