public inbox for llvm@lists.linux.dev
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Atish Patra <atishp@rivosinc.com>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	Atish Patra <Atish.Patra@wdc.com>
Subject: [atishp04:kvm_pmu_snapshot_v1 32/32] arch/riscv/kvm/vcpu_pmu.c:204:6: warning: unused variable 'enabled'
Date: Tue, 5 Dec 2023 17:50:32 +0800	[thread overview]
Message-ID: <202312051709.nVYMNAeq-lkp@intel.com> (raw)

tree:   https://github.com/atishp04/linux kvm_pmu_snapshot_v1
head:   7536565387bf2f507db4c5407ad0a27413b349db
commit: 7536565387bf2f507db4c5407ad0a27413b349db [32/32] RISC-V: KVM: Support 64 bit firmware counters on RV32
config: riscv-rv32_defconfig (https://download.01.org/0day-ci/archive/20231205/202312051709.nVYMNAeq-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/20231205/202312051709.nVYMNAeq-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@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202312051709.nVYMNAeq-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> arch/riscv/kvm/vcpu_pmu.c:204:6: warning: unused variable 'enabled' [-Wunused-variable]
     204 |         u64 enabled, running;
         |             ^
>> arch/riscv/kvm/vcpu_pmu.c:204:15: warning: unused variable 'running' [-Wunused-variable]
     204 |         u64 enabled, running;
         |                      ^
   arch/riscv/kvm/vcpu_pmu.c:383:28: warning: result of comparison of constant 18446744073709551615 with expression of type 'unsigned long' is always true [-Wtautological-constant-out-of-range-compare]
     383 |                 if (kvpmu->snapshot_addr != INVALID_GPA)
         |                     ~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~
   arch/riscv/kvm/vcpu_pmu.c:387:25: warning: implicit conversion from 'gpa_t' (aka 'unsigned long long') to 'unsigned long' changes value from 18446744073709551615 to 4294967295 [-Wconstant-conversion]
     387 |         kvpmu->snapshot_addr = INVALID_GPA;
         |                              ~ ^~~~~~~~~~~
   include/linux/kvm_types.h:43:22: note: expanded from macro 'INVALID_GPA'
      43 | #define INVALID_GPA     (~(gpa_t)0)
         |                          ^~~~~~~~~
   arch/riscv/kvm/vcpu_pmu.c:440:26: warning: implicit conversion from 'gpa_t' (aka 'unsigned long long') to 'unsigned long' changes value from 18446744073709551615 to 4294967295 [-Wconstant-conversion]
     440 |                 kvpmu->snapshot_addr = INVALID_GPA;
         |                                      ~ ^~~~~~~~~~~
   include/linux/kvm_types.h:43:22: note: expanded from macro 'INVALID_GPA'
      43 | #define INVALID_GPA     (~(gpa_t)0)
         |                          ^~~~~~~~~
   arch/riscv/kvm/vcpu_pmu.c:485:41: warning: result of comparison of constant 18446744073709551615 with expression of type 'unsigned long' is always false [-Wtautological-constant-out-of-range-compare]
     485 |             (bSnapshot && kvpmu->snapshot_addr == INVALID_GPA)) {
         |                           ~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~
   arch/riscv/kvm/vcpu_pmu.c:556:42: warning: result of comparison of constant 18446744073709551615 with expression of type 'unsigned long' is always false [-Wtautological-constant-out-of-range-compare]
     556 |             (bSnapshot && (kvpmu->snapshot_addr == INVALID_GPA))) {
         |                            ~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~
   arch/riscv/kvm/vcpu_pmu.c:771:25: warning: implicit conversion from 'gpa_t' (aka 'unsigned long long') to 'unsigned long' changes value from 18446744073709551615 to 4294967295 [-Wconstant-conversion]
     771 |         kvpmu->snapshot_addr = INVALID_GPA;
         |                              ~ ^~~~~~~~~~~
   include/linux/kvm_types.h:43:22: note: expanded from macro 'INVALID_GPA'
      43 | #define INVALID_GPA     (~(gpa_t)0)
         |                          ^~~~~~~~~
   8 warnings generated.


vim +/enabled +204 arch/riscv/kvm/vcpu_pmu.c

   185	
   186	static int pmu_get_pmc_index(struct kvm_pmu *pmu, unsigned long eidx,
   187				     unsigned long cbase, unsigned long cmask)
   188	{
   189		int ret;
   190	
   191		/* Fixed counters need to be have fixed mapping as they have different width */
   192		ret = kvm_pmu_get_fixed_pmc_index(eidx);
   193		if (ret >= 0)
   194			return ret;
   195	
   196		return kvm_pmu_get_programmable_pmc_index(pmu, eidx, cbase, cmask);
   197	}
   198	#if defined(CONFIG_32BIT)
   199	static int pmu_fw_ctr_read_hi(struct kvm_vcpu *vcpu, unsigned long cidx,
   200				      unsigned long *out_val)
   201	{
   202		struct kvm_pmu *kvpmu = vcpu_to_pmu(vcpu);
   203		struct kvm_pmc *pmc;
 > 204		u64 enabled, running;
   205		int fevent_code;
   206	
   207		pmc = &kvpmu->pmc[cidx];
   208	
   209		if (pmc->cinfo.type != SBI_PMU_CTR_TYPE_FW)
   210			return -EINVAL;
   211	
   212		fevent_code = get_event_code(pmc->event_idx);
   213		pmc->counter_val = kvpmu->fw_event[fevent_code].value;
   214	
   215		*out_val = pmc->counter_val >> 32;
   216	
   217		return 0;
   218	}
   219	#endif
   220	

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

                 reply	other threads:[~2023-12-05  9:50 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=202312051709.nVYMNAeq-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=Atish.Patra@wdc.com \
    --cc=atishp@rivosinc.com \
    --cc=llvm@lists.linux.dev \
    --cc=oe-kbuild-all@lists.linux.dev \
    /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