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 3E1EAC07E99 for ; Mon, 12 Jul 2021 19:20:10 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id DE91D610FA for ; Mon, 12 Jul 2021 19:20:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DE91D610FA 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 E8BD16B0011; Mon, 12 Jul 2021 15:20:09 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E62466B0095; Mon, 12 Jul 2021 15:20:09 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D03BC8D0003; Mon, 12 Jul 2021 15:20:09 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0089.hostedemail.com [216.40.44.89]) by kanga.kvack.org (Postfix) with ESMTP id AAA1B6B0011 for ; Mon, 12 Jul 2021 15:20:09 -0400 (EDT) Received: from smtpin35.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 893462775E for ; Mon, 12 Jul 2021 19:20:08 +0000 (UTC) X-FDA: 78354901296.35.704574D Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by imf14.hostedemail.com (Postfix) with ESMTP id EECBE60019A6 for ; Mon, 12 Jul 2021 19:20:05 +0000 (UTC) X-IronPort-AV: E=McAfee;i="6200,9189,10043"; a="208224209" X-IronPort-AV: E=Sophos;i="5.84,234,1620716400"; d="scan'208";a="208224209" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jul 2021 12:20:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.84,234,1620716400"; d="scan'208";a="648355969" Received: from lkp-server01.sh.intel.com (HELO 4aae0cb4f5b5) ([10.239.97.150]) by fmsmga006.fm.intel.com with ESMTP; 12 Jul 2021 12:19:59 -0700 Received: from kbuild by 4aae0cb4f5b5 with local (Exim 4.92) (envelope-from ) id 1m31TC-000HCR-DH; Mon, 12 Jul 2021 19:19:58 +0000 Date: Tue, 13 Jul 2021 03:19:06 +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: mm/sparse.c:145:2: warning: int result is returned as long value. If the return value is long to avoid loss of information, then you have loss of information. [truncLongCastReturn] Message-ID: <202107130348.6LsVT9Nc-lkp@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) Authentication-Results: imf14.hostedemail.com; dkim=none; spf=none (imf14.hostedemail.com: domain of lkp@intel.com has no SPF policy when checking 192.55.52.120) smtp.mailfrom=lkp@intel.com; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=intel.com (policy=none) X-Rspamd-Server: rspam05 X-Stat-Signature: a6typqfns944bcd4royur1rqirjsirqb X-Rspamd-Queue-Id: EECBE60019A6 X-HE-Tag: 1626117605-426177 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: e73f0f0ee7541171d89f2e2491130c7771ba58d3 commit: 36d40290c8f71daf1ba5567ab14574f36b9b8d6a alpha: switch from DISCONTIGMEM to SPARSEMEM date: 7 months ago compiler: alpha-linux-gcc (GCC) 9.3.0 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot cppcheck warnings: (new ones prefixed by >>) >> mm/sparse.c:145:2: warning: int result is returned as long value. If the return value is long to avoid loss of information, then you have loss of information. [truncLongCastReturn] return (nid << SECTION_NID_SHIFT); ^ vim +145 mm/sparse.c 4ca644d970bf25 Dave Hansen 2005-10-29 136 30c253e6da655d Andy Whitcroft 2006-06-23 137 /* 30c253e6da655d Andy Whitcroft 2006-06-23 138 * During early boot, before section_mem_map is used for an actual 30c253e6da655d Andy Whitcroft 2006-06-23 139 * mem_map, we use section_mem_map to store the section's NUMA 30c253e6da655d Andy Whitcroft 2006-06-23 140 * node. This keeps us from having to use another data structure. The 30c253e6da655d Andy Whitcroft 2006-06-23 141 * node information is cleared just before we store the real mem_map. 30c253e6da655d Andy Whitcroft 2006-06-23 142 */ 30c253e6da655d Andy Whitcroft 2006-06-23 143 static inline unsigned long sparse_encode_early_nid(int nid) 30c253e6da655d Andy Whitcroft 2006-06-23 144 { 30c253e6da655d Andy Whitcroft 2006-06-23 @145 return (nid << SECTION_NID_SHIFT); 30c253e6da655d Andy Whitcroft 2006-06-23 146 } 30c253e6da655d Andy Whitcroft 2006-06-23 147 :::::: The code at line 145 was first introduced by commit :::::: 30c253e6da655d73eb8bfe2adca9b8f4d82fb81e [PATCH] sparsemem: record nid during memory present :::::: TO: Andy Whitcroft :::::: CC: Linus Torvalds --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org