From: kernel test robot <lkp@intel.com>
To: Will Deacon <will@kernel.org>
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org
Subject: arch/arm64/kernel/proton-pack.c:302:5: warning: Redundant assignment of 'cb' to itself. [selfAssignment]
Date: Fri, 3 Jun 2022 03:50:00 +0800 [thread overview]
Message-ID: <202206030359.rPhMZQTy-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 17d8e3d90b6989419806c1926b894d7d7483a25b
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 where applicable
Reported-by: kernel test robot <lkp@intel.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;
^
cppcheck possible warnings: (new ones prefixed by >>, may not real problems)
>> arch/arm64/mm/hugetlbpage.c:104:14: warning: Parameter 'ptep' can be declared with const [constParameter]
pte_t *ptep, size_t *pgsize)
^
--
>> arch/arm64/mm/mmu.c:558:74: warning: Parameter 'va_end' can be declared with const [constParameter]
static void __init map_kernel_segment(pgd_t *pgdp, void *va_start, void *va_end,
^
>> arch/arm64/mm/mmu.c:1441:41: warning: Parameter 'pgdir' can be declared with const [constParameter]
static void __remove_pgd_mapping(pgd_t *pgdir, unsigned long start, u64 size)
^
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
next reply other threads:[~2022-06-02 19:51 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-02 19:50 kernel test robot [this message]
-- strict thread matches above, loose matches on Subject: below --
2022-05-07 9:57 arch/arm64/kernel/proton-pack.c:302:5: warning: Redundant assignment of 'cb' to itself. [selfAssignment] kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202206030359.rPhMZQTy-lkp@intel.com \
--to=lkp@intel.com \
--cc=kbuild-all@lists.01.org \
--cc=linux-kernel@vger.kernel.org \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox