All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Yury Norov <yury.norov@gmail.com>
Cc: oe-kbuild-all@lists.linux.dev
Subject: [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 *'
Date: Sat, 25 Jan 2025 21:35:04 +0800	[thread overview]
Message-ID: <202501252135.IXnFKMG5-lkp@intel.com> (raw)

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

                 reply	other threads:[~2025-01-25 13:36 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=202501252135.IXnFKMG5-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=yury.norov@gmail.com \
    /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.