Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp2278773ybm; Thu, 23 May 2019 14:20:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqwCc6hjBdnqfbz0VJnWxrneMu2xWr4eMTcQjt7C18CT3OZ5ptM31G1rKnMvWIyirMPNWm2o X-Received: by 2002:a62:1ec3:: with SMTP id e186mr61183944pfe.197.1558646451332; Thu, 23 May 2019 14:20:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558646451; cv=none; d=google.com; s=arc-20160816; b=ytXdWLK4ZmuyO9GWpaBFxXAWUq0XBro9KeiPgLYtIrEECtduvq9YdmLkeC9NQEiehS 2I+Rjt8CXj255qvRCk8PCesQfjw1TzKm9hBCIwAgvEs4V9dZ91A/aIvS4pguHA/Yd0JP r9uLMs3Uc8QEjRQZAEekAKOn7daTvjWpPOShNoDQXjIpNssmDVO9v1EgBLjmP5kEFs8Z 5QFX5wkZnIPHpJ7g4ht/QPteSD6/xV9/KF4YOMRNOsfHoD5LVy/xwH2W3OE1mBNUsY/G cr77tjcWrrmc0PQ4tztbTZsqmDCy5mj2mpu4GnfMuhnv9r1Pk0a+Oqser7m32T0Dr3Sw lpAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=MSZ9qLvgnuUWthhRIbf1Cjhkpu+CFOpygVqw6RbqY5U=; b=qN3m043MohKuf0jDjEdPFW0EgHVGpLq8MOyNxjhTghuEhGjtlSkucQaOT0Hoka17IP qMwvFVjhusYpvggh9L/fMVScE6VF4Yho2YWxoTnlAF0QeyTPGn9MfXMNxC1ZpVYA1dOY oF8CSz+crsnHZaTQBfAwdaNBnUl9msqBG/sinu/iUQxR8xcj4ziafLIOHPSpXJAuQcA5 aJUOhUH+0nUOZQpY5Hi9VI4L6Ga+jTK7ZW9nh7bOHo+Th54ZndYUj9Ak7yA3Ed/t2KRO SjD9mqxzrxzqXPdlOzREGLTWZGKNcUaBOZ668eMTv7T0SYKPj9AuOgL6inXGlhRerJhD oJKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=WIEVJh7T; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h96si929681pjb.43.2019.05.23.14.20.34; Thu, 23 May 2019 14:20:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=WIEVJh7T; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388172AbfEWVTO (ORCPT + 99 others); Thu, 23 May 2019 17:19:14 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:40317 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387914AbfEWVTO (ORCPT ); Thu, 23 May 2019 17:19:14 -0400 Received: by mail-pf1-f194.google.com with SMTP id u17so3940480pfn.7 for ; Thu, 23 May 2019 14:19:13 -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=MSZ9qLvgnuUWthhRIbf1Cjhkpu+CFOpygVqw6RbqY5U=; b=WIEVJh7TgDCASi/+YnUkSMzEwtd6hlDck+n8tN2K1tMOc34LB1Jh1QvKVxb0cutw3A DH4g4vh5nw8eXnfoR/heSxG5RvW1s4Cu7RyyZ6t4otZ8aHQMWiZqrWSxK+3N7aAy6R+4 l8r6b9AvVpOk1jZ5i+uT/WsV3S0MArSerkECLKNwwo4gMVmHGwsbZ2PrkVXf3810gVjH 4xz9PTduCE02rrpFhwTGSl93D/REB0grsaDhqd9PMcZVxOt1JnTht+mXI17goUcKY5W/ MUmKkcNqR6rdY6EVi4f6uc5ZmjTB//hhHcF8odQI4bMn7jlRbjXi1cGld2z+oA2gXfiR dE4g== 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=MSZ9qLvgnuUWthhRIbf1Cjhkpu+CFOpygVqw6RbqY5U=; b=kc9E0za4C4KWqDqFOladFEDewie8dXcLVd9FuBdT7o2XM9ZJ/DrD6QxVpc455+M78k YvEL36PI+hftYOjiiFHTUaJGPtwCDV3GpJiqPA83ATT9IkNCtrM6jEzRn7T6sUo6irpF fW8qs2U1eOg1jFzONnFvAr5j2OCX4HGyJEUu/j1oAOkAGNK1HpuCL1CQRtvll9+zIVU4 rYtfCoAeQ2tbHBKL3Edejf1SbMUM16We/LfuuZGNgYj1d7tiFFFzQ4BJrOHRjgHuInLQ eQ3YWTAb2LjUuKRmxGKM2R7gmYdluNO344kbutjnMqPi8zwZ9yS+5AxPU7WZ/YcQ2CkZ 6OBw== X-Gm-Message-State: APjAAAUL3wmiuofi7mfDhQ05/EY+WdNB4seCyrv7tMKQLCkekEW2Bc9U IvQDyOnk288sDv36P0bDHVGoLw== X-Received: by 2002:a62:7610:: with SMTP id r16mr108209123pfc.69.1558646353373; Thu, 23 May 2019 14:19:13 -0700 (PDT) Received: from nuc7.sifive.com ([12.206.222.2]) by smtp.gmail.com with ESMTPSA id t5sm234092pgn.80.2019.05.23.14.19.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 23 May 2019 14:19:12 -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 Cc: Alan Mikhak Subject: [PATCH v2 1/2] tools: PCI: Fix broken pcitest compilation Date: Thu, 23 May 2019 14:18:00 -0700 Message-Id: <1558646281-12676-2-git-send-email-alan.mikhak@sifive.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1558646281-12676-1-git-send-email-alan.mikhak@sifive.com> References: <1558646281-12676-1-git-send-email-alan.mikhak@sifive.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Fixes: fef31ecaaf2c ("tools: PCI: Fix compilation warnings") 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) { -- 2.7.4