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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 59B7AC433EF for ; Sat, 26 Feb 2022 19:15:13 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 609AE8D0002; Sat, 26 Feb 2022 14:15:12 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 5B9998D0001; Sat, 26 Feb 2022 14:15:12 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 480658D0002; Sat, 26 Feb 2022 14:15:12 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0205.hostedemail.com [216.40.44.205]) by kanga.kvack.org (Postfix) with ESMTP id 352E68D0001 for ; Sat, 26 Feb 2022 14:15:12 -0500 (EST) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id A2D411819540C for ; Sat, 26 Feb 2022 19:15:11 +0000 (UTC) X-FDA: 79185884022.22.C2A239B Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by imf23.hostedemail.com (Postfix) with ESMTP id 24989140005 for ; Sat, 26 Feb 2022 19:15:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1645902910; x=1677438910; h=date:from:to:cc:subject:message-id:mime-version; bh=ZilLojZSqZ0LDXpttJlXq9ljHxiLl/YXESxq3/s2aZ0=; b=SmVRtUwcv5x3gyc+zqGugJePGVcnsmNuqf/VxpipcrjbICPUFxabBtq5 qtu8YWaMCc3lvXNwUWy0PutqMdCn8xGKwjppVLQUg/w88zMuEMko+U2ML vymPpmHjP2dzklgNKorRNN+ZYlnGJxx6rFl8FcY+uVXnTvDjav1CMg9Wl c8LTkDT40hR81nIglhr923noQcG/q1Ociw9AGkp1LCAIu8dZXgPOFrAo9 IgPAtYT+QBGsDUCF277NWUrodpbxb4Y3TBr74MiN3DZFhKZp44q4/91HQ MFaHOrUPvRXpPlLmubZgFy9gLTIaZ1CctyvmhAAOS4XuDA3sqSRaGT0Qm A==; X-IronPort-AV: E=McAfee;i="6200,9189,10270"; a="252871361" X-IronPort-AV: E=Sophos;i="5.90,139,1643702400"; d="scan'208";a="252871361" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Feb 2022 11:15:08 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,139,1643702400"; d="scan'208";a="544346633" Received: from lkp-server01.sh.intel.com (HELO 788b1cd46f0d) ([10.239.97.150]) by fmsmga007.fm.intel.com with ESMTP; 26 Feb 2022 11:15:06 -0800 Received: from kbuild by 788b1cd46f0d with local (Exim 4.92) (envelope-from ) id 1nO2X4-0005sQ-5e; Sat, 26 Feb 2022 19:15:06 +0000 Date: Sun, 27 Feb 2022 03:14:10 +0800 From: kernel test robot To: "Liam R. Howlett" Cc: llvm@lists.linux.dev, kbuild-all@lists.01.org, Linux Memory Management List , "Matthew Wilcox (Oracle)" Subject: [linux-next:master 8608/9128] lib/maple_tree.c:473:7: warning: variable 'shift' is used uninitialized whenever switch case is taken Message-ID: <202202262240.NbkCh7vR-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) X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 24989140005 X-Stat-Signature: o74t9pxrzzgf9yb9e8akm9gi6oznnno1 Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=SmVRtUwc; spf=none (imf23.hostedemail.com: domain of lkp@intel.com has no SPF policy when checking 192.55.52.115) smtp.mailfrom=lkp@intel.com; dmarc=pass (policy=none) header.from=intel.com X-Rspam-User: X-HE-Tag: 1645902909-717506 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000009, 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/next/linux-next.git master head: 06aeb1495c39c86ccfaf1adadc1d2200179f16eb commit: 564eadc47f5f72d5fc25b3740452e4fb61cf694e [8608/9128] Maple Tree: Add new data structure config: mips-buildonly-randconfig-r005-20220225 (https://download.01.org/0day-ci/archive/20220226/202202262240.NbkCh7vR-lkp@intel.com/config) compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project d271fc04d5b97b12e6b797c6067d3c96a8d7470e) reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # install mips cross compiling tool for clang build # apt-get install binutils-mips-linux-gnu # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=564eadc47f5f72d5fc25b3740452e4fb61cf694e git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git git fetch --no-tags linux-next master git checkout 564eadc47f5f72d5fc25b3740452e4fb61cf694e # save the config file to linux build tree mkdir build_dir COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=mips SHELL=/bin/bash If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot All warnings (new ones prefixed by >>): >> lib/maple_tree.c:473:7: warning: variable 'shift' is used uninitialized whenever switch case is taken [-Wsometimes-uninitialized] case maple_dense: ^~~~~~~~~~~ lib/maple_tree.c:480:18: note: uninitialized use occurs here val |= (slot << shift) | type; ^~~~~ lib/maple_tree.c:474:7: warning: variable 'shift' is used uninitialized whenever switch case is taken [-Wsometimes-uninitialized] case maple_leaf_64: ^~~~~~~~~~~~~ lib/maple_tree.c:480:18: note: uninitialized use occurs here val |= (slot << shift) | type; ^~~~~ lib/maple_tree.c:463:21: note: initialize the variable 'shift' to silence this warning unsigned long shift; ^ = 0 >> lib/maple_tree.c:473:7: warning: variable 'type' is used uninitialized whenever switch case is taken [-Wsometimes-uninitialized] case maple_dense: ^~~~~~~~~~~ lib/maple_tree.c:480:27: note: uninitialized use occurs here val |= (slot << shift) | type; ^~~~ lib/maple_tree.c:474:7: warning: variable 'type' is used uninitialized whenever switch case is taken [-Wsometimes-uninitialized] case maple_leaf_64: ^~~~~~~~~~~~~ lib/maple_tree.c:480:27: note: uninitialized use occurs here val |= (slot << shift) | type; ^~~~ lib/maple_tree.c:464:20: note: initialize the variable 'type' to silence this warning unsigned long type; ^ = 0 lib/maple_tree.c:5547:6: warning: no previous prototype for function 'mas_wr_store_setup' [-Wmissing-prototypes] void mas_wr_store_setup(struct ma_wr_state *wr_mas) ^ lib/maple_tree.c:5547:1: note: declare 'static' if the function is not intended to be used outside of this translation unit void mas_wr_store_setup(struct ma_wr_state *wr_mas) ^ static lib/maple_tree.c:6175:5: warning: no previous prototype for function 'mtree_alloc_range' [-Wmissing-prototypes] int mtree_alloc_range(struct maple_tree *mt, unsigned long *startp, ^ lib/maple_tree.c:6175:1: note: declare 'static' if the function is not intended to be used outside of this translation unit int mtree_alloc_range(struct maple_tree *mt, unsigned long *startp, ^ static lib/maple_tree.c:6210:5: warning: no previous prototype for function 'mtree_alloc_rrange' [-Wmissing-prototypes] int mtree_alloc_rrange(struct maple_tree *mt, unsigned long *startp, ^ lib/maple_tree.c:6210:1: note: declare 'static' if the function is not intended to be used outside of this translation unit int mtree_alloc_rrange(struct maple_tree *mt, unsigned long *startp, ^ static lib/maple_tree.c:76:28: warning: unused variable 'mt_max' [-Wunused-const-variable] static const unsigned long mt_max[] = { ^ lib/maple_tree.c:322:20: warning: unused function 'mte_set_full' [-Wunused-function] static inline void mte_set_full(const struct maple_enode *node) ^ lib/maple_tree.c:327:20: warning: unused function 'mte_clear_full' [-Wunused-function] static inline void mte_clear_full(const struct maple_enode *node) ^ lib/maple_tree.c:837:35: warning: unused function 'mas_get_slot' [-Wunused-function] static inline struct maple_enode *mas_get_slot(struct ma_state *mas, ^ lib/maple_tree.c:4599:19: warning: unused function 'mas_dead_node' [-Wunused-function] static inline int mas_dead_node(struct ma_state *mas, unsigned long index) ^ lib/maple_tree.c:4621:21: warning: unused function 'mas_first_entry' [-Wunused-function] static inline void *mas_first_entry(struct ma_state *mas, struct maple_node *mn, ^ 13 warnings generated. vim +/shift +473 lib/maple_tree.c 448 449 /* 450 * mte_set_parent() - Set the parent node and encode the slot 451 * @enode: The encoded maple node. 452 * @parent: The encoded maple node that is the parent of @enode. 453 * @slot: The slot that @enode resides in @parent. 454 * 455 * Slot number is encoded in the enode->parent bit 3-6 or 2-6, depending on the 456 * parent type. 457 */ 458 static inline 459 void mte_set_parent(struct maple_enode *enode, const struct maple_enode *parent, 460 unsigned char slot) 461 { 462 unsigned long val = (unsigned long) parent; 463 unsigned long shift; 464 unsigned long type; 465 enum maple_type p_type = mte_node_type(parent); 466 467 switch(p_type) { 468 case maple_range_64: 469 case maple_arange_64: 470 shift = MAPLE_PARENT_SLOT_SHIFT; 471 type = MAPLE_PARENT_RANGE64; 472 break; > 473 case maple_dense: 474 case maple_leaf_64: 475 BUG_ON(1); 476 break; 477 } 478 479 val &= ~MAPLE_NODE_MASK; /* Clear all node metadata in parent */ > 480 val |= (slot << shift) | type; 481 mte_to_node(enode)->parent = ma_parent_ptr(val); 482 } 483 --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org