[arm-platforms:kvm-arm64/nv-6.8-nv2-only 3/50] arch/arm64/kernel/cpufeature.c:2084:10: warning: use of bitwise '|' with boolean operands

kernel test robot lkp at intel.com
Tue Nov 21 07:57:09 PST 2023


tree:   https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms.git kvm-arm64/nv-6.8-nv2-only
head:   759d2e18f8954f4c76eb1772f38301df6ed8fa5d
commit: 05f8126eff48f8833c39f3dfbd7124047fc9af98 [3/50] arm64: cpufeatures: Restrict NV support to FEAT_NV2
config: arm64-allmodconfig (https://download.01.org/0day-ci/archive/20231121/202311212300.V9r9WIaO-lkp@intel.com/config)
compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project.git 4a5ac14ee968ff0ad5d2cc1ffa0299048db4c88a)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231121/202311212300.V9r9WIaO-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 <lkp at intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202311212300.V9r9WIaO-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> arch/arm64/kernel/cpufeature.c:2084:10: warning: use of bitwise '|' with boolean operands [-Wbitwise-instead-of-logical]
    2084 |         return (__system_matches_cap(ARM64_HAS_NV2) |
         |                ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         |                                                     ||
    2085 |                 __system_matches_cap(ARM64_HAS_NV2_ONLY));
         |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/arm64/kernel/cpufeature.c:2084:10: note: cast one or both operands to int to silence this warning
   1 warning generated.


vim +2084 arch/arm64/kernel/cpufeature.c

  2077	
  2078	static bool has_nested_virt_support(const struct arm64_cpu_capabilities *cap,
  2079					    int scope)
  2080	{
  2081		if (kvm_get_mode() != KVM_MODE_NV)
  2082			return false;
  2083	
> 2084		return (__system_matches_cap(ARM64_HAS_NV2) |
  2085			__system_matches_cap(ARM64_HAS_NV2_ONLY));
  2086	}
  2087	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki



More information about the linux-arm-kernel mailing list