lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202205071746.wrApww8H-lkp@intel.com>
Date:   Sat, 7 May 2022 17:57:21 +0800
From:   kernel test robot <lkp@...el.com>
To:     Will Deacon <will@...nel.org>
Cc:     kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org
Subject: arch/arm64/kernel/proton-pack.c:302:5: warning: Redundant assignment
 of 'cb' to itself. [selfAssignment]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   4b97bac0756a81cda5afd45417a99b5bccdcff67
commit: ea8f8c99a28199f6e067581b8626d192b07750f2 arm64: spectre-v2: Favour CPU-specific mitigation at EL2
date:   1 year, 7 months ago
compiler: aarch64-linux-gcc (GCC) 11.3.0
reproduce (cppcheck warning):
        # apt-get install cppcheck
        git checkout ea8f8c99a28199f6e067581b8626d192b07750f2
        cppcheck --quiet --enable=style,performance,portability --template=gcc FILE

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@...el.com>


cppcheck warnings: (new ones prefixed by >>)
>> arch/arm64/kernel/proton-pack.c:302:5: warning: Redundant assignment of 'cb' to itself. [selfAssignment]
    cb = spectre_v2_get_sw_mitigation_cb() ?: cb;
       ^

vim +/cb +302 arch/arm64/kernel/proton-pack.c

   272	
   273	static enum mitigation_state spectre_v2_enable_fw_mitigation(void)
   274	{
   275		bp_hardening_cb_t cb;
   276		enum mitigation_state state;
   277	
   278		state = spectre_v2_get_cpu_fw_mitigation_state();
   279		if (state != SPECTRE_MITIGATED)
   280			return state;
   281	
   282		if (spectre_v2_mitigations_off())
   283			return SPECTRE_VULNERABLE;
   284	
   285		switch (arm_smccc_1_1_get_conduit()) {
   286		case SMCCC_CONDUIT_HVC:
   287			cb = call_hvc_arch_workaround_1;
   288			break;
   289	
   290		case SMCCC_CONDUIT_SMC:
   291			cb = call_smc_arch_workaround_1;
   292			break;
   293	
   294		default:
   295			return SPECTRE_VULNERABLE;
   296		}
   297	
   298		/*
   299		 * Prefer a CPU-specific workaround if it exists. Note that we
   300		 * still rely on firmware for the mitigation at EL2.
   301		 */
 > 302		cb = spectre_v2_get_sw_mitigation_cb() ?: cb;
   303		install_bp_hardening_cb(cb);
   304		return SPECTRE_MITIGATED;
   305	}
   306	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ