Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753094AbbHRU6I (ORCPT ); Tue, 18 Aug 2015 16:58:08 -0400 Received: from mail-io0-f177.google.com ([209.85.223.177]:35875 "EHLO mail-io0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751813AbbHRU6G (ORCPT ); Tue, 18 Aug 2015 16:58:06 -0400 MIME-Version: 1.0 In-Reply-To: <20150817235236.GQ26431@google.com> References: <1438039809-24957-1-git-send-email-yinghai@kernel.org> <1438039809-24957-8-git-send-email-yinghai@kernel.org> <20150817235236.GQ26431@google.com> Date: Tue, 18 Aug 2015 13:58:05 -0700 X-Google-Sender-Auth: RVEP-AXqXfGZAJdD03GeO--_-F0 Message-ID: Subject: Re: [PATCH v3 07/51] PCI: Reorder resources list for must/optional resources From: Yinghai Lu To: Bjorn Helgaas Cc: David Miller , Benjamin Herrenschmidt , Wei Yang , TJ , Yijing Wang , Andrew Morton , "linux-pci@vger.kernel.org" , Linux Kernel Mailing List Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1526 Lines: 37 On Mon, Aug 17, 2015 at 4:52 PM, Bjorn Helgaas wrote: > On Mon, Jul 27, 2015 at 04:29:25PM -0700, Yinghai Lu wrote: >> After we update size and alignment for must+optional resource, we >> reorder them with new alignment, but this is only for STARTALIGN. >> >> For SIZEALIGN type resource, after add back add_size, the alignment >> get changed, so need to do the sorting like STARTALIGN type resources. >> >> Also we need to reorder the sorting back after we restore >> resource to must only when must+optional fail to allocate for all. >> >> So move out the reordering code from the loop to separated function, >> and call it two times accordingly. >> >> Signed-off-by: Yinghai Lu >> --- >> drivers/pci/setup-bus.c | 62 +++++++++++++++++++++++++++++-------------------- >> 1 file changed, 37 insertions(+), 25 deletions(-) >> >> diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c >> index 7346bbf..6f2d508 100644 >> --- a/drivers/pci/setup-bus.c >> +++ b/drivers/pci/setup-bus.c >> @@ -287,6 +287,31 @@ static inline void reset_resource(struct resource *res) >> res->flags = 0; >> } >> >> +static void __sort_resources(struct list_head *head) > > Why did you add "__" before the function name? ok, will remove that. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/