mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kernel test robot <yujie.liu@intel.com>
To: Stephane Eranian <eranian@google.com>
Cc: <llvm@lists.linux.dev>, <kbuild-all@lists.01.org>,
	"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
	x86 <x86@kernel.org>
Subject: [tip:perf/core 3/10] arch/x86/events/amd/core.c:722:3: warning: Value stored to 'hwc' is never read [clang-analyzer-deadcode.DeadStores]
Date: Wed, 13 Apr 2022 16:43:38 +0800	[thread overview]
Message-ID: <5f198292-247a-e3bd-f3b2-0052d318fc20@intel.com> (raw)
In-Reply-To: <202204110431.SBvb4g5G-lkp@intel.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git perf/core
head:   7bebfe9dd802b80abff5a43e00ab68d98893a22c
commit: ada543459cab7f653dcacdaba4011a8bb19c627c [3/10] perf/x86/amd: Add AMD Fam19h Branch Sampling support
config: x86_64-randconfig-c007 (https://download.01.org/0day-ci/archive/20220411/202204110431.SBvb4g5G-lkp@intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project c29a51b3a257908aebc01cd7c4655665db317d66)
reproduce (this is a W=1 build):
         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
         chmod +x ~/bin/make.cross
         # https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/commit/?id=ada543459cab7f653dcacdaba4011a8bb19c627c
         git remote add tip https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git
         git fetch --no-tags tip perf/core
         git checkout ada543459cab7f653dcacdaba4011a8bb19c627c
         # save the config file to linux build tree
         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 clang-analyzer

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


clang-analyzer warnings: (new ones prefixed by >>)

 >> arch/x86/events/amd/core.c:722:3: warning: Value stored to 'hwc' is never read [clang-analyzer-deadcode.DeadStores]
                    hwc = &cpuc->events[idx]->hw;
                    ^     ~~~~~~~~~~~~~~~~~~~~~~

vim +/hwc +722 arch/x86/events/amd/core.c

ada543459cab7f Stephane Eranian 2022-03-22  712
ada543459cab7f Stephane Eranian 2022-03-22  713  static void amd_pmu_enable_all(int added)
ada543459cab7f Stephane Eranian 2022-03-22  714  {
ada543459cab7f Stephane Eranian 2022-03-22  715  	struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events);
ada543459cab7f Stephane Eranian 2022-03-22  716  	struct hw_perf_event *hwc;
ada543459cab7f Stephane Eranian 2022-03-22  717  	int idx;
ada543459cab7f Stephane Eranian 2022-03-22  718
ada543459cab7f Stephane Eranian 2022-03-22  719  	amd_brs_enable_all();
ada543459cab7f Stephane Eranian 2022-03-22  720
ada543459cab7f Stephane Eranian 2022-03-22  721  	for (idx = 0; idx < x86_pmu.num_counters; idx++) {
ada543459cab7f Stephane Eranian 2022-03-22 @722  		hwc = &cpuc->events[idx]->hw;
ada543459cab7f Stephane Eranian 2022-03-22  723
ada543459cab7f Stephane Eranian 2022-03-22  724  		/* only activate events which are marked as active */
ada543459cab7f Stephane Eranian 2022-03-22  725  		if (!test_bit(idx, cpuc->active_mask))
ada543459cab7f Stephane Eranian 2022-03-22  726  			continue;
ada543459cab7f Stephane Eranian 2022-03-22  727
ada543459cab7f Stephane Eranian 2022-03-22  728  		amd_pmu_enable_event(cpuc->events[idx]);
ada543459cab7f Stephane Eranian 2022-03-22  729  	}
ada543459cab7f Stephane Eranian 2022-03-22  730  }
ada543459cab7f Stephane Eranian 2022-03-22  731

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

           reply	other threads:[~2022-04-13  8:44 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <202204110431.SBvb4g5G-lkp@intel.com>]

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=5f198292-247a-e3bd-f3b2-0052d318fc20@intel.com \
    --to=yujie.liu@intel.com \
    --cc=eranian@google.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=x86@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

all inboxes | Powered by JetHome®