From patchwork Thu Aug 13 17:37:16 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 7009701 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id F320FC05AC for ; Thu, 13 Aug 2015 17:38:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C2CBF2041A for ; Thu, 13 Aug 2015 17:38:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9B42F2026D for ; Thu, 13 Aug 2015 17:38:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753327AbbHMRiN (ORCPT ); Thu, 13 Aug 2015 13:38:13 -0400 Received: from mail-bl2on0142.outbound.protection.outlook.com ([65.55.169.142]:32173 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752210AbbHMRiL (ORCPT ); Thu, 13 Aug 2015 13:38:11 -0400 Received: from BY2PR03CA044.namprd03.prod.outlook.com (10.141.249.17) by CY1PR0301MB1307.namprd03.prod.outlook.com (10.161.212.17) with Microsoft SMTP Server (TLS) id 15.1.231.21; Thu, 13 Aug 2015 17:37:51 +0000 Received: from BL2FFO11FD020.protection.gbl (2a01:111:f400:7c09::192) by BY2PR03CA044.outlook.office365.com (2a01:111:e400:2c5d::17) with Microsoft SMTP Server (TLS) id 15.1.231.21 via Frontend Transport; Thu, 13 Aug 2015 17:37:51 +0000 Authentication-Results: spf=temperror (sender IP is 192.88.158.2) smtp.mailfrom=freescale.com; freescale.mail.onmicrosoft.com; dkim=none (message not signed) header.d=none; Received-SPF: TempError (protection.outlook.com: error in processing during lookup of freescale.com: DNS Timeout) Received: from az84smr01.freescale.net (192.88.158.2) by BL2FFO11FD020.mail.protection.outlook.com (10.173.161.38) with Microsoft SMTP Server (TLS) id 15.1.243.9 via Frontend Transport; Thu, 13 Aug 2015 17:37:49 +0000 Received: from fabio-Latitude-E6410.am.freescale.net ([10.29.244.122]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id t7DHbgcv030697; Thu, 13 Aug 2015 10:37:47 -0700 From: Fabio Estevam To: CC: , Fabio Estevam Subject: [PATCH 4/4] PCI: ats: Use BUG_ON() Date: Thu, 13 Aug 2015 14:37:16 -0300 Message-ID: <1439487436-26989-4-git-send-email-fabio.estevam@freescale.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1439487436-26989-1-git-send-email-fabio.estevam@freescale.com> References: <1439487436-26989-1-git-send-email-fabio.estevam@freescale.com> X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD020; 1:xffDxtzUuzcSWNcO34Ns/iUNuGjqSC+UKkYrWfro+5E/0+DerSE0fSDEVwOus9MpX26Hvn7qdW0mrMdv18OZ8zWwGkHZgkdwkZySJDM9GeWmva/nRuIFGNP3m9RhbrUnJZKJ/G5tUXYEMAvM/Q+ASQsTPzldpohliLPJBURB0dlDf9k3KPyNhYflxsdpHyZIuFc1pTO26UgOhoNkGdf9Wy6cmDD9JlBkW/IdHtUE/GJxTMopKQ59DVJJDtY3rzo6c+jj6ceVqILUw1SjeopgmRRU1ozVgZnsDlYn7Lr/eyoPO0eL1eLGxLO5ukoobVL8Y+r8VSi705FoJaTBzGeElzikDEA/CyO6MHWyhRQ2psbLc3HUnnIt3ma1ozcmWp+cf1KUFPSOHTQwgnIH+053qg== X-Forefront-Antispam-Report: CIP:192.88.158.2; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(2970300002)(3050300001)(189002)(199003)(110136002)(229853001)(19580395003)(2351001)(6806004)(105606002)(69596002)(19580405001)(5003940100001)(47776003)(50226001)(46102003)(64706001)(36756003)(5001830100001)(5001960100002)(107886002)(81156007)(50466002)(189998001)(97736004)(5001860100001)(48376002)(77156002)(2950100001)(76176999)(50986999)(62966003)(33646002)(106466001)(92566002)(104016003)(68736005)(86362001)(87936001)(77096005)(4001540100001)(4001430100001); DIR:OUT; SFP:1102; SCL:1; SRVR:CY1PR0301MB1307; H:az84smr01.freescale.net; FPR:; SPF:TempError; PTR:ErrorRetry; MX:3; A:3; LANG:en; MIME-Version: 1.0 X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB1307; 2:yciDd0nTLTGa9/g8tl/JGEuK45//kQGeSyLNvfoqyS7APIcNTqCSH+IdiRyNo7FbksQ/ZTPxz8B1N1PeyYwY6kUagDg/Uk4Y+nvVdVxGb8tTxotre/Zdxz5YFmrjp7sg+u13uN+wEsPImF3+hJW8dfDa6lUg43Jm/OWDvLUcNFo=; 3:XIvbwDYw0s2yXreq3AoC5oY4aVQgm/+oaDMJYSL2fqY5ek3LIvCFFFJseO4Toxdn4EYj0G8NW4C1a5kX58s4UQ657/YgKGH2ZISGph2nQH+ekY4pSIyTFFyrS+q0LQ5hAY1e0hQPo2ZqKGEdaylSHSHNYxDN3HbZaT6S30uQQLCM2Hrd8FMYBQLDazXra8BLHs8PlWt3cPGwtjBvh2xaJpfOmV6BwoKQB2vt5s+9VSs=; 25:xc87Ltse6fANJEt4LI16gskBUT0Er1WoLWhdGXs5GTkAw8S+qhp5dpLLT9t9u/KVelyx6kUeMMH9LciSRWTThfEW9VpxcEPUqmH/aAa9E9/ZNo12rFOHwiIhWN/z1mB7sB5z567HAthVy2zRKN6LeanoI1a8A04E+rx5c/eYNbQv8AY1e36yGsDNGoNcWEpbzyM3V86pPjFgnwNCFqZSnsEEaL0g/5jjWQkiwhxH9g/V6dIUutrTmaRq7n7b4NPC7jXKdrIC1yS9Axc/tTUqrQ== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR0301MB1307; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB1307; 20:WByJuoNeN7IxIy3Raox+R/I41gN/52lMpgXQwq74WdBd9B+FVU9Gr1Trl+vlRVmatfz95HJ5A+idDCWLBWvuKu8JRNqaUKgvVbed9SiK9PpzkX2jEf6AM3R0J3USUaMlypZX9ekvXdPlwtRuCEjtjVdvaOZ7crCT3Hp6KVktk07Omm3fulkxPPo2vCpbBuxwNoYgbKEOML4E9Z7uWzKOWYaw3Nyet33ZPw2xulwZ43W1AvtStUrAru597xicI+NnCbG0juHBnTvsrdHU0sgSsmqlOinUCaMl6leTUMJ4n70DS/vgsAypIns/q/4mJTkU/JpkmcUq2RShX3Z1G2DlfzsMpd7azxMUQLBUE65R9io=; 4:AV1n7codevP79UXjvSMPMgYlutk2zetdTj5Uxl12hUtQW+1zz9QBrf0gONHLWNthDxaRWHfkZlytn01tRhyaUawSpDqHU6G3bz9DeuvjqhU1kqrmxW41D2u95VH8IstLs4pBPmRWXFmGN+BK1lq5Wn3+DS5MkWubNh5UEVEZrGm5nDX7N2cckYP7q83Z+jF3vTlWblFRNLSxGKGtmTn9njHS1BS+u+z8TXiGa94qfr4nav3NPDPLqknusYHADRZ/49ghwpOU5TlBiKSJzG9PCCkSXtYzTx1X3prHzOub1lM= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5005006)(3002001); SRVR:CY1PR0301MB1307; BCL:0; PCL:0; RULEID:; SRVR:CY1PR0301MB1307; X-Forefront-PRVS: 0667289FF8 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR0301MB1307; 23:LpKD4f+AFtwWsvYH9vvU/shsjsd/OkXoaeP291U?= =?us-ascii?Q?FADU0J1JEdtxjc7fT3nPxCOkBrEwvqqwVY/XjHUprHX+bthIR0KSrPxdiZLg?= =?us-asc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L++b1nIs54mi5bA1RF8uhekQbWpUQk?= =?us-ascii?Q?qeKmG1KxZSmzXnUVZVwXz57MJ7lmsDYxvRsxfAlLxgXanbYthhrT8tUP1PQn?= =?us-ascii?Q?vakBO4zQhecmvvwS6W1s3wD03HHZ3F95GFJ8m+tTt8y0ObK78bTtM1HV8wVS?= =?us-ascii?Q?tgYufm7vvKs12aVV0uGW7LX0XWK4smNwd91SKv4vF7YNPNPKgVWS6qA=3D?= =?us-ascii?Q?=3D?= X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB1307; 5:4gabuQ2fkI3sSIddsIssafDawLUcp1Xz4aTp0tvabhNrwkblx3sM9/jsUE0O2QUmtkavXq+n41UNsB1B2c+SIHEXi0zzhvcGOVCFVtdvOYwWXCT7QINSC0k9Tz3QAgtYui2woptnQRxp50riHlydRw==; 24:+xtkiXatuUTyrXbq9MPaMW3SydM1+7b+IdSJOiLwvzaNH8aGJdSTqVbdaWDoezv5DS2ogV/gw2bCxwRr/Xa7qMWpu3cTHH9Gu++AHKvh58k=; 20:uQkRaA/B1OHMQS4wiUEVckAhqln+6wwfxqjnqu8FmJVMT+w8OmNBOg1dZ9ufVsJ2blwJ+TofKKwh9lliTn8MFw== X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Aug 2015 17:37:49.2798 (UTC) X-MS-Exchange-CrossTenant-Id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=710a03f5-10f6-4d38-9ff4-a80b81da590d; Ip=[192.88.158.2]; Helo=[az84smr01.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0301MB1307 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Use BUG_ON() instead of an if condition followed by BUG(). The semantic patch that makes this change is available in scripts/coccinelle/misc/bugon.cocci. Signed-off-by: Fabio Estevam --- drivers/pci/ats.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/pci/ats.c b/drivers/pci/ats.c index a8099d4..1c25b20 100644 --- a/drivers/pci/ats.c +++ b/drivers/pci/ats.c @@ -134,8 +134,7 @@ void pci_restore_ats_state(struct pci_dev *dev) if (!pci_ats_enabled(dev)) return; - if (!pci_find_ext_capability(dev, PCI_EXT_CAP_ID_ATS)) - BUG(); + BUG_ON(!pci_find_ext_capability(dev, PCI_EXT_CAP_ID_ATS)); ctrl = PCI_ATS_CTRL_ENABLE; if (!dev->is_virtfn)