From patchwork Sat May 9 20:34:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Vasut X-Patchwork-Id: 245391 List-Id: U-Boot discussion From: marek.vasut at gmail.com (Marek Vasut) Date: Sat, 9 May 2020 22:34:36 +0200 Subject: [PATCH 02/10] net: rtl8139: Switch from malloc()+memset() to calloc() In-Reply-To: <20200509203444.821733-1-marek.vasut+renesas@gmail.com> References: <20200509203444.821733-1-marek.vasut+renesas@gmail.com> Message-ID: <20200509203444.821733-2-marek.vasut+renesas@gmail.com> Replace malloc()+memset() combination with calloc(), no functional change. Signed-off-by: Marek Vasut Cc: Joe Hershberger --- drivers/net/rtl8139.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/rtl8139.c b/drivers/net/rtl8139.c index adee618543..aabaacabc5 100644 --- a/drivers/net/rtl8139.c +++ b/drivers/net/rtl8139.c @@ -551,12 +551,11 @@ int rtl8139_initialize(bd_t *bis) debug("rtl8139: REALTEK RTL8139 @0x%x\n", iobase); - dev = (struct eth_device *)malloc(sizeof(*dev)); + dev = calloc(1, sizeof(*dev)); if (!dev) { printf("Can not allocate memory of rtl8139\n"); break; } - memset(dev, 0, sizeof(*dev)); rtl8139_name(dev->name, card_number);