[akpm-mm:mm-unstable 77/88] mm/mempolicy.c:3141:17: sparse: sparse: incorrect type in argument 1 (different address spaces)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-unstable
head:   d7ba3d7c3bf13e2faf419cce9e9bdfc3a1a50905
commit: 87bb2dbb869cbd1a0aa8cfd43d7f96882c9924a0 [77/88] mm/mempolicy: implement the sysfs-based weighted_interleave interface
config: s390-randconfig-r132-20240118 (https://download.01.org/0day-ci/archive/20240119/202401190453.R3kE0fNX-lkp@xxxxxxxxx/config)
compiler: s390-linux-gcc (GCC) 13.2.0
reproduce: (https://download.01.org/0day-ci/archive/20240119/202401190453.R3kE0fNX-lkp@xxxxxxxxx/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@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202401190453.R3kE0fNX-lkp@xxxxxxxxx/

sparse warnings: (new ones prefixed by >>)
   mm/mempolicy.c:3111:15: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected struct iw_table [noderef] __rcu *table @@     got struct iw_table * @@
   mm/mempolicy.c:3111:15: sparse:     expected struct iw_table [noderef] __rcu *table
   mm/mempolicy.c:3111:15: sparse:     got struct iw_table *
   mm/mempolicy.c:3132:13: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected struct iw_table [noderef] __rcu *new @@     got void * @@
   mm/mempolicy.c:3132:13: sparse:     expected struct iw_table [noderef] __rcu *new
   mm/mempolicy.c:3132:13: sparse:     got void *
   mm/mempolicy.c:3137:13: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected struct iw_table [noderef] __rcu *old @@     got struct iw_table * @@
   mm/mempolicy.c:3137:13: sparse:     expected struct iw_table [noderef] __rcu *old
   mm/mempolicy.c:3137:13: sparse:     got struct iw_table *
>> mm/mempolicy.c:3141:17: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *dest @@     got unsigned char [noderef] [usertype] __rcu ( * )[2] @@
   mm/mempolicy.c:3141:17: sparse:     expected void *dest
   mm/mempolicy.c:3141:17: sparse:     got unsigned char [noderef] [usertype] __rcu ( * )[2]
>> mm/mempolicy.c:3141:32: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void const *src @@     got unsigned char [noderef] [usertype] __rcu ( * )[2] @@
   mm/mempolicy.c:3141:32: sparse:     expected void const *src
   mm/mempolicy.c:3141:32: sparse:     got unsigned char [noderef] [usertype] __rcu ( * )[2]
   mm/mempolicy.c:3145:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct callback_head *head @@     got struct callback_head [noderef] __rcu * @@
   mm/mempolicy.c:3145:9: sparse:     expected struct callback_head *head
   mm/mempolicy.c:3145:9: sparse:     got struct callback_head [noderef] __rcu *
   mm/mempolicy.c:3145:9: sparse: sparse: cast removes address space '__rcu' of expression
   mm/mempolicy.c:3239:22: sparse: sparse: incompatible types in comparison expression (different address spaces):
   mm/mempolicy.c:3239:22: sparse:    struct iw_table [noderef] __rcu *
   mm/mempolicy.c:3239:22: sparse:    struct iw_table *
   mm/mempolicy.c:3260:18: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected struct iw_table [noderef] __rcu *static [addressable] [assigned] [toplevel] iw_table @@     got struct iw_table * @@
   mm/mempolicy.c:3262:15: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected struct iw_table [noderef] __rcu *table @@     got void * @@
   mm/mempolicy.c:3266:17: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *dest @@     got unsigned char [noderef] [usertype] __rcu ( * )[2] @@
   mm/mempolicy.c:3271:23: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const *objp @@     got struct iw_table [noderef] __rcu *table @@
   mm/mempolicy.c:3278:23: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const *objp @@     got struct iw_table [noderef] __rcu *table @@
   mm/mempolicy.c:535:17: sparse: sparse: context imbalance in 'queue_folios_pte_range' - unexpected unlock
   mm/mempolicy.c: note: in included file (through include/linux/rculist.h, include/linux/pid.h, include/linux/sched.h, ...):
   include/linux/list.h:83:21: sparse: sparse: self-comparison always evaluates to true
   mm/mempolicy.c:3112:32: sparse: sparse: dereference of noderef expression
   mm/mempolicy.c:3142:21: sparse: sparse: dereference of noderef expression

vim +3141 mm/mempolicy.c

  3117	
  3118	static ssize_t node_store(struct kobject *kobj, struct kobj_attribute *attr,
  3119				  const char *buf, size_t count)
  3120	{
  3121		struct iw_node_attr *node_attr;
  3122		struct iw_table __rcu *new;
  3123		struct iw_table __rcu *old;
  3124		u8 weight = 0;
  3125	
  3126		node_attr = container_of(attr, struct iw_node_attr, kobj_attr);
  3127		if (count == 0 || sysfs_streq(buf, ""))
  3128			weight = 0;
  3129		else if (kstrtou8(buf, 0, &weight))
  3130			return -EINVAL;
  3131	
  3132		new = kmalloc(sizeof(*new), GFP_KERNEL);
  3133		if (!new)
  3134			return -ENOMEM;
  3135	
  3136		mutex_lock(&iw_table_mtx);
  3137		old = rcu_dereference_protected(iw_table,
  3138						lockdep_is_held(&iw_table_mtx));
  3139		/* If value is 0, revert to default weight */
  3140		weight = weight ? weight : default_iw_table.weights[node_attr->nid];
> 3141		memcpy(&new->weights, &old->weights, sizeof(new->weights));
  3142		new->weights[node_attr->nid] = weight;
  3143		rcu_assign_pointer(iw_table, new);
  3144		mutex_unlock(&iw_table_mtx);
  3145		kfree_rcu(old, rcu);
  3146		return count;
  3147	}
  3148	

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




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux