From patchwork Tue Jan 5 07:47:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baoquan He X-Patchwork-Id: 11998285 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D256BC433E6 for ; Tue, 5 Jan 2021 07:47:35 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 796B121973 for ; Tue, 5 Jan 2021 07:47:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 796B121973 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 0F6F88D0062; Tue, 5 Jan 2021 02:47:35 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 07E4F8D0036; Tue, 5 Jan 2021 02:47:35 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E3CD78D0062; Tue, 5 Jan 2021 02:47:34 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0231.hostedemail.com [216.40.44.231]) by kanga.kvack.org (Postfix) with ESMTP id C05968D0036 for ; Tue, 5 Jan 2021 02:47:34 -0500 (EST) Received: from smtpin06.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 7F8AC8248047 for ; Tue, 5 Jan 2021 07:47:34 +0000 (UTC) X-FDA: 77670941628.06.crook34_1a0be1f274d7 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin06.hostedemail.com (Postfix) with ESMTP id 5BD971004ADEC for ; Tue, 5 Jan 2021 07:47:34 +0000 (UTC) X-HE-Tag: crook34_1a0be1f274d7 X-Filterd-Recvd-Size: 3108 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by imf24.hostedemail.com (Postfix) with ESMTP for ; Tue, 5 Jan 2021 07:47:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1609832852; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:in-reply-to:in-reply-to:references:references; bh=XIQjm85waNu2DaAUZ4nRwaahypJ7KcL7+iJQfZLah8o=; b=QnQWXmffLv4iiUzEWCm7xpN3Sheh8dJ2G33s3WFceqtRcrkBJJSBXXQDO8waOS1wSwkRTN PxC0Oy/O0YgMuUzS4scAfS73CQAnvBQ3EgHMsOjaGMw8dwnTZtyRb7aZqK1Rajx/iTyNBf TmWN6s34jqAPl1xLFgfmvzp0CD8qr/U= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-485-VOn2FcFUM2Ok6SKyXak3Fw-1; Tue, 05 Jan 2021 02:47:31 -0500 X-MC-Unique: VOn2FcFUM2Ok6SKyXak3Fw-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id EC8AF107ACF8; Tue, 5 Jan 2021 07:47:29 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (ovpn-13-56.pek2.redhat.com [10.72.13.56]) by smtp.corp.redhat.com (Postfix) with ESMTP id 52A9871C91; Tue, 5 Jan 2021 07:47:27 +0000 (UTC) From: Baoquan He To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, akpm@linux-foundation.org, rppt@kernel.org, david@redhat.com, bhe@redhat.com Subject: [PATCH v3 4/4] mm: remove unneeded local variable in free_area_init_core Date: Tue, 5 Jan 2021 15:47:08 +0800 Message-Id: <20210105074708.18483-5-bhe@redhat.com> In-Reply-To: <20210105074708.18483-1-bhe@redhat.com> References: <20210105074708.18483-1-bhe@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Local variable 'zone_start_pfn' is not needed since there's only one call site in free_area_init_core(). Let's remove it and pass zone->zone_start_pfn directly to init_currently_empty_zone(). Signed-off-by: Baoquan He Reviewed-by: Mike Rapoport Reviewed-by: David Hildenbrand --- mm/page_alloc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index e0ce6fb6373b..9cacb8652239 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -6986,7 +6986,6 @@ static void __init free_area_init_core(struct pglist_data *pgdat) for (j = 0; j < MAX_NR_ZONES; j++) { struct zone *zone = pgdat->node_zones + j; unsigned long size, freesize, memmap_pages; - unsigned long zone_start_pfn = zone->zone_start_pfn; size = zone->spanned_pages; freesize = zone->present_pages; @@ -7035,7 +7034,7 @@ static void __init free_area_init_core(struct pglist_data *pgdat) set_pageblock_order(); setup_usemap(zone); - init_currently_empty_zone(zone, zone_start_pfn, size); + init_currently_empty_zone(zone, zone->zone_start_pfn, size); memmap_init_zone(zone); } }