From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4A7F6188596 for ; Mon, 15 Sep 2025 00:22:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.19 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757895749; cv=none; b=ab74v3w7VMsLhfxvqESPnaotLDzGVR8vxwVNkmpaQiZG4+CYXryWkFFAKj3eOHcPEhq71hN+vRK0eVmOloPNdnOLVYXUSMl6hWpBFbC0hpKjx02JadImgHgI6Yj6l3sK6aD98Kc8ETLtxn5n0kLYZfwQO0DJ6o4iJkuBRABhYZc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757895749; c=relaxed/simple; bh=daskcL1DBE9skT9uV5er232gQPyoP3/nFwpCEsBX2us=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=DcKMV89mLHMQv8VG59g3xbOAIQe/ahW+B15tKszLPYrdMgdl1qnmc0Sn8TmwMOxViIF0rlcbeU7ToCAOzaCHnOj7s2HokuKkfvLWGmzr/cnxnL/JKECAqpLnXZRDyisz6pZ9oJq3nR6YOtEdjHOtpNlGlKLkVNb4pdjhCZ0ReJQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=bi9xPZ7s; arc=none smtp.client-ip=198.175.65.19 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="bi9xPZ7s" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1757895747; x=1789431747; h=date:from:to:cc:subject:message-id:mime-version; bh=daskcL1DBE9skT9uV5er232gQPyoP3/nFwpCEsBX2us=; b=bi9xPZ7sDdBOzAvn26GZsp4T4/QhL73DwVBl5jR0U1qYoF/wsUo54/H5 zB/rzazaMcHpnHYxLi+jleUCwcXruiI67+IvxeIERESjDiciFJr1ANMZu NlnrcMx+jYCTct2ZwLi3yu3SlMpR+kS+/5efK0iqyY4acUzV7x4FMxDZv y0tPynQrjQEQn87wr0dpHBnJ7Ndydaoo0x6X5whbBKy2lpoAF+BbLpPT3 xUYQ/273ZTMTAjzfodJ5lcsZGNVM/WWw0oM/5i/q6BJlT0v/e/WP1wULs pGgkcsgV7WLZobdMCFe6zBaGtLcIE8st2oF2fzKs30NNO4l3MPxGYFjtA g==; X-CSE-ConnectionGUID: ghtQTqEbTkCbVm1PgZ2jcg== X-CSE-MsgGUID: NA93pQFZR3+t+5BX7w4sug== X-IronPort-AV: E=McAfee;i="6800,10657,11553"; a="60014645" X-IronPort-AV: E=Sophos;i="6.18,265,1751266800"; d="scan'208";a="60014645" Received: from fmviesa006.fm.intel.com ([10.60.135.146]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Sep 2025 17:22:27 -0700 X-CSE-ConnectionGUID: Cpw/9oaZTbK0oSFRIUR0aQ== X-CSE-MsgGUID: k57RiySrQVC1VGkYgCHb1g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.18,265,1751266800"; d="scan'208";a="174407368" Received: from lkp-server02.sh.intel.com (HELO eb5fdfb2a9b7) ([10.239.97.151]) by fmviesa006.fm.intel.com with ESMTP; 14 Sep 2025 17:22:24 -0700 Received: from kbuild by eb5fdfb2a9b7 with local (Exim 4.96) (envelope-from ) id 1uxwz1-0002pK-1s; Mon, 15 Sep 2025 00:22:17 +0000 Date: Mon, 15 Sep 2025 08:21:26 +0800 From: kernel test robot To: Jason Gunthorpe Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org, linux-snps-arc@lists.infradead.org, Vineet Gupta Subject: include/linux/atomic/atomic-arch-fallback.h:4152:16: sparse: sparse: cast truncates bits from constant value (deadbeefdeafcafe becomes deafcafe) Message-ID: <202509150854.HNDpg5I4-lkp@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: f83ec76bf285bea5727f478a68b894f5543ca76e commit: ea7caffedd011f7d40abe93a884ffbe46f122535 ARC: atomics: Implement arch_atomic64_cmpxchg using _relaxed date: 3 months ago config: arc-randconfig-r112-20250915 (https://download.01.org/0day-ci/archive/20250915/202509150854.HNDpg5I4-lkp@intel.com/config) compiler: arc-linux-gcc (GCC) 11.5.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250915/202509150854.HNDpg5I4-lkp@intel.com/reproduce) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot | Closes: https://lore.kernel.org/oe-kbuild-all/202509150854.HNDpg5I4-lkp@intel.com/ sparse warnings: (new ones prefixed by >>) lib/atomic64_test.c: note: in included file (through include/linux/atomic.h, include/asm-generic/bitops/lock.h, arch/arc/include/asm/bitops.h, ...): include/linux/atomic/atomic-arch-fallback.h:4152:16: sparse: sparse: cast truncates bits from constant value (aaa31337c001d00d becomes c001d00d) >> include/linux/atomic/atomic-arch-fallback.h:4152:16: sparse: sparse: cast truncates bits from constant value (deadbeefdeafcafe becomes deafcafe) include/linux/atomic/atomic-arch-fallback.h:4181:16: sparse: sparse: cast truncates bits from constant value (aaa31337c001d00d becomes c001d00d) include/linux/atomic/atomic-arch-fallback.h:4181:16: sparse: sparse: cast truncates bits from constant value (deadbeefdeafcafe becomes deafcafe) include/linux/atomic/atomic-arch-fallback.h:4209:16: sparse: sparse: cast truncates bits from constant value (aaa31337c001d00d becomes c001d00d) include/linux/atomic/atomic-arch-fallback.h:4209:16: sparse: sparse: cast truncates bits from constant value (deadbeefdeafcafe becomes deafcafe) include/linux/atomic/atomic-arch-fallback.h:4234:16: sparse: sparse: cast truncates bits from constant value (aaa31337c001d00d becomes c001d00d) include/linux/atomic/atomic-arch-fallback.h:4234:16: sparse: sparse: cast truncates bits from constant value (deadbeefdeafcafe becomes deafcafe) include/linux/atomic/atomic-arch-fallback.h:4152:16: sparse: sparse: cast truncates bits from constant value (faceabadf00df001 becomes f00df001) >> include/linux/atomic/atomic-arch-fallback.h:4152:16: sparse: sparse: cast truncates bits from constant value (deadbeefdeafcafe becomes deafcafe) include/linux/atomic/atomic-arch-fallback.h:4181:16: sparse: sparse: cast truncates bits from constant value (faceabadf00df001 becomes f00df001) include/linux/atomic/atomic-arch-fallback.h:4181:16: sparse: sparse: cast truncates bits from constant value (deadbeefdeafcafe becomes deafcafe) include/linux/atomic/atomic-arch-fallback.h:4209:16: sparse: sparse: cast truncates bits from constant value (faceabadf00df001 becomes f00df001) include/linux/atomic/atomic-arch-fallback.h:4209:16: sparse: sparse: cast truncates bits from constant value (deadbeefdeafcafe becomes deafcafe) include/linux/atomic/atomic-arch-fallback.h:4234:16: sparse: sparse: cast truncates bits from constant value (faceabadf00df001 becomes f00df001) include/linux/atomic/atomic-arch-fallback.h:4234:16: sparse: sparse: cast truncates bits from constant value (deadbeefdeafcafe becomes deafcafe) vim +4152 include/linux/atomic/atomic-arch-fallback.h 37f8173dd84936 include/linux/atomic-arch-fallback.h Peter Zijlstra 2020-01-24 4126 ad8110706f3811 include/linux/atomic/atomic-arch-fallback.h Mark Rutland 2023-06-05 4127 /** ad8110706f3811 include/linux/atomic/atomic-arch-fallback.h Mark Rutland 2023-06-05 4128 * raw_atomic64_cmpxchg() - atomic compare and exchange with full ordering ad8110706f3811 include/linux/atomic/atomic-arch-fallback.h Mark Rutland 2023-06-05 4129 * @v: pointer to atomic64_t ad8110706f3811 include/linux/atomic/atomic-arch-fallback.h Mark Rutland 2023-06-05 4130 * @old: s64 value to compare with ad8110706f3811 include/linux/atomic/atomic-arch-fallback.h Mark Rutland 2023-06-05 4131 * @new: s64 value to assign ad8110706f3811 include/linux/atomic/atomic-arch-fallback.h Mark Rutland 2023-06-05 4132 * ad8110706f3811 include/linux/atomic/atomic-arch-fallback.h Mark Rutland 2023-06-05 4133 * If (@v == @old), atomically updates @v to @new with full ordering. 6dfee110c6cc7a include/linux/atomic/atomic-arch-fallback.h Mark Rutland 2024-02-09 4134 * Otherwise, @v is not modified and relaxed ordering is provided. ad8110706f3811 include/linux/atomic/atomic-arch-fallback.h Mark Rutland 2023-06-05 4135 * ad8110706f3811 include/linux/atomic/atomic-arch-fallback.h Mark Rutland 2023-06-05 4136 * Safe to use in noinstr code; prefer atomic64_cmpxchg() elsewhere. ad8110706f3811 include/linux/atomic/atomic-arch-fallback.h Mark Rutland 2023-06-05 4137 * ad8110706f3811 include/linux/atomic/atomic-arch-fallback.h Mark Rutland 2023-06-05 4138 * Return: The original value of @v. ad8110706f3811 include/linux/atomic/atomic-arch-fallback.h Mark Rutland 2023-06-05 4139 */ 37f8173dd84936 include/linux/atomic-arch-fallback.h Peter Zijlstra 2020-01-24 4140 static __always_inline s64 9257959a6e5b4f include/linux/atomic/atomic-arch-fallback.h Mark Rutland 2023-06-05 4141 raw_atomic64_cmpxchg(atomic64_t *v, s64 old, s64 new) 37f8173dd84936 include/linux/atomic-arch-fallback.h Peter Zijlstra 2020-01-24 4142 { 1d78814d41701c include/linux/atomic/atomic-arch-fallback.h Mark Rutland 2023-06-05 4143 #if defined(arch_atomic64_cmpxchg) 1d78814d41701c include/linux/atomic/atomic-arch-fallback.h Mark Rutland 2023-06-05 4144 return arch_atomic64_cmpxchg(v, old, new); 1d78814d41701c include/linux/atomic/atomic-arch-fallback.h Mark Rutland 2023-06-05 4145 #elif defined(arch_atomic64_cmpxchg_relaxed) 37f8173dd84936 include/linux/atomic-arch-fallback.h Peter Zijlstra 2020-01-24 4146 s64 ret; 37f8173dd84936 include/linux/atomic-arch-fallback.h Peter Zijlstra 2020-01-24 4147 __atomic_pre_full_fence(); 9257959a6e5b4f include/linux/atomic/atomic-arch-fallback.h Mark Rutland 2023-06-05 4148 ret = arch_atomic64_cmpxchg_relaxed(v, old, new); 37f8173dd84936 include/linux/atomic-arch-fallback.h Peter Zijlstra 2020-01-24 4149 __atomic_post_full_fence(); 37f8173dd84936 include/linux/atomic-arch-fallback.h Peter Zijlstra 2020-01-24 4150 return ret; 9257959a6e5b4f include/linux/atomic/atomic-arch-fallback.h Mark Rutland 2023-06-05 4151 #else 9257959a6e5b4f include/linux/atomic/atomic-arch-fallback.h Mark Rutland 2023-06-05 @4152 return raw_cmpxchg(&v->counter, old, new); d12157efc8e083 include/linux/atomic/atomic-arch-fallback.h Mark Rutland 2023-06-05 4153 #endif 1d78814d41701c include/linux/atomic/atomic-arch-fallback.h Mark Rutland 2023-06-05 4154 } d12157efc8e083 include/linux/atomic/atomic-arch-fallback.h Mark Rutland 2023-06-05 4155 :::::: The code at line 4152 was first introduced by commit :::::: 9257959a6e5b4fca6fc8e985790bff62c2046f20 locking/atomic: scripts: restructure fallback ifdeffery :::::: TO: Mark Rutland :::::: CC: Peter Zijlstra -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki