From patchwork Sat May 23 16:38:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Vasut X-Patchwork-Id: 1296732 X-Patchwork-Delegate: joe.hershberger@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=AB7nSp0n; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49Tpzy01fhz9sPK for ; Sun, 24 May 2020 02:42:21 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id DDB3781868; Sat, 23 May 2020 18:40:59 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="AB7nSp0n"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 183AF81783; Sat, 23 May 2020 18:39:35 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ej1-x643.google.com (mail-ej1-x643.google.com [IPv6:2a00:1450:4864:20::643]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 5502681743 for ; Sat, 23 May 2020 18:39:21 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=marek.vasut@gmail.com Received: by mail-ej1-x643.google.com with SMTP id yc10so16340563ejb.12 for ; Sat, 23 May 2020 09:39:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=5UEE88nyD9BIUhzVxiK2fOHTrk0Sf0je9Bf3+GrTpjY=; b=AB7nSp0nKIG48gyKBdavGx4/oGF8qVDjTIKF/ACEI94APYt+zduSLHtb0SxnZ+QmAL lRwCzC80TTiSlJ6MTHmuhq/izfZtkOHuKgi8z7UWKWJQ80zr/ZJdBLAaX2DqZFKLrsXY aoFrCwQ6qG3Glam5G5ebd7tKjKXOCXcdRUlQSb4NBs3WdAp5vS9nPhA4cN2+ruaEYH2c C7m5ZVuXZ7T4wItkPE22l/GUssyhtAM0Kb5uwvViYc3w6vmxppsBp8CzndQ/CDbZIP5X gqAXi6qtCcGq7TB7BwZ5LMovO1lSm99UHEb1nqr3K/2vC8uJ+n1BYPcnQ67QkfWvkVee ScHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=5UEE88nyD9BIUhzVxiK2fOHTrk0Sf0je9Bf3+GrTpjY=; b=r9edk4ezmBGniAGTLwpLJOPIFLUy0rYC1gOBGrF7qrNLCL/r7kgwgcMNew/DiU7qSW CJhKZyt409ICaXiCTe6m73LBeWZfsVClo92t4apC9SM5hePIUumpQULCquSCoi6ANC6a +F2VhMMnaFmwGFDpiUrnCQmD4OrMqCQrYQwk8n3jynwtFCkVzxJe9XFOt7iy9A1L6F/Z xJHlhgJHfTpTu0XFi2rva37+HSaGakq311h2WW+Qke7VJn9FUOskaxxKFaEqYse0h009 8k0fUsg7TSwTnPLhsjcH9x0qAsYVIhZJUKJPyTfBWy+a3Z8whxl92YqH21swo191sP9w iq2A== X-Gm-Message-State: AOAM532e/IxSlyKo1EpGX0kSCY1HH93jDS1ra0srHDkFQUyu16QY/9ST fM1n2iWa3rBRFfgGJSsYvd/D2+T9 X-Google-Smtp-Source: ABdhPJz2X5KCflyl2AsUvQEiYhSKgySAAwRru+KoUN2Y1YKRnuTDfT6uxvY9FoiibiTF6fb3ip8lkQ== X-Received: by 2002:a17:907:262a:: with SMTP id aq10mr12176964ejc.418.1590251960276; Sat, 23 May 2020 09:39:20 -0700 (PDT) Received: from desktop.lan (ip-86-49-35-8.net.upcbroadband.cz. [86.49.35.8]) by smtp.gmail.com with ESMTPSA id p25sm10456174eds.76.2020.05.23.09.39.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 May 2020 09:39:19 -0700 (PDT) From: Marek Vasut X-Google-Original-From: Marek Vasut To: u-boot@lists.denx.de Cc: joe.hershberger@ni.com, Marek Vasut Subject: [PATCH 18/30] net: eepro100: Switch from malloc()+memset() to calloc() Date: Sat, 23 May 2020 18:38:25 +0200 Message-Id: <20200523163837.407592-18-marek.vasut+renesas@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200523163837.407592-1-marek.vasut+renesas@gmail.com> References: <20200523163837.407592-1-marek.vasut+renesas@gmail.com> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean Replace malloc()+memset() combination with calloc(), no functional change. Signed-off-by: Marek Vasut Reviewed-By: Ramon Fried --- drivers/net/eepro100.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/eepro100.c b/drivers/net/eepro100.c index 74b09e9afd..8fa665743a 100644 --- a/drivers/net/eepro100.c +++ b/drivers/net/eepro100.c @@ -746,12 +746,11 @@ int eepro100_initialize(bd_t *bis) continue; } - dev = (struct eth_device *)malloc(sizeof(*dev)); + dev = calloc(1, sizeof(*dev)); if (!dev) { printf("eepro100: Can not allocate memory\n"); break; } - memset(dev, 0, sizeof(*dev)); sprintf(dev->name, "i82559#%d", card_number); dev->priv = (void *)devno; /* this have to come before bus_to_phys() */