PCI MSI: Use list_first_entry()
authorHidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
Thu, 6 Aug 2009 02:32:04 +0000 (11:32 +0900)
committerJesse Barnes <jbarnes@virtuousgeek.org>
Wed, 9 Sep 2009 20:29:30 +0000 (13:29 -0700)
use list_first_entry() instead of list_entry().

Reviewed-by: Matthew Wilcox <willy@linux.intel.com>
Signed-off-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
drivers/pci/msi.c

index a7b72f633d07ba141dd34cd840b7b821402d6d31..bdd2ca9df41f7085b4cb5d4ae4f5bbbb7e07a9c6 100644 (file)
@@ -324,7 +324,7 @@ static void __pci_restore_msix_state(struct pci_dev *dev)
        if (!dev->msix_enabled)
                return;
        BUG_ON(list_empty(&dev->msi_list));
-       entry = list_entry(dev->msi_list.next, struct msi_desc, list);
+       entry = list_first_entry(&dev->msi_list, struct msi_desc, list);
        pos = entry->msi_attrib.pos;
        pci_read_config_word(dev, pos + PCI_MSIX_FLAGS, &control);