From 6939e0826c6125ae66083fcf173f75853fe6d5ca Mon Sep 17 00:00:00 2001 From: Benjamin Walsh Date: Wed, 17 Feb 2016 13:50:13 -0500 Subject: [PATCH] pci: trivial if statement refactoring It was hard to see where the condition ended and the code block started. Change-Id: If966b0a404beb1c783a1c8dd89e6049a6600cadf Signed-off-by: Benjamin Walsh --- drivers/pci/pci.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 6106b1e2eb7..e5da9485257 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -373,11 +373,14 @@ int pci_bus_scan(struct pci_dev_info *dev_info) { union pci_addr_reg pci_ctrl_addr; - if (!lookup.info.class_type && - !lookup.info.vendor_id && - !lookup.info.device_id && - lookup.info.bar == PCI_BAR_ANY && - lookup.info.function == PCI_FUNCTION_ANY) { + int init_from_dev_info = + !lookup.info.class_type && + !lookup.info.vendor_id && + !lookup.info.device_id && + lookup.info.bar == PCI_BAR_ANY && + lookup.info.function == PCI_FUNCTION_ANY; + + if (init_from_dev_info) { lookup.info.class_type = dev_info->class_type; lookup.info.vendor_id = dev_info->vendor_id; lookup.info.device_id = dev_info->device_id;