Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
* [djiang:cxl/fwctl 23/28] drivers/cxl/features.c:60:10: warning: expression which evaluates to zero treated as a null pointer constant of type 'struct cxl_feat_entry *'
@ 2024-12-14  5:17 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2024-12-14  5:17 UTC (permalink / raw)
  To: Dave Jiang; +Cc: llvm, oe-kbuild-all

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/djiang/linux.git cxl/fwctl
head:   c3c1ca00092765212f4eb49d2aaffb2003beb33b
commit: 7f7c30b7dbd79802299899bb011fe4e37a30c12c [23/28] cxl: Add support for fwctl RPC command to enable CXL feature commands
config: i386-buildonly-randconfig-004-20241214 (https://download.01.org/0day-ci/archive/20241214/202412141339.84yarl3c-lkp@intel.com/config)
compiler: clang version 19.1.3 (https://github.com/llvm/llvm-project ab51eccf88f5321e7c60591c5546b254b6afab99)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241214/202412141339.84yarl3c-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/202412141339.84yarl3c-lkp@intel.com/

All warnings (new ones prefixed by >>):

   In file included from drivers/cxl/features.c:5:
   In file included from include/linux/pci.h:1650:
   In file included from include/linux/dmapool.h:14:
   In file included from include/linux/scatterlist.h:8:
   In file included from include/linux/mm.h:2213:
   include/linux/vmstat.h:518:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
     518 |         return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
         |                               ~~~~~~~~~~~ ^ ~~~
>> drivers/cxl/features.c:60:10: warning: expression which evaluates to zero treated as a null pointer constant of type 'struct cxl_feat_entry *' [-Wnon-literal-null-conversion]
      60 |                 return false;
         |                        ^~~~~
   drivers/cxl/features.c:64:10: warning: expression which evaluates to zero treated as a null pointer constant of type 'struct cxl_feat_entry *' [-Wnon-literal-null-conversion]
      64 |                 return false;
         |                        ^~~~~
   3 warnings generated.


vim +60 drivers/cxl/features.c

    51	
    52	static struct cxl_feat_entry *
    53	get_support_feature_info(struct cxl_features_state *cfs,
    54				 const struct fwctl_rpc_cxl *rpc_in)
    55	{
    56		struct cxl_feat_entry *feat;
    57		uuid_t uuid;
    58	
    59		if (rpc_in->op_size < sizeof(uuid))
  > 60			return false;
    61	
    62		if (copy_from_user(&uuid, u64_to_user_ptr(rpc_in->in_payload),
    63				   sizeof(uuid)))
    64			return false;
    65	
    66		for (int i = 0; i < cfs->num_features; i++) {
    67			feat = &cfs->entries[i];
    68			if (uuid_equal(&uuid, &feat->uuid))
    69				return feat;
    70		}
    71	
    72		return ERR_PTR(-ENOENT);
    73	}
    74	

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-12-14  5:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-14  5:17 [djiang:cxl/fwctl 23/28] drivers/cxl/features.c:60:10: warning: expression which evaluates to zero treated as a null pointer constant of type 'struct cxl_feat_entry *' kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox