From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yijing Wang Subject: Re: [RFC PATCH 03/11] PCI/MSI: Refactor pci_dev_msi_enabled() Date: Wed, 6 Aug 2014 09:23:51 +0800 Message-ID: <53E183A7.80905@huawei.com> References: <1406344128-27055-1-git-send-email-wangyijing@huawei.com> <1406344128-27055-4-git-send-email-wangyijing@huawei.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Sender: linux-pci-owner@vger.kernel.org To: Stuart Yoder Cc: linux-kernel@vger.kernel.org, Xinwei Hu , Wuyun , Bjorn Helgaas , linux-pci@vger.kernel.org, Paul.Mundt@huawei.com, "James E.J. Bottomley" , Marc Zyngier , "linux-arm-kernel@lists.infradead.org" , Russell King , linux-arch@vger.kernel.org, arnab.basu@freescale.com, virtualization@lists.linux-foundation.org, Hanjun Guo List-Id: linux-arch.vger.kernel.org On 2014/8/6 6:35, Stuart Yoder wrote: > On Fri, Jul 25, 2014 at 10:08 PM, Yijing Wang wrote: >> Pci_dev_msi_enabled() is used to check whether device >> MSI/MSIX enabled. Refactor this function to suuport >> checking only device MSI or MSIX enabled. >> >> Signed-off-by: Yijing Wang > > So this patch refactors things so that checks like this: > > - if (!dev->msi_enabled) > > are moved into a function: > > + if (!pci_dev_msi_enabled(dev, MSI_TYPE)) > > Can you explain a bit more why this needed. Is it just cleanup? Hi Stuart, it's not just cleanup, because "[RFC PATCH 08/11] PCI/MSI: Introduce new struct msi_irqs and struct msi_ops" introduced struct msi_irqs, so the code will change to if (!dev->msi_irqs->msi_enabled) I think driver should not need to know the details of MSI members. So I try to rework the pci_dev_msi_enabled() to hide the detailed MSI info. Thanks! Yijing. > > . > -- Thanks! Yijing From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from szxga02-in.huawei.com ([119.145.14.65]:44511 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753584AbaHFBYt (ORCPT ); Tue, 5 Aug 2014 21:24:49 -0400 Message-ID: <53E183A7.80905@huawei.com> Date: Wed, 6 Aug 2014 09:23:51 +0800 From: Yijing Wang MIME-Version: 1.0 Subject: Re: [RFC PATCH 03/11] PCI/MSI: Refactor pci_dev_msi_enabled() References: <1406344128-27055-1-git-send-email-wangyijing@huawei.com> <1406344128-27055-4-git-send-email-wangyijing@huawei.com> In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Sender: linux-arch-owner@vger.kernel.org List-ID: To: Stuart Yoder Cc: linux-kernel@vger.kernel.org, Xinwei Hu , Wuyun , Bjorn Helgaas , linux-pci@vger.kernel.org, Paul.Mundt@huawei.com, "James E.J. Bottomley" , Marc Zyngier , "linux-arm-kernel@lists.infradead.org" , Russell King , linux-arch@vger.kernel.org, arnab.basu@freescale.com, virtualization@lists.linux-foundation.org, Hanjun Guo Message-ID: <20140806012351.3sWXf4AfVuUsFsRk9yW6smIgClwc53zLGFKHXDWeC2w@z> On 2014/8/6 6:35, Stuart Yoder wrote: > On Fri, Jul 25, 2014 at 10:08 PM, Yijing Wang wrote: >> Pci_dev_msi_enabled() is used to check whether device >> MSI/MSIX enabled. Refactor this function to suuport >> checking only device MSI or MSIX enabled. >> >> Signed-off-by: Yijing Wang > > So this patch refactors things so that checks like this: > > - if (!dev->msi_enabled) > > are moved into a function: > > + if (!pci_dev_msi_enabled(dev, MSI_TYPE)) > > Can you explain a bit more why this needed. Is it just cleanup? Hi Stuart, it's not just cleanup, because "[RFC PATCH 08/11] PCI/MSI: Introduce new struct msi_irqs and struct msi_ops" introduced struct msi_irqs, so the code will change to if (!dev->msi_irqs->msi_enabled) I think driver should not need to know the details of MSI members. So I try to rework the pci_dev_msi_enabled() to hide the detailed MSI info. Thanks! Yijing. > > . > -- Thanks! Yijing