From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 05898C43331 for ; Wed, 13 Nov 2019 02:09:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D3ED6206B6 for ; Wed, 13 Nov 2019 02:09:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573610990; bh=1/VSmpTTU9BsP9TQjL/wDX5Ico+dlFB6FyvPaSDKljY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=xUmRDXSrO7ZLa4DNgthl3H+HOXpLP0j8e7OxiX0tgRTvlGesgnzQxvv4yniaS/ukZ ylUVvgmkmzFjn9OOC5ZJkAXdZd3V0zsu+ZxCOep0xvcaEoZrbypNBijLp1P/s78Ndc 5WsIwm3M2wTH3f9iTigdsTPTozILHpqucmgTwCL4= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730485AbfKMCJu (ORCPT ); Tue, 12 Nov 2019 21:09:50 -0500 Received: from mail.kernel.org ([198.145.29.99]:53928 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729249AbfKMB7Y (ORCPT ); Tue, 12 Nov 2019 20:59:24 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 07BB922469; Wed, 13 Nov 2019 01:59:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573610363; bh=1/VSmpTTU9BsP9TQjL/wDX5Ico+dlFB6FyvPaSDKljY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iKDHe5Zzb5ePFPsMdMurmLTeDVYW2eEmas/0+dR+ZTp6psIaDaXFXn9cTdUM6peFL cL7GwkYW7Pc4iDZFAmbLK0GkGVKq2Dmr+76gjB9C/rc7qre26D7wG9bSxnYZY51ITM ncIthJY7aNZnArS5N9N9i11hPZxpRr2IOeVK4j1Y= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Alan Mikhak , Lorenzo Pieralisi , Paul Walmsley , Sasha Levin , linux-pci@vger.kernel.org Subject: [PATCH AUTOSEL 4.14 113/115] tools: PCI: Fix broken pcitest compilation Date: Tue, 12 Nov 2019 20:56:20 -0500 Message-Id: <20191113015622.11592-113-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191113015622.11592-1-sashal@kernel.org> References: <20191113015622.11592-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Alan Mikhak [ Upstream commit 8a5e0af240e07dd3d4897eb8ff52aab757da7fab ] 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); Fixes: fef31ecaaf2c ("tools: PCI: Fix compilation warnings") Signed-off-by: Alan Mikhak Signed-off-by: Lorenzo Pieralisi Reviewed-by: Paul Walmsley Signed-off-by: Sasha Levin --- 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 8ca1c62bc06db..7002df55826f4 100644 --- a/tools/pci/pcitest.c +++ b/tools/pci/pcitest.c @@ -42,15 +42,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) { -- 2.20.1