From patchwork Thu Sep 20 15:02:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Jacques Hiblot X-Patchwork-Id: 972491 X-Patchwork-Delegate: lorenzo.pieralisi@arm.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=ti.com header.i=@ti.com header.b="OTM7GGpA"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 42GKjX2MWDz9s3x for ; Fri, 21 Sep 2018 01:03:12 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732470AbeITUrD (ORCPT ); Thu, 20 Sep 2018 16:47:03 -0400 Received: from lelv0143.ext.ti.com ([198.47.23.248]:54104 "EHLO lelv0143.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730758AbeITUrD (ORCPT ); Thu, 20 Sep 2018 16:47:03 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id w8KF31it023463; Thu, 20 Sep 2018 10:03:01 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1537455781; bh=SWzWLjrntZ7+njI6Lx5pp0oLmW+FzjXXaTvFXf8H8fE=; h=From:To:CC:Subject:Date; b=OTM7GGpAYFqsR7xXovifzfPh1QymW3+ep1fTFaW3GeuQGhnHz40NQtT8pc/CFJTDG GolZxolh7r/fiy3qmmPIl6ITsvQ6lQjo8LOw+9IXipJByTbme0aZbVt7ggS+0GeuIr toQ2ZL1fx53lHcdzn/MvZO8bPJUzYdaV+XaFonu0= Received: from DFLE102.ent.ti.com (dfle102.ent.ti.com [10.64.6.23]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id w8KF31ZU010825; Thu, 20 Sep 2018 10:03:01 -0500 Received: from DFLE111.ent.ti.com (10.64.6.32) by DFLE102.ent.ti.com (10.64.6.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Thu, 20 Sep 2018 10:03:01 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DFLE111.ent.ti.com (10.64.6.32) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1466.3 via Frontend Transport; Thu, 20 Sep 2018 10:03:00 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id w8KF2xMY012651; Thu, 20 Sep 2018 10:03:00 -0500 From: Jean-Jacques Hiblot To: , , CC: , Jean-Jacques Hiblot Subject: [PATCH] tools: PCI: exit with error code when test fails Date: Thu, 20 Sep 2018 17:02:53 +0200 Message-ID: <1537455773-13470-1-git-send-email-jjhiblot@ti.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org This makes it easier to use pcitest in automated setups. Signed-off-by: Jean-Jacques Hiblot Acked-by: Kishon Vijay Abraham I --- tools/pci/pcitest.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/pci/pcitest.c b/tools/pci/pcitest.c index af146bb..5adc8cd 100644 --- a/tools/pci/pcitest.c +++ b/tools/pci/pcitest.c @@ -143,6 +143,7 @@ static int run_test(struct pci_test *test) } fflush(stdout); + return (ret < 0) ? ret : 1 - ret; /* return 0 if test succeeded */ } int main(int argc, char **argv) @@ -231,6 +232,5 @@ int main(int argc, char **argv) return -EINVAL; } - run_test(test); - return 0; + return run_test(test); }