From patchwork Thu May 23 20:14:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Mikhak X-Patchwork-Id: 10958753 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E4EB1924 for ; Thu, 23 May 2019 20:14:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D19EC28746 for ; Thu, 23 May 2019 20:14:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C61242872E; Thu, 23 May 2019 20:14:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7630F28746 for ; Thu, 23 May 2019 20:14:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=rcAXx4HRJZAOIEtOJd/oi3I9xMIyM0EmnZNSC9L7VhE=; b=ic3na0NynOxchsrap6MyffULKO CYxhdLRa3zM5PQq7mAMgkYYHZVbRuO1xh4MOfrH/D7ziaU1LAolUzWKVx0baqtS2csd6qktQCiEH9 ciHKqXP6RJjjQQ+w52v0AsIS1XrbT1sJQfgCqFlSh912IPpMqKNfiTZuM37KNz/lspHB9mh8t8Nwo 7MXNtJnW8l42lf4tdFmj0bMIyYZAuFPVMZfKqfdfeII9MlIZ3wraOxrYsuVLvv7iI0I+xLHU9UFIe U1q/JxFwYlIcpm/BzvoX2hg/aI+LaY9zQVLHF47q5CHw+PfDys+BnOZVLr6G7hQl32MIUBaeXlFjT 74vX+X6Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hTu72-00068x-0H; Thu, 23 May 2019 20:14:52 +0000 Received: from mail-pl1-x642.google.com ([2607:f8b0:4864:20::642]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hTu6z-000675-H6 for linux-riscv@lists.infradead.org; Thu, 23 May 2019 20:14:51 +0000 Received: by mail-pl1-x642.google.com with SMTP id w7so3186349plz.1 for ; Thu, 23 May 2019 13:14:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=6gkDN24DEHNecikQAfO3DJ7JR/wol/teQBJzyAbylPE=; b=glbLShSIWuwKWWNiYhxijT7zHQDg2YZ+rDfTZTICpfYRPoA2m+b9+2p9hVRGRimcxe eyTeN8BJfaSRNof3f+rSO8Q6Y5r+DC7BQumsOMB+vY6JTMxr3AMXY9qboUlWfI6CQatR RylunzRKwzVdC7jhqX63X30pBuTszUi6agnZU8dleumrBOdefDl8rJxIQQRf+pg9RSGk MumkhQ7VvAK9YJUvaD1POeHSJcTuxtyFa6NgXyfARjRYXQ2ngVgmtkuTipU0JtnRXNPS gEgHoRYLxf0qCOVMpP5iUz37oWaN94Cg/WyEklcQ43f3pVG3bvny2aghocXc6PLNru6A erXw== 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; bh=6gkDN24DEHNecikQAfO3DJ7JR/wol/teQBJzyAbylPE=; b=QepRj5Be56vxGHtu3sSHlbaB1sLrmzfMzh+wVt5yFkzheRSAP3LH5rfwjoPvB7HXC5 46ChvaWEEE3ItBTW9YIdHtDm3YgzXlQmESEvetB07ApUbE0GSrtPI1P7EsWzUjboCY/p JpCdIjNpRLQrrT9d38dOjAPXnavRz02tR8bnticpVO/qvSTKBQsa9W7mQdwmOsBjgquS 3/PY2aN/fIbZAc5RyyhLIft/QMStlVmAsAG+KpSxLEaRKmxBlyVPaCdA40uDVdfMY6wH IZyADLMFuiPEZyCbQ+SHGm0+RHpG6a7fB5TqPp8yNDYIfIRaIsshiwuAL93AzWBBV3QB 9exQ== X-Gm-Message-State: APjAAAVVj69YSVQdI319E2hido2+rGdgtDR9uUQwIh9dykPNOeVBDGxI K7/ENkKlGZfve/wDUCc2Gb9aYw== X-Google-Smtp-Source: APXvYqwmtyNKChwhcovf4WtzVC9Nt812fpxIHPfh5q19R6jEFHGMxxk0MguAJEM/AnwyhJv8Fd+XkA== X-Received: by 2002:a17:902:9343:: with SMTP id g3mr100265540plp.260.1558642488578; Thu, 23 May 2019 13:14:48 -0700 (PDT) Received: from nuc7.sifive.com ([12.206.222.2]) by smtp.gmail.com with ESMTPSA id i12sm180839pgb.61.2019.05.23.13.14.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 23 May 2019 13:14:47 -0700 (PDT) From: Alan Mikhak X-Google-Original-From: Alan Mikhak < alan.mikhak@sifive.com > To: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, kishon@ti.com, lorenzo.pieralisi@arm.com, linux-riscv@lists.infradead.org, palmer@sifive.com, paul.walmsley@sifive.com Subject: [PATCH 1/2] tools: PCI: Fix broken pcitest compilation Date: Thu, 23 May 2019 13:14:23 -0700 Message-Id: <1558642464-9946-2-git-send-email-alan.mikhak@sifive.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1558642464-9946-1-git-send-email-alan.mikhak@sifive.com> References: <1558642464-9946-1-git-send-email-alan.mikhak@sifive.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190523_131449_625506_71A0BFA2 X-CRM114-Status: GOOD ( 13.99 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alan Mikhak MIME-Version: 1.0 Sender: "linux-riscv" Errors-To: linux-riscv-bounces+patchwork-linux-riscv=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Alan Mikhak Fixes: fef31ecaaf2c ("tools: PCI: Fix compilation warnings") pcitest is currently broken due to the following compiler error and related warning. Fix by changing the run_test() function signature to return an integer result. pcitest.c: In function run_test: pcitest.c:143:9: warning: return with a value, in function returning void return (ret < 0) ? ret : 1 - ret; /* return 0 if test succeeded */ pcitest.c: In function main: pcitest.c:232:9: error: void value not ignored as it ought to be return run_test(test); Signed-off-by: Alan Mikhak Reviewed-by: Paul Walmsley --- tools/pci/pcitest.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/pci/pcitest.c b/tools/pci/pcitest.c index 5fa5c2bdd427..6dce894667f6 100644 --- a/tools/pci/pcitest.c +++ b/tools/pci/pcitest.c @@ -47,15 +47,15 @@ struct pci_test { unsigned long size; }; -static void run_test(struct pci_test *test) +static int run_test(struct pci_test *test) { - long ret; + int ret = -EINVAL; int fd; fd = open(test->device, O_RDWR); if (fd < 0) { perror("can't open PCI Endpoint Test device"); - return; + return -ENODEV; } if (test->barnum >= 0 && test->barnum <= 5) { From patchwork Thu May 23 20:14:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Mikhak X-Patchwork-Id: 10958757 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6527516C1 for ; Thu, 23 May 2019 20:14:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 51D8C28753 for ; Thu, 23 May 2019 20:14:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 45B3628746; Thu, 23 May 2019 20:14:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id EDA1D2874C for ; Thu, 23 May 2019 20:14:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=wMRiPmTD8penN1blzW1iXp59M9J2lYoz6oGACVdNzBs=; b=slDLu/8mqPFELYXlwgiCENVnGg RNOZuh+O4EgiCO6uTSf3GSO5oi0fYWgk0Ceu3Lt6MRO2rlBrNV57jq/a9epXzyl57P4iyym9G5tag e9WkJ2Q2yig/pdODlEwkRr2kJWqPX2Vfzx0CGVeVjP2HoPjLt7yfa7jZPx48acpj+Qeiy09VzKOe8 H64BZFYbnH66iDNet7RVyokmNrh6WS5Ma9+yLRujZP/nnbpugUdJoEUAcNPReNyxFc00VrvwQIHQG i+1dohyg5vNssdc8PG5Snz1fn+E6VWRlWpMB6q2GWXCALDETy1Ja2Au4g+NSt3KDjHdix3oqhIgYM pbjj14yw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hTu74-0006Bj-L2; Thu, 23 May 2019 20:14:54 +0000 Received: from mail-pl1-x644.google.com ([2607:f8b0:4864:20::644]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hTu71-00068I-9E for linux-riscv@lists.infradead.org; Thu, 23 May 2019 20:14:52 +0000 Received: by mail-pl1-x644.google.com with SMTP id w7so3186390plz.1 for ; Thu, 23 May 2019 13:14:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=5G1ZPvgTrdgyW2PxGOXC6vH5P8E8ivAkNJzVwGirtqo=; b=AKnEDntflvnhyaBSvVK099GiNRlWgGmribqV0Gw/VdWTjwxzjpNafTbPuqKigoe2V5 FttiilstLFzz13VHtqQ9Ow5qJWcSTmkZod1V/o67Oz7JpP4zndSuIOsjZEnzgLgC45Dg 1OBKSki/z8keLPmKvajpOynSqHY7geZI+K/YsdtLyEKBdPCcZVy7j/HKpK1eqApnmVRU B6d9wKjRuRWn4waIsXQHcEJCqUAi1LCpXsW0bGQxXG81fDN09MqYT2dprU1jScxQcw8k jZAoSGnyRTN6nFsLblRD2D74d6EvdPLSc5r6ch8s3TeUUG7GD2LjrY8535TP8yf89ZX9 Yk5A== 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; bh=5G1ZPvgTrdgyW2PxGOXC6vH5P8E8ivAkNJzVwGirtqo=; b=mzmUQS2WMMeorfCH/WDIugxGlhkJamyk5S5UUEQ8lLtbfh+lFEENaefACdov9Bb6Rc MF1SZC3M1odMcLrn8dOyu09rLBkXqkxKloPOFr5ojT7dyE87dtjarVo0/Qlv2qEwNRun Rfc1fNGuOrbDUKdaie7xxeDO2E3BFcL0eDJh8lgZy8I4BByi5hSWlTzB2eZnwqgwLZwZ tKIxdRsR604ChGU/aYL191yPO+uAcVjAzH2F8dheGPiYJjAHPe4WLnNbTWAqE3ESTHzT V0W/hVgley18/ymG/LZpZ2n/BwgDwyw8xHgEAT4dbhNalz44ZdzzP2DYC9MJgWw4u0te s94A== X-Gm-Message-State: APjAAAXRQ5aOROCXcKRKD64hPqL/Zvf98RzNIMEpvjPioZBMa33tVp5v Jfq1/x3XlxxS8+2C+HsaVLfihw== X-Google-Smtp-Source: APXvYqyocPUBK+x86to4bFHTsugKXVdIxgBB30akfZUKLbQ4YlaRtHksF4iUavWEP335zXjgDmppXQ== X-Received: by 2002:a17:902:59c3:: with SMTP id d3mr29255894plj.273.1558642490753; Thu, 23 May 2019 13:14:50 -0700 (PDT) Received: from nuc7.sifive.com ([12.206.222.2]) by smtp.gmail.com with ESMTPSA id i12sm180839pgb.61.2019.05.23.13.14.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 23 May 2019 13:14:50 -0700 (PDT) From: Alan Mikhak X-Google-Original-From: Alan Mikhak < alan.mikhak@sifive.com > To: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, kishon@ti.com, lorenzo.pieralisi@arm.com, linux-riscv@lists.infradead.org, palmer@sifive.com, paul.walmsley@sifive.com Subject: [PATCH 2/2] tools: PCI: Fix compiler warning in pcitest Date: Thu, 23 May 2019 13:14:24 -0700 Message-Id: <1558642464-9946-3-git-send-email-alan.mikhak@sifive.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1558642464-9946-1-git-send-email-alan.mikhak@sifive.com> References: <1558642464-9946-1-git-send-email-alan.mikhak@sifive.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190523_131451_331253_A7503D38 X-CRM114-Status: GOOD ( 11.18 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alan Mikhak MIME-Version: 1.0 Sender: "linux-riscv" Errors-To: linux-riscv-bounces+patchwork-linux-riscv=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Alan Mikhak Fixes: fbca0b284bd0 ("tools: PCI: Add 'h' in optstring of getopt()") Fix the following compiler warning in pcitest: pcitest.c: In function main: pcitest.c:214:4: warning: too many arguments for format [-Wformat-extra-args] "usage: %s [options]\n" Signed-off-by: Alan Mikhak Reviewed-by: Paul Walmsley Signed-off-by:. --- tools/pci/pcitest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/pci/pcitest.c b/tools/pci/pcitest.c index 6dce894667f6..6f1303104d84 100644 --- a/tools/pci/pcitest.c +++ b/tools/pci/pcitest.c @@ -223,7 +223,7 @@ int main(int argc, char **argv) "\t-r Read buffer test\n" "\t-w Write buffer test\n" "\t-c Copy buffer test\n" - "\t-s Size of buffer {default: 100KB}\n", + "\t-s Size of buffer {default: 100KB}\n" "\t-h Print this help message\n", argv[0]); return -EINVAL;