* arch/powerpc/perf/core-book3s.c:2474:10: warning: Using pointer that is a temporary. [danglingTemporaryLifetime]
@ 2022-11-10 13:25 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2022-11-10 13:25 UTC (permalink / raw)
To: oe-kbuild; +Cc: lkp
::::::
:::::: Manual check reason: "low confidence static check warning: arch/powerpc/perf/core-book3s.c:2474:10: warning: Using pointer that is a temporary. [danglingTemporaryLifetime]"
::::::
BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
CC: linux-kernel@vger.kernel.org
TO: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
CC: Michael Ellerman <mpe@ellerman.id.au>
CC: Nicholas Piggin <npiggin@gmail.com>
Hi Athira,
First bad commit (maybe != root cause):
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: f67dd6ce0723ad013395f20a3f79d8a437d3f455
commit: 429a64f6e91fbfe4912d17247c27d0d66767b1c2 powerpc/perf: Only define power_pmu_wants_prompt_pmi() for CONFIG_PPC64
date: 10 months ago
:::::: branch date: 16 hours ago
:::::: commit date: 10 months ago
compiler: powerpc-linux-gcc (GCC) 12.1.0
reproduce (cppcheck warning):
# apt-get install cppcheck
git checkout 429a64f6e91fbfe4912d17247c27d0d66767b1c2
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 possible warnings: (new ones prefixed by >>, may not real problems)
>> arch/powerpc/perf/core-book3s.c:2474:10: warning: Using pointer that is a temporary. [danglingTemporaryLifetime]
memset(cpuhw, 0, sizeof(*cpuhw));
^
arch/powerpc/perf/core-book3s.c:2471:32: note: Address of variable taken here.
struct cpu_hw_events *cpuhw = &per_cpu(cpu_hw_events, cpu);
^
arch/powerpc/perf/core-book3s.c:2471:40: note: Temporary created here.
struct cpu_hw_events *cpuhw = &per_cpu(cpu_hw_events, cpu);
^
arch/powerpc/perf/core-book3s.c:2474:10: note: Using pointer that is a temporary.
memset(cpuhw, 0, sizeof(*cpuhw));
^
arch/powerpc/perf/core-book3s.c:2475:3: warning: Using pointer that is a temporary. [danglingTemporaryLifetime]
cpuhw->mmcr.mmcr0 = MMCR0_FC;
^
arch/powerpc/perf/core-book3s.c:2471:32: note: Address of variable taken here.
struct cpu_hw_events *cpuhw = &per_cpu(cpu_hw_events, cpu);
^
arch/powerpc/perf/core-book3s.c:2471:40: note: Temporary created here.
struct cpu_hw_events *cpuhw = &per_cpu(cpu_hw_events, cpu);
^
arch/powerpc/perf/core-book3s.c:2475:3: note: Using pointer that is a temporary.
cpuhw->mmcr.mmcr0 = MMCR0_FC;
^
>> arch/powerpc/perf/core-book3s.c:1331:62: warning: Operator '|' with one operand equal to zero is redundant. [badBitmaskCheck]
val &= ~(MMCR0_EBE | MMCR0_BHRBA | MMCR0_PMCC | MMCR0_PMAO |
^
vim +2474 arch/powerpc/perf/core-book3s.c
0c9108b0837063 arch/powerpc/perf/core-book3s.c Ravi Bangoria 2018-11-21 2468
7c98bd72081c44 arch/powerpc/perf/core-book3s.c Daniel Axtens 2016-09-06 2469 static int power_pmu_prepare_cpu(unsigned int cpu)
01d0287f068de2 arch/powerpc/kernel/perf_counter.c Paul Mackerras 2009-01-14 2470 {
cdd6c482c9ff9c arch/powerpc/kernel/perf_event.c Ingo Molnar 2009-09-21 2471 struct cpu_hw_events *cpuhw = &per_cpu(cpu_hw_events, cpu);
01d0287f068de2 arch/powerpc/kernel/perf_counter.c Paul Mackerras 2009-01-14 2472
57ecde42cc7493 arch/powerpc/perf/core-book3s.c Thomas Gleixner 2016-07-13 2473 if (ppmu) {
01d0287f068de2 arch/powerpc/kernel/perf_counter.c Paul Mackerras 2009-01-14 @2474 memset(cpuhw, 0, sizeof(*cpuhw));
78d76819e6f046 arch/powerpc/perf/core-book3s.c Athira Rajeev 2020-07-17 2475 cpuhw->mmcr.mmcr0 = MMCR0_FC;
01d0287f068de2 arch/powerpc/kernel/perf_counter.c Paul Mackerras 2009-01-14 2476 }
57ecde42cc7493 arch/powerpc/perf/core-book3s.c Thomas Gleixner 2016-07-13 2477 return 0;
3f6da390539882 arch/powerpc/kernel/perf_event.c Peter Zijlstra 2010-03-05 2478 }
3f6da390539882 arch/powerpc/kernel/perf_event.c Peter Zijlstra 2010-03-05 2479
:::::: The code at line 2474 was first introduced by commit
:::::: 01d0287f068de2934109ba9b989d8807526cccc2 powerpc/perf_counter: Make sure PMU gets enabled properly
:::::: TO: Paul Mackerras <paulus@samba.org>
:::::: CC: Paul Mackerras <paulus@samba.org>
--
0-DAY CI Kernel Test Service
https://01.org/lkp
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-11-10 13:26 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-10 13:25 arch/powerpc/perf/core-book3s.c:2474:10: warning: Using pointer that is a temporary. [danglingTemporaryLifetime] kernel test robot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.