* [norov:compat_get_cpumask 8/8] kernel/compat.c:120:30: error: incompatible pointer types passing 'cpumask_var_t' (aka 'struct cpumask *') to parameter of type 'struct cpumask_t *'
@ 2025-01-25 13:35 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2025-01-25 13:35 UTC (permalink / raw)
To: Yury Norov; +Cc: oe-kbuild-all
tree: https://github.com/norov/linux compat_get_cpumask
head: b7162e407638adc57cdf6d6f1acea90f9d84a638
commit: b7162e407638adc57cdf6d6f1acea90f9d84a638 [8/8] kernel/compat
config: x86_64-randconfig-005-20250125 (https://download.01.org/0day-ci/archive/20250125/202501252135.IXnFKMG5-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/20250125/202501252135.IXnFKMG5-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/202501252135.IXnFKMG5-lkp@intel.com/
All errors (new ones prefixed by >>):
In file included from kernel/compat.c:12:
include/linux/compat.h:955:32: warning: declaration of 'struct cpumask_t' will not be visible outside of this function [-Wvisibility]
955 | long compat_get_cpumask(struct cpumask_t *cpumask, const compat_ulong_t __user *umask,
| ^
In file included from kernel/compat.c:17:
In file included from include/linux/syscalls.h:94:
In file included from include/trace/syscall.h:7:
In file included from include/linux/trace_events.h:6:
In file included from include/linux/ring_buffer.h:5:
In file included from include/linux/mm.h:2224:
include/linux/vmstat.h:504:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
504 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
| ~~~~~~~~~~~~~~~~~~~~~ ^
505 | item];
| ~~~~
include/linux/vmstat.h:511:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
511 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
| ~~~~~~~~~~~~~~~~~~~~~ ^
512 | NR_VM_NUMA_EVENT_ITEMS +
| ~~~~~~~~~~~~~~~~~~~~~~
include/linux/vmstat.h:524:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
524 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
| ~~~~~~~~~~~~~~~~~~~~~ ^
525 | NR_VM_NUMA_EVENT_ITEMS +
| ~~~~~~~~~~~~~~~~~~~~~~
>> kernel/compat.c:120:30: error: incompatible pointer types passing 'cpumask_var_t' (aka 'struct cpumask *') to parameter of type 'struct cpumask_t *' [-Werror,-Wincompatible-pointer-types]
120 | retval = compat_get_cpumask(new_mask, user_mask_ptr, len);
| ^~~~~~~~
include/linux/compat.h:955:43: note: passing argument to parameter 'cpumask' here
955 | long compat_get_cpumask(struct cpumask_t *cpumask, const compat_ulong_t __user *umask,
| ^
kernel/compat.c:208:32: warning: declaration of 'struct cpumask_t' will not be visible outside of this function [-Wvisibility]
208 | long compat_get_cpumask(struct cpumask_t *cpumask, const compat_ulong_t __user *umask,
| ^
kernel/compat.c:208:6: error: conflicting types for 'compat_get_cpumask'
208 | long compat_get_cpumask(struct cpumask_t *cpumask, const compat_ulong_t __user *umask,
| ^
include/linux/compat.h:955:6: note: previous declaration is here
955 | long compat_get_cpumask(struct cpumask_t *cpumask, const compat_ulong_t __user *umask,
| ^
kernel/compat.c:214:26: error: incomplete definition of type 'struct cpumask_t'
214 | ret = compat_get_bitmap(cpumask_bits(cpumask), umask, ncpus);
| ^~~~~~~~~~~~~~~~~~~~~
include/linux/cpumask_types.h:18:37: note: expanded from macro 'cpumask_bits'
18 | #define cpumask_bits(maskp) ((maskp)->bits)
| ~~~~~~~^
kernel/compat.c:208:32: note: forward declaration of 'struct cpumask_t'
208 | long compat_get_cpumask(struct cpumask_t *cpumask, const compat_ulong_t __user *umask,
| ^
kernel/compat.c:216:22: error: incompatible pointer types passing 'struct cpumask_t *' to parameter of type 'struct cpumask *' [-Werror,-Wincompatible-pointer-types]
216 | cpumask_clear_from(cpumask, ncpus);
| ^~~~~~~
include/linux/cpumask.h:631:64: note: passing argument to parameter 'dstp' here
631 | static __always_inline void cpumask_clear_from(struct cpumask *dstp, unsigned long cpu)
| ^
5 warnings and 4 errors generated.
vim +120 kernel/compat.c
109
110 COMPAT_SYSCALL_DEFINE3(sched_setaffinity, compat_pid_t, pid,
111 unsigned int, len,
112 compat_ulong_t __user *, user_mask_ptr)
113 {
114 cpumask_var_t new_mask;
115 int retval;
116
117 if (!alloc_cpumask_var(&new_mask, GFP_KERNEL))
118 return -ENOMEM;
119
> 120 retval = compat_get_cpumask(new_mask, user_mask_ptr, len);
121 if (retval)
122 goto out;
123
124 retval = sched_setaffinity(pid, new_mask);
125 out:
126 free_cpumask_var(new_mask);
127 return retval;
128 }
129
--
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:[~2025-01-25 13:36 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-25 13:35 [norov:compat_get_cpumask 8/8] kernel/compat.c:120:30: error: incompatible pointer types passing 'cpumask_var_t' (aka 'struct cpumask *') to parameter of type 'struct cpumask_t *' kernel test robot
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.