mirror of
https://git.codelinaro.org/clo/qsdk/oss/boot/u-boot-2016.git
synced 2026-03-14 21:10:27 +01:00
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>
This commit is contained in:
parent
fc77086cf2
commit
ff25d32c25
1 changed files with 1 additions and 6 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue