diff options
author | Marek Vasut <marek.vasut+renesas@gmail.com> | 2020-05-17 16:26:57 +0200 |
---|---|---|
committer | Marek Vasut <marek.vasut+renesas@gmail.com> | 2020-06-18 19:34:40 +0200 |
commit | ae38e96c23f3d08e2ec49206a99271252f5b3dc2 (patch) | |
tree | c305fd35cb38a63a3bfff79f29eff2e354f11d7e /drivers/net/pcnet.c | |
parent | 1c38c36eb99abfd1bc46b90c80f7daa5c65f3527 (diff) | |
download | u-boot-ae38e96c23f3d08e2ec49206a99271252f5b3dc2.zip u-boot-ae38e96c23f3d08e2ec49206a99271252f5b3dc2.tar.gz u-boot-ae38e96c23f3d08e2ec49206a99271252f5b3dc2.tar.bz2 |
net: pcnet: Replace memset+malloc with calloc
This combination of functions can be replaced with calloc(),
make it so.
Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Diffstat (limited to 'drivers/net/pcnet.c')
-rw-r--r-- | drivers/net/pcnet.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/net/pcnet.c b/drivers/net/pcnet.c index 72b9380..b670cff 100644 --- a/drivers/net/pcnet.c +++ b/drivers/net/pcnet.c @@ -184,12 +184,11 @@ int pcnet_initialize(bd_t *bis) /* * Allocate and pre-fill the device structure. */ - dev = (struct eth_device *)malloc(sizeof(*dev)); + dev = calloc(1, sizeof(*dev)); if (!dev) { printf("pcnet: Can not allocate memory\n"); break; } - memset(dev, 0, sizeof(*dev)); dev->priv = (void *)(unsigned long)devbusfn; sprintf(dev->name, "pcnet#%d", dev_nr); |