From patchwork Tue Sep 23 05:27:25 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yijing Wang X-Patchwork-Id: 4953341 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 8619A9F2BB for ; Tue, 23 Sep 2014 05:03:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8F5B52020F for ; Tue, 23 Sep 2014 05:03:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8680B20149 for ; Tue, 23 Sep 2014 05:03:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751628AbaIWFDR (ORCPT ); Tue, 23 Sep 2014 01:03:17 -0400 Received: from szxga01-in.huawei.com ([119.145.14.64]:53386 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750762AbaIWFDQ (ORCPT ); Tue, 23 Sep 2014 01:03:16 -0400 Received: from 172.24.2.119 (EHLO szxeml410-hub.china.huawei.com) ([172.24.2.119]) by szxrg01-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id CCA36196; Tue, 23 Sep 2014 13:03:11 +0800 (CST) Received: from localhost.localdomain (10.175.100.166) by szxeml410-hub.china.huawei.com (10.82.67.137) with Microsoft SMTP Server id 14.3.158.1; Tue, 23 Sep 2014 13:03:02 +0800 From: Yijing Wang To: Bjorn Helgaas CC: , Yijing Wang , "Tony Luck" , Subject: [PATCH v3 4/9] MSI: Use __get_cached_msi_msg() instead of get_cached_msi_msg() Date: Tue, 23 Sep 2014 13:27:25 +0800 Message-ID: <1411450050-1510-5-git-send-email-wangyijing@huawei.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1411450050-1510-1-git-send-email-wangyijing@huawei.com> References: <1411450050-1510-1-git-send-email-wangyijing@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.100.166] X-CFilter-Loop: Reflected Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 Get_cached_msi_msg() only be called in two places, ia64_set_msi_irq_affinity() and sn_set_msi_irq_affinity(). The code flow is: irq = irq_data->irq get_cached_msi_msg(irq) irq_get_msi_desc(irq) irq_get_irq_data(irq) msi_desc = irq_data->desc __get_cached_msi_msg(msi_desc, msg) This is crazy, we should use __get_cached_msi_msg(irq_data->desc, msg) directly to simplify the flow. Signed-off-by: Yijing Wang CC: Tony Luck CC: linux-ia64@vger.kernel.org --- arch/ia64/kernel/msi_ia64.c | 2 +- arch/ia64/sn/kernel/msi_sn.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/ia64/kernel/msi_ia64.c b/arch/ia64/kernel/msi_ia64.c index c430f91..8c3730c 100644 --- a/arch/ia64/kernel/msi_ia64.c +++ b/arch/ia64/kernel/msi_ia64.c @@ -23,7 +23,7 @@ static int ia64_set_msi_irq_affinity(struct irq_data *idata, if (irq_prepare_move(irq, cpu)) return -1; - get_cached_msi_msg(irq, &msg); + __get_cached_msi_msg(idata->msi_desc, &msg); addr = msg.address_lo; addr &= MSI_ADDR_DEST_ID_MASK; diff --git a/arch/ia64/sn/kernel/msi_sn.c b/arch/ia64/sn/kernel/msi_sn.c index afc58d2..446e779 100644 --- a/arch/ia64/sn/kernel/msi_sn.c +++ b/arch/ia64/sn/kernel/msi_sn.c @@ -175,8 +175,8 @@ static int sn_set_msi_irq_affinity(struct irq_data *data, * Release XIO resources for the old MSI PCI address */ - get_cached_msi_msg(irq, &msg); - sn_pdev = (struct pcidev_info *)sn_irq_info->irq_pciioinfo; + __get_cached_msi_msg(data->msi_desc, &msg); + sn_pdev = (struct pcidev_info *)sn_irq_info->irq_pciioinfo; pdev = sn_pdev->pdi_linux_pcidev; provider = SN_PCIDEV_BUSPROVIDER(pdev);