All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yijing Wang <wangyijing@huawei.com>
To: Yijing Wang <wangyijing@huawei.com>, Bjorn Helgaas <bhelgaas@google.com>
Cc: <linux-pci@vger.kernel.org>, Wuyun <wuyun.wu@huawei.com>,
	Xinwei Hu <huxinwei@huawei.com>
Subject: Re: [PATCH] PCI/MSI: Use irq_get_msi_desc() to simplify code
Date: Tue, 8 Jul 2014 10:11:20 +0800	[thread overview]
Message-ID: <53BB5348.10701@huawei.com> (raw)
In-Reply-To: <1404463406-3484-1-git-send-email-wangyijing@huawei.com>

This patch has been integrate into "[PATCH v3 0/6] Cleanup for MSI" patchset.

On 2014/7/4 16:43, Yijing Wang wrote:
> Use irq_get_msi_desc() to get MSI irq related msi_desc
> directly.
> 
> Signed-off-by: Yijing Wang <wangyijing@huawei.com>
> ---
>  drivers/pci/msi.c |   12 +++++-------
>  1 files changed, 5 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
> index 3bee1ba..f95af2b 100644
> --- a/drivers/pci/msi.c
> +++ b/drivers/pci/msi.c
> @@ -487,7 +487,6 @@ EXPORT_SYMBOL_GPL(pci_restore_msi_state);
>  static ssize_t msi_mode_show(struct device *dev, struct device_attribute *attr,
>  			     char *buf)
>  {
> -	struct pci_dev *pdev = to_pci_dev(dev);
>  	struct msi_desc *entry;
>  	unsigned long irq;
>  	int retval;
> @@ -496,12 +495,11 @@ static ssize_t msi_mode_show(struct device *dev, struct device_attribute *attr,
>  	if (retval)
>  		return retval;
>  
> -	list_for_each_entry(entry, &pdev->msi_list, list) {
> -		if (entry->irq == irq) {
> -			return sprintf(buf, "%s\n",
> -				       entry->msi_attrib.is_msix ? "msix" : "msi");
> -		}
> -	}
> +	entry = irq_get_msi_desc(irq);
> +	if (entry)
> +		return sprintf(buf, "%s\n",
> +				entry->msi_attrib.is_msix ? "msix" : "msi");
> +
>  	return -ENODEV;
>  }
>  
> 


-- 
Thanks!
Yijing


      reply	other threads:[~2014-07-08  2:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-04  8:43 [PATCH] PCI/MSI: Use irq_get_msi_desc() to simplify code Yijing Wang
2014-07-08  2:11 ` Yijing Wang [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53BB5348.10701@huawei.com \
    --to=wangyijing@huawei.com \
    --cc=bhelgaas@google.com \
    --cc=huxinwei@huawei.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=wuyun.wu@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.