From patchwork Fri Nov 27 02:51:19 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 549277 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 B71471402D7 for ; Fri, 27 Nov 2015 13:51:52 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.b=neRdP3F0; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 3CB734B8FC; Fri, 27 Nov 2015 03:51:50 +0100 (CET) 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 vLa4iLOtcJ35; Fri, 27 Nov 2015 03:51:50 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 3C3634B903; Fri, 27 Nov 2015 03:51:49 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 260274B8F8 for ; Fri, 27 Nov 2015 03:51:44 +0100 (CET) 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 0nPACBklow3a for ; Fri, 27 Nov 2015 03:51:44 +0100 (CET) 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-ob0-f175.google.com (mail-ob0-f175.google.com [209.85.214.175]) by theia.denx.de (Postfix) with ESMTPS id 500C74B8FB for ; Fri, 27 Nov 2015 03:51:39 +0100 (CET) Received: by obbbj7 with SMTP id bj7so73550116obb.1 for ; Thu, 26 Nov 2015 18:51:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=U/PZjvXSxK/qs/KHAOzr7tom92QIFs5Q9wskEqPYRck=; b=neRdP3F00y1JEFJ1vj0D8tYNVP6w1kdsPoN2dXWya822Ru9Mw20HGrbrFioqtsocGu i0Bx9e3qZtFBn8Eq8m1AWUMEr+AbGPLM2DDSgI5M5XyuCkDF+GeQCOUrRr4fgefFT7TK SwXMhPL/kOJaeiDa3pVKNwBorA9FUW5dCELZuwkt5shGrLikFD0tGIdvqJJkvY7omMky 21sgMZOx9wBEGdjh0iOn2hs7xF1rxVirOqUX9S+baGlaEv/jPA/5Msvez3Pnoywkn2Rg prxOaZyL3oUnPJ65O9KsoBU9jG2g5XHkzRZo+I4oWKVRw64tBSGgORM5dZYo8o7DOUFf nAlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=U/PZjvXSxK/qs/KHAOzr7tom92QIFs5Q9wskEqPYRck=; b=SwTz2dR5VSkeEYMWNgQ1PnkDqqRa4lVaR/XJ+LUFuLgutZCNsolR1OGisEQNdujA1w lbQTR+zYFEyIT50SNSuovcbrfx82KartPbxSPj4VRt5wxT1S2wEuRULGgX1MVNzT5TQw 0Qjo0SjQfVjHw/3UHXpP87Lpm67Mn8rGC1BcxTJyv8N9drILEyaIwNLYmICZWvhD6npb krg3QWjvKo0vtk0FxyJ1cxfeVHBeLT8AD+7SgsF/XfXkiPYdWoYcpSD52qY3SryhPDEs WBIs6DXnzG2RQcOztuD/Dsc44pdhUs6BbZOevk2eknrLfKX72mNPioO6x6om3cyZjT0n etjg== X-Gm-Message-State: ALoCoQkwiRN6qY/1ZFdGPlFWvrL8XsvqKTc6H6HC/O6EtlfSZ53ciuL05f6Jia4CtdPIw71uInql X-Received: by 10.182.227.230 with SMTP id sd6mr22800536obc.6.1448592698390; Thu, 26 Nov 2015 18:51:38 -0800 (PST) Received: from kaki.bld.corp.google.com ([172.29.216.32]) by smtp.gmail.com with ESMTPSA id xx7sm14316706obc.26.2015.11.26.18.51.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Nov 2015 18:51:37 -0800 (PST) Received: by kaki.bld.corp.google.com (Postfix, from userid 121222) id 85C17220E6B; Thu, 26 Nov 2015 19:51:36 -0700 (MST) From: Simon Glass To: U-Boot Mailing List Date: Thu, 26 Nov 2015 19:51:19 -0700 Message-Id: <1448592690-14911-3-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 2.6.0.rc2.230.g3dd15c0 In-Reply-To: <1448592690-14911-1-git-send-email-sjg@chromium.org> References: <1448592690-14911-1-git-send-email-sjg@chromium.org> Subject: [U-Boot] [PATCH v3 02/13] pci: Use a separate variable for the bus number X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" At present in do_pci(), bdf can either mean a bus number or a PCI bus number. Use separate variables instead to reduce confusion. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- Changes in v3: None Changes in v2: None common/cmd_pci.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common/cmd_pci.c b/common/cmd_pci.c index f3148a3..bed880c 100644 --- a/common/cmd_pci.c +++ b/common/cmd_pci.c @@ -408,6 +408,7 @@ pci_cfg_modify (pci_dev_t bdf, ulong addr, ulong size, ulong value, int incrflag static int do_pci(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { ulong addr = 0, value = 0, size = 0; + int busnum = 0; pci_dev_t bdf = 0; char cmd = 's'; int ret = 0; @@ -438,16 +439,15 @@ static int do_pci(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) #endif default: /* scan bus */ value = 1; /* short listing */ - bdf = 0; /* bus number */ if (argc > 1) { if (argv[argc-1][0] == 'l') { value = 0; argc--; } if (argc > 1) - bdf = simple_strtoul(argv[1], NULL, 16); + busnum = simple_strtoul(argv[1], NULL, 16); } - pciinfo(bdf, value); + pciinfo(busnum, value); return 0; }