mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Yijing Wang <wangyijing@huawei.com>
To: Mike Miller <mike.miller@hp.com>
Cc: Hanjun Guo <guohanjun@huawei.com>, <jiang.liu@huawei.com>,
	Yijing Wang <wangyijing@huawei.com>, <iss_storagedev@hp.com>,
	<linux-kernel@vger.kernel.org>
Subject: [PATCH 03/16] cciss: clean up unnecessary MSI/MSI-X capability find
Date: Thu, 8 Aug 2013 21:05:32 +0800	[thread overview]
Message-ID: <1375967132-32764-1-git-send-email-wangyijing@huawei.com> (raw)

PCI core will initialize device MSI/MSI-X capability in
pci_msi_init_pci_dev(). So device driver should use
pci_dev->msi_cap/msix_cap to determine whether the device
support MSI/MSI-X instead of using
pci_find_capability(pci_dev, PCI_CAP_ID_MSI/MSIX).
Access to PCIe device config space again will consume more time.

Signed-off-by: Yijing Wang <wangyijing@huawei.com>
Cc: Mike Miller <mike.miller@hp.com>
Cc: iss_storagedev@hp.com
Cc: linux-kernel@vger.kernel.org
---
 drivers/block/cciss.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
index 62b6c2c..883715a 100644
--- a/drivers/block/cciss.c
+++ b/drivers/block/cciss.c
@@ -4078,7 +4078,7 @@ static void cciss_interrupt_mode(ctlr_info_t *h)
 	    (h->board_id == 0x40820E11) || (h->board_id == 0x40830E11))
 		goto default_int_mode;
 
-	if (pci_find_capability(h->pdev, PCI_CAP_ID_MSIX)) {
+	if (h->pdev->msix_cap) {
 		err = pci_enable_msix(h->pdev, cciss_msix_entries, 4);
 		if (!err) {
 			h->intr[0] = cciss_msix_entries[0].vector;
@@ -4098,7 +4098,7 @@ static void cciss_interrupt_mode(ctlr_info_t *h)
 			goto default_int_mode;
 		}
 	}
-	if (pci_find_capability(h->pdev, PCI_CAP_ID_MSI)) {
+	if (h->pdev->msi_cap) {
 		if (!pci_enable_msi(h->pdev))
 			h->msi_vector = 1;
 		else
-- 
1.7.1



                 reply	other threads:[~2013-08-08 13:06 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1375967132-32764-1-git-send-email-wangyijing@huawei.com \
    --to=wangyijing@huawei.com \
    --cc=guohanjun@huawei.com \
    --cc=iss_storagedev@hp.com \
    --cc=jiang.liu@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mike.miller@hp.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®