All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: James Morse <james.morse@arm.com>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev
Subject: [morse:mpam/snapshot/v6.10-rc1 98/114] drivers/platform/arm64/mpam/mpam_resctrl.c:350:14: warning: result of comparison of constant 65536 with expression of type 'u16' (aka 'unsigned short') is always false
Date: Sat, 15 Jun 2024 00:02:16 +0800	[thread overview]
Message-ID: <202406150007.xsDBcEKC-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/morse/linux.git mpam/snapshot/v6.10-rc1
head:   d9ba67a1a8dc6551a0b3254a8f2ee9993ad17957
commit: 3b87a689f7311e64ff9a94ca9d22fb33aefcb372 [98/114] arm_mpam: resctrl: Add resctrl_arch_rmid_read() and resctrl_arch_reset_rmid()
config: arm64-allmodconfig (https://download.01.org/0day-ci/archive/20240615/202406150007.xsDBcEKC-lkp@intel.com/config)
compiler: clang version 19.0.0git (https://github.com/llvm/llvm-project 78ee473784e5ef6f0b19ce4cb111fb6e4d23c6b2)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240615/202406150007.xsDBcEKC-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/202406150007.xsDBcEKC-lkp@intel.com/

All warnings (new ones prefixed by >>):

   In file included from drivers/platform/arm64/mpam/mpam_resctrl.c:6:
   In file included from include/linux/arm_mpam.h:7:
   In file included from include/linux/acpi.h:39:
   In file included from include/acpi/acpi_io.h:7:
   In file included from arch/arm64/include/asm/acpi.h:14:
   In file included from include/linux/memblock.h:12:
   In file included from include/linux/mm.h:2253:
   include/linux/vmstat.h:500:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     500 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     501 |                            item];
         |                            ~~~~
   include/linux/vmstat.h:507:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     507 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     508 |                            NR_VM_NUMA_EVENT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~~
   include/linux/vmstat.h:514:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
     514 |         return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
         |                               ~~~~~~~~~~~ ^ ~~~
   include/linux/vmstat.h:519:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     519 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     520 |                            NR_VM_NUMA_EVENT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~~
   include/linux/vmstat.h:528:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     528 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     529 |                            NR_VM_NUMA_EVENT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~~
>> drivers/platform/arm64/mpam/mpam_resctrl.c:350:14: warning: result of comparison of constant 65536 with expression of type 'u16' (aka 'unsigned short') is always false [-Wtautological-constant-out-of-range-compare]
     350 |         if (cfg.mon == USE_RMID_IDX)
         |             ~~~~~~~ ^  ~~~~~~~~~~~~
   6 warnings generated.


vim +350 drivers/platform/arm64/mpam/mpam_resctrl.c

   321	
   322	int resctrl_arch_rmid_read(struct rdt_resource	*r, struct rdt_domain *d,
   323				   u32 closid, u32 rmid, enum resctrl_event_id eventid,
   324				   u64 *val, void *arch_mon_ctx)
   325	{
   326		int err;
   327		u64 cdp_val;
   328		struct mon_cfg cfg;
   329		struct mpam_resctrl_dom *dom;
   330		u32 mon = *(u32 *)arch_mon_ctx;
   331		enum mpam_device_features type;
   332	
   333		resctrl_arch_rmid_read_context_check();
   334	
   335		dom = container_of(d, struct mpam_resctrl_dom, resctrl_dom);
   336	
   337		switch (eventid) {
   338		case QOS_L3_OCCUP_EVENT_ID:
   339			type = mpam_feat_msmon_csu;
   340			break;
   341		case QOS_L3_MBM_LOCAL_EVENT_ID:
   342		case QOS_L3_MBM_TOTAL_EVENT_ID:
   343			type = mpam_feat_msmon_mbwu;
   344			break;
   345		default:
   346			return -EINVAL;
   347		}
   348	
   349		cfg.mon = mon;
 > 350		if (cfg.mon == USE_RMID_IDX)
   351			cfg.mon = resctrl_arch_rmid_idx_encode(closid, rmid);
   352	
   353		cfg.match_pmg = true;
   354		cfg.pmg = rmid;
   355	
   356		if (cdp_enabled) {
   357			cfg.partid = closid << 1;
   358			err = mpam_msmon_read(dom->comp, &cfg, type, val);
   359			if (err)
   360				return err;
   361	
   362			cfg.partid += 1;
   363			err = mpam_msmon_read(dom->comp, &cfg, type, &cdp_val);
   364			if (!err)
   365				*val += cdp_val;
   366		} else {
   367			cfg.partid = closid;
   368			err = mpam_msmon_read(dom->comp, &cfg, type, val);
   369		}
   370	
   371		return err;
   372	}
   373	

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

                 reply	other threads:[~2024-06-14 16:03 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=202406150007.xsDBcEKC-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=james.morse@arm.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 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.