From mboxrd@z Thu Jan 1 00:00:00 1970 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=-10.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 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 4E893C07E99 for ; Mon, 12 Jul 2021 09:27:22 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id F200E6100B for ; Mon, 12 Jul 2021 09:27:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F200E6100B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id F1EBF6B008A; Mon, 12 Jul 2021 05:27:21 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EA7F06B008C; Mon, 12 Jul 2021 05:27:21 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D21AB8D0001; Mon, 12 Jul 2021 05:27:21 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0151.hostedemail.com [216.40.44.151]) by kanga.kvack.org (Postfix) with ESMTP id A49926B008A for ; Mon, 12 Jul 2021 05:27:21 -0400 (EDT) Received: from smtpin16.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id B2595184B40D5 for ; Mon, 12 Jul 2021 09:27:20 +0000 (UTC) X-FDA: 78353407440.16.C0FE02F Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by imf05.hostedemail.com (Postfix) with ESMTP id 10FB15019364 for ; Mon, 12 Jul 2021 09:27:17 +0000 (UTC) X-IronPort-AV: E=McAfee;i="6200,9189,10042"; a="189632303" X-IronPort-AV: E=Sophos;i="5.84,232,1620716400"; d="scan'208";a="189632303" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jul 2021 02:27:15 -0700 X-IronPort-AV: E=Sophos;i="5.84,232,1620716400"; d="scan'208";a="502066557" Received: from shao2-debian.sh.intel.com (HELO localhost) ([10.239.13.11]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jul 2021 02:27:14 -0700 Date: Mon, 12 Jul 2021 17:27:12 +0800 From: kernel test robot To: Mike Rapoport Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org, Andrew Morton , Linux Memory Management List Subject: arch/nds32/kernel/setup.c:247:26: warning: Unused variable: region [unusedVariable] Message-ID: <20210712092712.GQ2022171@shao2-debian> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) Authentication-Results: imf05.hostedemail.com; dkim=none; spf=none (imf05.hostedemail.com: domain of rong.a.chen@intel.com has no SPF policy when checking 192.55.52.136) smtp.mailfrom=rong.a.chen@intel.com; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=intel.com (policy=none) X-Rspamd-Server: rspam02 X-Stat-Signature: sc5149su3gwk1bwhu78iwjeiiqn7zxs4 X-Rspamd-Queue-Id: 10FB15019364 X-HE-Tag: 1626082037-224197 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: tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: 50be9417e23af5a8ac860d998e1e3f06b8fd79d7 commit: 80c4574417ae42fe2ba6978772854dc67cfc5331 h8300, nds32, openrisc: simplify detection of memory extents date: 9 months ago compiler: nds32le-linux-gcc (GCC) 9.3.0 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot cppcheck possible warnings: (new ones prefixed by >>, may not real problems) >> arch/nds32/kernel/setup.c:247:26: warning: Unused variable: region [unusedVariable] struct memblock_region *region; ^ vim +247 arch/nds32/kernel/setup.c 001d953ede35df Greentime Hu 2017-10-24 241 001d953ede35df Greentime Hu 2017-10-24 242 static void __init setup_memory(void) 001d953ede35df Greentime Hu 2017-10-24 243 { 001d953ede35df Greentime Hu 2017-10-24 244 unsigned long ram_start_pfn; 001d953ede35df Greentime Hu 2017-10-24 245 unsigned long free_ram_start_pfn; 001d953ede35df Greentime Hu 2017-10-24 246 phys_addr_t memory_start, memory_end; 001d953ede35df Greentime Hu 2017-10-24 @247 struct memblock_region *region; 001d953ede35df Greentime Hu 2017-10-24 248 001d953ede35df Greentime Hu 2017-10-24 249 memory_end = memory_start = 0; 001d953ede35df Greentime Hu 2017-10-24 250 001d953ede35df Greentime Hu 2017-10-24 251 /* Find main memory where is the kernel */ 80c4574417ae42 Mike Rapoport 2020-10-13 252 memory_start = memblock_start_of_DRAM(); 80c4574417ae42 Mike Rapoport 2020-10-13 253 memory_end = memblock_end_of_DRAM(); 001d953ede35df Greentime Hu 2017-10-24 254 001d953ede35df Greentime Hu 2017-10-24 255 if (!memory_end) { 001d953ede35df Greentime Hu 2017-10-24 256 panic("No memory!"); 001d953ede35df Greentime Hu 2017-10-24 257 } 001d953ede35df Greentime Hu 2017-10-24 258 001d953ede35df Greentime Hu 2017-10-24 259 ram_start_pfn = PFN_UP(memblock_start_of_DRAM()); 001d953ede35df Greentime Hu 2017-10-24 260 /* free_ram_start_pfn is first page after kernel */ 001d953ede35df Greentime Hu 2017-10-24 261 free_ram_start_pfn = PFN_UP(__pa(&_end)); 001d953ede35df Greentime Hu 2017-10-24 262 max_pfn = PFN_DOWN(memblock_end_of_DRAM()); 001d953ede35df Greentime Hu 2017-10-24 263 /* it could update max_pfn */ 001d953ede35df Greentime Hu 2017-10-24 264 if (max_pfn - ram_start_pfn <= MAXMEM_PFN) 001d953ede35df Greentime Hu 2017-10-24 265 max_low_pfn = max_pfn; 001d953ede35df Greentime Hu 2017-10-24 266 else { 001d953ede35df Greentime Hu 2017-10-24 267 max_low_pfn = MAXMEM_PFN + ram_start_pfn; 001d953ede35df Greentime Hu 2017-10-24 268 if (!IS_ENABLED(CONFIG_HIGHMEM)) 001d953ede35df Greentime Hu 2017-10-24 269 max_pfn = MAXMEM_PFN + ram_start_pfn; 001d953ede35df Greentime Hu 2017-10-24 270 } 001d953ede35df Greentime Hu 2017-10-24 271 /* high_memory is related with VMALLOC */ 001d953ede35df Greentime Hu 2017-10-24 272 high_memory = (void *)__va(max_low_pfn * PAGE_SIZE); 001d953ede35df Greentime Hu 2017-10-24 273 min_low_pfn = free_ram_start_pfn; 001d953ede35df Greentime Hu 2017-10-24 274 001d953ede35df Greentime Hu 2017-10-24 275 /* 001d953ede35df Greentime Hu 2017-10-24 276 * initialize the boot-time allocator (with low memory only). 001d953ede35df Greentime Hu 2017-10-24 277 * 001d953ede35df Greentime Hu 2017-10-24 278 * This makes the memory from the end of the kernel to the end of 001d953ede35df Greentime Hu 2017-10-24 279 * RAM usable. 001d953ede35df Greentime Hu 2017-10-24 280 */ 001d953ede35df Greentime Hu 2017-10-24 281 memblock_set_bottom_up(true); 001d953ede35df Greentime Hu 2017-10-24 282 memblock_reserve(PFN_PHYS(ram_start_pfn), PFN_PHYS(free_ram_start_pfn - ram_start_pfn)); 001d953ede35df Greentime Hu 2017-10-24 283 001d953ede35df Greentime Hu 2017-10-24 284 early_init_fdt_reserve_self(); 001d953ede35df Greentime Hu 2017-10-24 285 early_init_fdt_scan_reserved_mem(); 001d953ede35df Greentime Hu 2017-10-24 286 001d953ede35df Greentime Hu 2017-10-24 287 memblock_dump_all(); 001d953ede35df Greentime Hu 2017-10-24 288 } 001d953ede35df Greentime Hu 2017-10-24 289 :::::: The code at line 247 was first introduced by commit :::::: 001d953ede35dfb135e636af4b41d5dd20a09471 nds32: Kernel booting and initialization :::::: TO: Greentime Hu :::::: CC: Greentime Hu --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org