Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp5446883imm; Sun, 22 Jul 2018 22:59:26 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcDJBAENhbzERzvq1bZleaQddhPo6R7b33inWTRPv7/um3kk4HUmM8q/ug5l5DoqGGT1d9t X-Received: by 2002:a17:902:b205:: with SMTP id t5-v6mr11417481plr.220.1532325566569; Sun, 22 Jul 2018 22:59:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532325566; cv=none; d=google.com; s=arc-20160816; b=UJLYXaXR2zdjXySyX+WOGzKPM5ILkw1d0fBjtfCpzXRC2DVgGZ18WjQ5jvMlU3z/PH 6fwWtc/tWJ7WItj3aqMsiGzYTQXtgY6pmpLkPzu4Ogj6O2EpLydwxIm0IxdPE3tJvnq8 hxb3/xv56XMpE+fEhTY9pSvGRuImp6A0Xj54mQelRn0ftGvMsBSQTt82ALHl9Nb4hg5y RFe/Kc5j0DG74QVJrQhzBQflZWkRl3di99/DFdcaIsTV1/3re5j+RR95fWdfrYxvD9zD tiu617hAUNL99nI2hd/tOnwMxku1Tmzpvo2o77aOsbSLGCBF1ynsbI+ZSHMnc2nYEpbc s7SQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:references:in-reply-to:date :subject:cc:to:from:arc-authentication-results; bh=iQhY9N1AZC7ews/RqkX4DW5nLeTaxM279N01LTr6sHY=; b=NatMmE4eMuc0Wdh7hSkFmVCCJRk5eQrUcFtJ8GYzUwIBqWt96e4z0oxbFIYm+pRMWA gA3JXNdbmYokWCSMPknNNH0x8RkLJB6eZn8gmQD6MAM58t7baFuJ5iyGjl40nVBYQbaJ 1/xFDyZ9LAJTl8H9dfaK8vOve8Y58ALrJwX6Kzdr9Tq1TrJfYbNurjKkgK3xJ8jFbroh u0PFIuNx87gNFjpl05FcXRpIxZrYlK9tfkr5O6rZBGh703e5GejUmwv81dbBuaZ39l2s L8iq01MqqE3UleQGaAOBjbjTeMVrcjhQx3GT4d23OFNx1D5G4TlHokxuW+9QCFFmve8s I/wQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b15-v6si7218719pls.425.2018.07.22.22.59.11; Sun, 22 Jul 2018 22:59:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728389AbeGWG4m (ORCPT + 99 others); Mon, 23 Jul 2018 02:56:42 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:57030 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726943AbeGWG4m (ORCPT ); Mon, 23 Jul 2018 02:56:42 -0400 Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w6N5rvtA129052 for ; Mon, 23 Jul 2018 01:57:10 -0400 Received: from e06smtp07.uk.ibm.com (e06smtp07.uk.ibm.com [195.75.94.103]) by mx0b-001b2d01.pphosted.com with ESMTP id 2kd7q4390g-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 23 Jul 2018 01:57:10 -0400 Received: from localhost by e06smtp07.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 23 Jul 2018 06:57:08 +0100 Received: from b06cxnps4076.portsmouth.uk.ibm.com (9.149.109.198) by e06smtp07.uk.ibm.com (192.168.101.137) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Mon, 23 Jul 2018 06:57:05 +0100 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w6N5v4QO37617734 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 23 Jul 2018 05:57:04 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E99CFAE051; Mon, 23 Jul 2018 08:57:14 +0100 (BST) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 66393AE045; Mon, 23 Jul 2018 08:57:13 +0100 (BST) Received: from rapoport-lnx (unknown [9.148.8.108]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Mon, 23 Jul 2018 08:57:13 +0100 (BST) Received: by rapoport-lnx (sSMTP sendmail emulation); Mon, 23 Jul 2018 08:57:02 +0300 From: Mike Rapoport To: Tony Luck , Fenghua Yu Cc: Michal Hocko , linux-ia64@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Mike Rapoport Subject: [PATCH 1/4] ia64: contig/paging_init: reduce code duplication Date: Mon, 23 Jul 2018 08:56:55 +0300 X-Mailer: git-send-email 2.7.4 In-Reply-To: <1532325418-22617-1-git-send-email-rppt@linux.vnet.ibm.com> References: <1532325418-22617-1-git-send-email-rppt@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 18072305-0028-0000-0000-000002DED489 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18072305-0029-0000-0000-00002396B29C Message-Id: <1532325418-22617-2-git-send-email-rppt@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-07-22_09:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=2 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1807230070 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The FLATMEM version of paging_init has calls to free_area_init_nodes() in the end of every branch of 'if' and 'ifdef' statements. Let's call this function outside the 'ifdef' and 'if' statements instead. Signed-off-by: Mike Rapoport --- arch/ia64/mm/contig.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/arch/ia64/mm/contig.c b/arch/ia64/mm/contig.c index 7d64b30..1835144 100644 --- a/arch/ia64/mm/contig.c +++ b/arch/ia64/mm/contig.c @@ -248,7 +248,6 @@ paging_init (void) efi_memmap_walk(find_largest_hole, (u64 *)&max_gap); if (max_gap < LARGE_GAP) { vmem_map = (struct page *) 0; - free_area_init_nodes(max_zone_pfns); } else { unsigned long map_size; @@ -266,13 +265,12 @@ paging_init (void) */ NODE_DATA(0)->node_mem_map = vmem_map + find_min_pfn_with_active_regions(); - free_area_init_nodes(max_zone_pfns); printk("Virtual mem_map starts at 0x%p\n", mem_map); } #else /* !CONFIG_VIRTUAL_MEM_MAP */ memblock_add_node(0, PFN_PHYS(max_low_pfn), 0); - free_area_init_nodes(max_zone_pfns); #endif /* !CONFIG_VIRTUAL_MEM_MAP */ + free_area_init_nodes(max_zone_pfns); zero_page_memmap_ptr = virt_to_page(ia64_imva(empty_zero_page)); } -- 2.7.4