Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp4275095pxf; Tue, 16 Mar 2021 09:29:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxnlwBaTru3Riq6WnAFEKf5X10QoGLUIwXpr7nSrwWTLkWTgQktXwnOXGCWs8vdapPg9rxQ X-Received: by 2002:a17:906:f9d8:: with SMTP id lj24mr30725684ejb.200.1615912174211; Tue, 16 Mar 2021 09:29:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615912174; cv=none; d=google.com; s=arc-20160816; b=BfR2DG6Wz26K1amEXLMOxKGuTNFPLTJxgN5rtpvWfKgwVYG929Nmujeg4sKd3oa4vd l8DtKj4kucGIElTRT2ScxthHyi83MiC99fR+sxuw5jSWKf1miOGqqkX5ashEmsA4T/1v XFkQapsnbjfrmxijUNPJmvr8yl5zntPUW7VH0kkb4hgSjKP4GSCUZnqu5HLP/3RDvYY0 4c5lvWSdQpiaJX0l0OOrVGbZuwZg6ReWhHO2o76aIE5NST7Lvkqk87VGhvXRhhucEEIH 7aCk5c90D/WJT0mnB0uJJTNAHuf/fcWujLZ3l/0X8REpOQw3hCRmLLTTzfsBVF0Zng1l dqlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=IseOZRcdP8gEcuhnawcJ0WzNSI9q6sQ8rUHfaQwWYpw=; b=mZNOBGzwe6SMjOqiKWF2z1FcUPqYgel9N2FZCNyQ1pxTprIMTcY/XIF6GhGR6AmNni YqeI3wtB1NPoDi9HOcfxaBfwDJYGHCYJazhxNSP3tQx70cFZcpvlsTzcTgXoJCgr3aW7 YH5dExTpIRYNz645kcYWAF5Wroq1Ed187sZFrCnKOt6KqgncwjKBfTF6l3vTrnqYVju+ 3JiRZkhjg4DrF5OK46ZyLq4Re295qFAnHEcx0EK+W0iVDvogEj1hIBhsLkRZCTMtsyG4 wRM8hRdCRcSuwdrHWs7GY7i4l2YP2sNICrtVT3082bj6am+XMZzDvGQvurJLGRJ5acWm Oetg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y13si11374347edc.327.2021.03.16.09.29.11; Tue, 16 Mar 2021 09:29:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237720AbhCPPEm (ORCPT + 99 others); Tue, 16 Mar 2021 11:04:42 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:14352 "EHLO szxga07-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237688AbhCPPEM (ORCPT ); Tue, 16 Mar 2021 11:04:12 -0400 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4F0GjJ5s2vz8ydQ; Tue, 16 Mar 2021 23:02:12 +0800 (CST) Received: from [10.174.177.244] (10.174.177.244) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.498.0; Tue, 16 Mar 2021 23:04:03 +0800 Subject: Re: [PATCH] mm: Move mem_init_print_info() into mm_init() To: Christophe Leroy , , Andrew Morton CC: , , Peter Zijlstra , Catalin Marinas , "Dave Hansen" , , Guo Ren , , , Jonas Bonn , , Yoshinori Sato , , Huacai Chen , "Russell King" , , Ingo Molnar , , , Heiko Carstens , , , , , Richard Henderson , , , Palmer Dabbelt , , , "David S. Miller" References: <20210316142637.92193-1-wangkefeng.wang@huawei.com> <26cca1c0-bd38-3d5b-5ca4-44081c444396@csgroup.eu> From: Kefeng Wang Message-ID: Date: Tue, 16 Mar 2021 23:04:01 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <26cca1c0-bd38-3d5b-5ca4-44081c444396@csgroup.eu> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Originating-IP: [10.174.177.244] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021/3/16 22:47, Christophe Leroy wrote: > > > Le 16/03/2021 à 15:26, Kefeng Wang a écrit : >> mem_init_print_info() is called in mem_init() on each architecture, >> and pass NULL argument, cleanup it by using void argument and move >> it into mm_init(). >> >> Signed-off-by: Kefeng Wang >> --- >>   arch/alpha/mm/init.c             | 1 - >>   arch/arc/mm/init.c               | 1 - >>   arch/arm/mm/init.c               | 2 -- >>   arch/arm64/mm/init.c             | 2 -- >>   arch/csky/mm/init.c              | 1 - >>   arch/h8300/mm/init.c             | 2 -- >>   arch/hexagon/mm/init.c           | 1 - >>   arch/ia64/mm/init.c              | 1 - >>   arch/m68k/mm/init.c              | 1 - >>   arch/microblaze/mm/init.c        | 1 - >>   arch/mips/loongson64/numa.c      | 1 - >>   arch/mips/mm/init.c              | 1 - >>   arch/mips/sgi-ip27/ip27-memory.c | 1 - >>   arch/nds32/mm/init.c             | 1 - >>   arch/nios2/mm/init.c             | 1 - >>   arch/openrisc/mm/init.c          | 2 -- >>   arch/parisc/mm/init.c            | 2 -- >>   arch/powerpc/mm/mem.c            | 1 - >>   arch/riscv/mm/init.c             | 1 - >>   arch/s390/mm/init.c              | 2 -- >>   arch/sh/mm/init.c                | 1 - >>   arch/sparc/mm/init_32.c          | 2 -- >>   arch/sparc/mm/init_64.c          | 1 - >>   arch/um/kernel/mem.c             | 1 - >>   arch/x86/mm/init_32.c            | 2 -- >>   arch/x86/mm/init_64.c            | 2 -- >>   arch/xtensa/mm/init.c            | 1 - >>   include/linux/mm.h               | 2 +- >>   init/main.c                      | 1 + >>   mm/page_alloc.c                  | 2 +- >>   30 files changed, 3 insertions(+), 38 deletions(-) >> > >> diff --git a/mm/page_alloc.c b/mm/page_alloc.c >> index 55d938297ce6..e4a6bf69c806 100644 >> --- a/mm/page_alloc.c >> +++ b/mm/page_alloc.c >> @@ -7728,7 +7728,7 @@ unsigned long free_reserved_area(void *start, >> void *end, int poison, const char >>       return pages; >>   } >>   -void __init mem_init_print_info(const char *str) >> +void __init mem_init_print_info(void) >>   { >>       unsigned long physpages, codesize, datasize, rosize, bss_size; >>       unsigned long init_code_size, init_data_size; >> > > And what about the 'str' in the last line of the function ? > >     pr_info("Memory: %luK/%luK available (%luK kernel code, %luK > rwdata, %luK rodata, %luK init, %luK bss, %luK reserved, %luK > cma-reserved" > #ifdef    CONFIG_HIGHMEM >         ", %luK highmem" > #endif >         "%s%s)\n", >         nr_free_pages() << (PAGE_SHIFT - 10), >         physpages << (PAGE_SHIFT - 10), >         codesize >> 10, datasize >> 10, rosize >> 10, >         (init_data_size + init_code_size) >> 10, bss_size >> 10, >         (physpages - totalram_pages() - totalcma_pages) << (PAGE_SHIFT > - 10), >         totalcma_pages << (PAGE_SHIFT - 10), > #ifdef    CONFIG_HIGHMEM >         totalhigh_pages() << (PAGE_SHIFT - 10), > #endif >         str ? ", " : "", str ? str : ""); oh,   I send a bad version,firstly I want to split two patches, one for function move, one for function change. sorry, please ignore it, thanks for your remind. > > > Christophe > . >