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=-9.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable 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 794ACC43141 for ; Fri, 22 Nov 2019 11:07:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 46C0E2085B for ; Fri, 22 Nov 2019 11:07:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574420831; bh=o2JFch+A6p3gmn/4HgcsJDUv94dfZLgFB7wi3AqrSk8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=wVJQ+qXzavKOWULj4k+xzZG9/QYg447o0DhqhovMRmCtH9VCUL2ecxlbhYONlGf69 i7a6taf0eEe7K/2szF9UrYCd0rdWqWdywmGu7ptJ7elfiOfEm8NeYrl+02UZkn77Bw +sBqyiGX7jRPDH+8PySBPKBK7DYpZ0uCkr3jF4Yw= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731848AbfKVLGX (ORCPT ); Fri, 22 Nov 2019 06:06:23 -0500 Received: from mail.kernel.org ([198.145.29.99]:34598 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731856AbfKVLGW (ORCPT ); Fri, 22 Nov 2019 06:06:22 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BE9F220726; Fri, 22 Nov 2019 11:06:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574420782; bh=o2JFch+A6p3gmn/4HgcsJDUv94dfZLgFB7wi3AqrSk8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JNOFYtKm6IMqDRmeX5Lhp5eRfjTS7+V5jFyw2GsYioMm8EA7SIjaCeqmJx6I0v9ca 5SU8GXTMX4VfCrpKVqCbDS5vR+fX/aA85x4B+LDUEqQSgF66Oo1FBdZyx6EdhxYGo4 fZf1Tyv8E98FRx4s6eQDK9Rwwdy9He3NoSTJqYi0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alan Mikhak , Lorenzo Pieralisi , Paul Walmsley , Sasha Levin Subject: [PATCH 4.19 217/220] tools: PCI: Fix broken pcitest compilation Date: Fri, 22 Nov 2019 11:29:42 +0100 Message-Id: <20191122100929.234765315@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191122100912.732983531@linuxfoundation.org> References: <20191122100912.732983531@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@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 ec4d51f3308b8..4c5be77c211f0 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) { -- 2.20.1