From patchwork Thu Jun 5 21:40:16 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Siddhesh Poyarekar X-Patchwork-Id: 356602 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id E9513140087 for ; Fri, 6 Jun 2014 07:39:08 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:cc:subject:message-id:references :mime-version:content-type:in-reply-to; q=dns; s=default; b=hjOB 0t7VrK/Bh/V+3yn81qLqZqUfZ79uGHgSzqd5vi4Wh0nkQBGyaGvr1CSwUgfdqNRM sUf/GsQa1Wc0Cbd1KRYzRkTrsUuJiuLTZ/C8Xt5gRkbvviehuV/kNA59a1jBEozA ovnBQREn9Y0DsRnNY54/u1aOTuedoxPGCc8np0U= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:cc:subject:message-id:references :mime-version:content-type:in-reply-to; s=default; bh=oXb2crvweE 8uoKOujjewZw+vdRU=; b=RASt4z5ONhB69gW8QVx9FNQkvx5kAjkxMXlRHstv7A 1mJ+Kv+vcbUzqbjAT3rYQr+Ijv+PtCgsq9aMIX1jU+KOlJZri90U/MQ/TiE3K8iX T7jHYZIGR0MtnXvi0XcsMSPYd3Hdw8fr43RSHTh3J6QdSluXlSXF3S9jNeHd83tF I= Received: (qmail 7215 invoked by alias); 5 Jun 2014 21:39:04 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 7204 invoked by uid 89); 5 Jun 2014 21:39:03 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.9 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Date: Fri, 6 Jun 2014 03:10:16 +0530 From: Siddhesh Poyarekar To: Roland McGrath Cc: Konstantin Serebryany , GNU C Library Subject: Re: [PATCH] remove one nested function from nptl/allocatestack.c Message-ID: <20140605214016.GG9145@spoyarek.pnq.redhat.com> References: <20140604171623.362652C39B4@topped-with-meat.com> <20140605090455.GB9145@spoyarek.pnq.redhat.com> <20140605183110.1B52C2C39B5@topped-with-meat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20140605183110.1B52C2C39B5@topped-with-meat.com> User-Agent: Mutt/1.5.22.1-rc1 (2013-10-16) I have pushed this now. Thanks, Siddhesh commit fc75bf464d128f6a722d6cca7012c996f1f73425 Author: Siddhesh Poyarekar Date: Fri Jun 6 02:59:49 2014 +0530 Inline nested function check_list diff --git a/ChangeLog b/ChangeLog index 17f0c83..8fe1ad0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2014-06-05 Siddhesh Poyarekar + + * nptl/allocatestack.c (check_list): Inlined function... + (__reclaim_stacks): ... here. + 2014-06-05 Ondřej Bílka [BZ #15698] diff --git a/nptl/allocatestack.c b/nptl/allocatestack.c index 1e22f7d..d0d155c 100644 --- a/nptl/allocatestack.c +++ b/nptl/allocatestack.c @@ -830,26 +830,23 @@ __reclaim_stacks (void) if (add_p) { - /* We always add at the beginning of the list. So in this - case we only need to check the beginning of these lists. */ - int check_list (list_t *l) - { - if (l->next->prev != l) - { - assert (l->next->prev == elem); - - elem->next = l->next; - elem->prev = l; - l->next = elem; - - return 1; - } - - return 0; - } - - if (check_list (&stack_used) == 0) - (void) check_list (&stack_cache); + /* We always add at the beginning of the list. So in this case we + only need to check the beginning of these lists to see if the + pointers at the head of the list are inconsistent. */ + list_t *l = NULL; + + if (stack_used.next->prev != &stack_used) + l = &stack_used; + else if (stack_cache.next->prev != &stack_cache) + l = &stack_cache; + + if (l != NULL) + { + assert (l->next->prev == elem); + elem->next = l->next; + elem->prev = l; + l->next = elem; + } } else {