mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-11 07:34:31 +00:00
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>
This commit is contained in:
parent
89369b0ac2
commit
0e11d79a53
1 changed files with 1 additions and 2 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue