Re: [PATCH 1/5] PCI: Don't check resource_size() in pci_bus_alloc_resource()

From: Yinghai Lu
Date: Tue Mar 11 2014 - 19:55:07 EST


On Tue, Mar 11, 2014 at 3:02 PM, Bjorn Helgaas <bhelgaas@xxxxxxxxxx> wrote:
> On Tue, Mar 11, 2014 at 3:39 PM, Yinghai Lu <yinghai@xxxxxxxxxx> wrote:
>> how about replacing that with:
>>
>> if (avail.start > avail.end)
>> continue;
>>
>> so we do not need to go deep into allocate_resource()
>
> We could, but why bother? This isn't a performance path, so there's
> no need to add more code to optimize it. Adding code means there's
> more for human readers to look at and understand, so I prefer not to
> add it unless it's needed.

oh, i did not look further, if the code path could handle strange
constraints properly.
like min > max.

Thanks

Yinghai
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/