From: Bjorn Helgaas Date: Fri, 24 Jan 2014 18:57:18 +0000 (-0700) Subject: x86/PCI: Remove unnecessary list_empty(&pci_root_infos) check X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=3323ab8f7a2f8ffed9393388863bf17329077524;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git x86/PCI: Remove unnecessary list_empty(&pci_root_infos) check list_for_each_entry() handles empty lists, so there's no need to check whether the list is empty first. Signed-off-by: Bjorn Helgaas Acked-by: Rafael J. Wysocki --- diff --git a/arch/x86/pci/bus_numa.c b/arch/x86/pci/bus_numa.c index 2e36a4469549..f3a2cfc14125 100644 --- a/arch/x86/pci/bus_numa.c +++ b/arch/x86/pci/bus_numa.c @@ -10,9 +10,6 @@ static struct pci_root_info *x86_find_pci_root_info(int bus) { struct pci_root_info *info; - if (list_empty(&pci_root_infos)) - return NULL; - list_for_each_entry(info, &pci_root_infos, list) if (info->busn.start == bus) return info;