From patchwork Mon May 14 17:27:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gustavo Pimentel X-Patchwork-Id: 913143 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=none dis=none) header.from=synopsys.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=synopsys.com header.i=@synopsys.com header.b="kUKFUiXf"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 40l72627CTz9s0W for ; Tue, 15 May 2018 03:27:58 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752350AbeENR14 (ORCPT ); Mon, 14 May 2018 13:27:56 -0400 Received: from smtprelay.synopsys.com ([198.182.37.59]:38440 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752254AbeENR14 (ORCPT ); Mon, 14 May 2018 13:27:56 -0400 Received: from mailhost.synopsys.com (mailhost1.synopsys.com [10.12.238.239]) by smtprelay.synopsys.com (Postfix) with ESMTP id 0F9CB1E04F9 for ; Mon, 14 May 2018 19:27:55 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1526318875; bh=psDDHlvBDUjBpSJ5dG/6jswHJ5dHRaXGcfceVumJYpo=; h=From:To:Cc:Subject:Date:From; b=kUKFUiXfSSvq0Wrv5d6Ro6j0TVk0hQdo39OsreNbBhxh2EwNsRZWilhxRGH6yy+JI 7SsQK+jIG36M5ShMmtzJKX9b9CUAxj/r3k+2TdUpmXqnYDp+ujxjDETRz21/a2VVMC ju68u3H91OxyfuJif44PPdWu7qFWeoFlaNZ2RQr2qp7qBiI8ceZwCmEckoQruNGiZs St7w24QwPNVpCEoRPmcpm1GTa7ZNoOS30ZLgM4i4yWxIISvV0JJLVKp1VkVLwNaikA iHwJp8RDoKj4Q3iau5vTe/KGbsuaE4/hCpH00vSVGClJRAk1hGbYa2yCe0syJAV0Ch ASwrlJDVVxULw== Received: from pt02.synopsys.com (pt02.synopsys.com [10.107.23.240]) by mailhost.synopsys.com (Postfix) with ESMTP id 436555434; Mon, 14 May 2018 10:27:54 -0700 (PDT) Received: from UbuntuMate-64Bits.internal.synopsys.com (gustavo-e7480.internal.synopsys.com [10.107.25.102]) by pt02.synopsys.com (Postfix) with ESMTP id 9FF103D8D6; Mon, 14 May 2018 18:27:53 +0100 (WEST) From: Gustavo Pimentel To: bhelgaas@google.com, lorenzo.pieralisi@arm.com, kishon@ti.com Cc: linux-pci@vger.kernel.org, Gustavo Pimentel Subject: [PATCH] misc: pci_endpoint_test: Use pci_irq_vector function Date: Mon, 14 May 2018 18:27:48 +0100 Message-Id: X-Mailer: git-send-email 2.7.4 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Replace "pdev->irq + index" operation by the pci_irq_vector() call, that converts from device vector to Linux IRQ. (suggestion made by Alan Douglas). Signed-off-by: Gustavo Pimentel --- drivers/misc/pci_endpoint_test.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/misc/pci_endpoint_test.c b/drivers/misc/pci_endpoint_test.c index fe8897e..28d0cd9 100644 --- a/drivers/misc/pci_endpoint_test.c +++ b/drivers/misc/pci_endpoint_test.c @@ -203,7 +203,7 @@ static bool pci_endpoint_test_msi_irq(struct pci_endpoint_test *test, if (!val) return false; - if (test->last_irq - pdev->irq == msi_num - 1) + if (pci_irq_vector(pdev, msi_num - 1) == test->last_irq) return true; return false; @@ -525,12 +525,12 @@ static int pci_endpoint_test_probe(struct pci_dev *pdev, } for (i = 1; i < irq; i++) { - err = devm_request_irq(dev, pdev->irq + i, + err = devm_request_irq(dev, pci_irq_vector(pdev, i), pci_endpoint_test_irqhandler, IRQF_SHARED, DRV_MODULE_NAME, test); if (err) dev_err(dev, "failed to request IRQ %d for MSI %d\n", - pdev->irq + i, i + 1); + pci_irq_vector(pdev, i), i + 1); } for (bar = BAR_0; bar <= BAR_5; bar++) { @@ -592,7 +592,7 @@ static int pci_endpoint_test_probe(struct pci_dev *pdev, } for (i = 0; i < irq; i++) - devm_free_irq(dev, pdev->irq + i, test); + devm_free_irq(&pdev->dev, pci_irq_vector(pdev, i), test); err_disable_msi: pci_disable_msi(pdev); @@ -625,7 +625,7 @@ static void pci_endpoint_test_remove(struct pci_dev *pdev) pci_iounmap(pdev, test->bar[bar]); } for (i = 0; i < test->num_irqs; i++) - devm_free_irq(&pdev->dev, pdev->irq + i, test); + devm_free_irq(&pdev->dev, pci_irq_vector(pdev, i), test); pci_disable_msi(pdev); pci_release_regions(pdev); pci_disable_device(pdev);