From patchwork Fri May 11 22:50:47 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Walle X-Patchwork-Id: 158625 X-Patchwork-Delegate: prafulla@marvell.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 8A8D3B700B for ; Sat, 12 May 2012 08:51:52 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 064EB2815C; Sat, 12 May 2012 00:51:45 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5W99QRs-VkBJ; Sat, 12 May 2012 00:51:44 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 901542815D; Sat, 12 May 2012 00:51:18 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id EBAC628135 for ; Sat, 12 May 2012 00:51:12 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id tYYMk4fKNv83 for ; Sat, 12 May 2012 00:51:12 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail.serverraum.org (mail.serverraum.org [78.47.150.89]) by theia.denx.de (Postfix) with ESMTP id C60F828137 for ; Sat, 12 May 2012 00:51:03 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail.serverraum.org (Postfix) with ESMTP id 784FB3EFFD; Sat, 12 May 2012 00:51:03 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mail.serverraum.org Received: from mail.serverraum.org ([127.0.0.1]) by localhost (web.serverraum.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2Z9PLtYMQ0y1; Sat, 12 May 2012 00:51:03 +0200 (CEST) Received: from thanatos.fritz.box (95-89-251-205-dynip.superkabel.de [95.89.251.205]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.serverraum.org (Postfix) with ESMTPSA id 262D03EFF8; Sat, 12 May 2012 00:51:03 +0200 (CEST) From: Michael Walle To: u-boot@lists.denx.de Date: Sat, 12 May 2012 00:50:47 +0200 Message-Id: <1336776649-9316-4-git-send-email-michael@walle.cc> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1336776649-9316-1-git-send-email-michael@walle.cc> References: <1336776649-9316-1-git-send-email-michael@walle.cc> Subject: [U-Boot] [PATCH v5 3/5] net: fix potential compiler warning X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Future compiler versions may generate a "too many arguments for functions" warning. Signed-off-by: Michael Walle Cc: Joe Hershberger --- net/eth.c | 14 ++++++++++++-- 1 files changed, 12 insertions(+), 2 deletions(-) diff --git a/net/eth.c b/net/eth.c index c9f05d8..afce863 100644 --- a/net/eth.c +++ b/net/eth.c @@ -58,7 +58,12 @@ int eth_getenv_enetaddr_by_index(const char *base_name, int index, uchar *enetaddr) { char enetvar[32]; - sprintf(enetvar, index ? "%s%daddr" : "%saddr", base_name, index); + + if (index) + sprintf(enetvar, "%s%daddr", base_name, index); + else + sprintf(enetvar, "%saddr", base_name); + return eth_getenv_enetaddr(enetvar, enetaddr); } @@ -66,7 +71,12 @@ static int eth_mac_skip(int index) { char enetvar[15]; char *skip_state; - sprintf(enetvar, index ? "eth%dmacskip" : "ethmacskip", index); + + if (index) + sprintf(enetvar, "eth%dmacskip", index); + else + sprintf(enetvar, "ethmacskip"); + return ((skip_state = getenv(enetvar)) != NULL); }