diff options
| author | Marek Vasut <[email protected]> | 2020-05-17 18:24:15 +0200 |
|---|---|---|
| committer | Daniel Schwierzeck <[email protected]> | 2020-06-29 22:36:35 +0200 |
| commit | 0e11d79a533e3c874be1c5975abbc52aaba94d93 (patch) | |
| tree | dc2ed45f5ebd1b508b8ae84dedd1c51961a38b00 | |
| parent | 89369b0ac2ca0621bfc30baed739bb9d9e7fdcad (diff) | |
net: pcnet: Replace memset+malloc with calloc
This combination of functions can be replaced with calloc(),
make it so.
Signed-off-by: Marek Vasut <[email protected]>
Cc: Daniel Schwierzeck <[email protected]>
Cc: Joe Hershberger <[email protected]>
| -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 72b93806244..b670cff2aae 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); |
