All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Ingo Molnar <mingo@kernel.org>
Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: kernel/sched/syscalls.c:979:8: error: unexpected token, expected comma
Date: Tue, 8 Apr 2025 20:10:14 +0800	[thread overview]
Message-ID: <202504082254.7GLSWAbI-lkp@intel.com> (raw)

Hi Ingo,

FYI, the error/warning still remains.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   0af2f6be1b4281385b618cb86ad946eded089ac8
commit: 04746ed80bcf3130951ed4d5c1bc5b0bcabdde22 sched/syscalls: Split out kernel/sched/syscalls.c from kernel/sched/core.c
date:   11 months ago
config: mips-randconfig-r064-20250408 (https://download.01.org/0day-ci/archive/20250408/202504082254.7GLSWAbI-lkp@intel.com/config)
compiler: clang version 21.0.0git (https://github.com/llvm/llvm-project 92c93f5286b9ff33f27ff694d2dc33da1c07afdd)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250408/202504082254.7GLSWAbI-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/202504082254.7GLSWAbI-lkp@intel.com/

All errors (new ones prefixed by >>):

   In file included from kernel/sched/build_policy.c:24:
   In file included from include/linux/livepatch.h:13:
   In file included from include/linux/ftrace.h:13:
   In file included from include/linux/kallsyms.h:13:
   In file included from include/linux/mm.h:2253:
   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_"
         |                               ~~~~~~~~~~~ ^ ~~~
   In file included from kernel/sched/build_policy.c:55:
>> kernel/sched/syscalls.c:979:8: error: unexpected token, expected comma
     979 |         ret = get_user(size, &uattr->size);
         |               ^
   arch/mips/include/asm/uaccess.h:97:33: note: expanded from macro 'get_user'
      97 |         access_ok(__p, sizeof(*__p)) ? __get_user((x), __p) :           \
         |                                        ^
   arch/mips/include/asm/uaccess.h:183:23: note: expanded from macro '__get_user'
     183 |                 __get_data_asm((x), user_lw, __gu_ptr);                 \
         |                                     ^
   <inline asm>:3:10: note: instantiated into assembly here
       3 |         .set    eva
         |                    ^
   In file included from kernel/sched/build_policy.c:55:
   kernel/sched/syscalls.c:979:8: error: instruction requires a CPU feature not currently enabled
     979 |         ret = get_user(size, &uattr->size);
         |               ^
   arch/mips/include/asm/uaccess.h:97:33: note: expanded from macro 'get_user'
      97 |         access_ok(__p, sizeof(*__p)) ? __get_user((x), __p) :           \
         |                                        ^
   arch/mips/include/asm/uaccess.h:183:23: note: expanded from macro '__get_user'
     183 |                 __get_data_asm((x), user_lw, __gu_ptr);                 \
         |                                     ^
   <inline asm>:4:2: note: instantiated into assembly here
       4 |         lwe $2, 0($16)
         |         ^
   In file included from kernel/sched/build_policy.c:55:
   kernel/sched/syscalls.c:1009:2: error: unexpected token, expected comma
    1009 |         put_user(sizeof(*attr), &uattr->size);
         |         ^
   arch/mips/include/asm/uaccess.h:71:33: note: expanded from macro 'put_user'
      71 |         access_ok(__p, sizeof(*__p)) ? __put_user((x), __p) : -EFAULT;  \
         |                                        ^
   arch/mips/include/asm/uaccess.h:136:18: note: expanded from macro '__put_user'
     136 |                 __put_data_asm(user_sw, __pu_ptr);                      \
         |                                ^
   <inline asm>:3:10: note: instantiated into assembly here
       3 |         .set    eva
         |                    ^
   In file included from kernel/sched/build_policy.c:55:
   kernel/sched/syscalls.c:1009:2: error: instruction requires a CPU feature not currently enabled
    1009 |         put_user(sizeof(*attr), &uattr->size);
         |         ^
   arch/mips/include/asm/uaccess.h:71:33: note: expanded from macro 'put_user'
      71 |         access_ok(__p, sizeof(*__p)) ? __put_user((x), __p) : -EFAULT;  \
         |                                        ^
   arch/mips/include/asm/uaccess.h:136:18: note: expanded from macro '__put_user'
     136 |                 __put_data_asm(user_sw, __pu_ptr);                      \
         |                                ^
   <inline asm>:4:2: note: instantiated into assembly here
       4 |         swe $3, 0($16)
         |         ^
   1 warning and 4 errors generated.


vim +979 kernel/sched/syscalls.c

   967	
   968	/*
   969	 * Mimics kernel/events/core.c perf_copy_attr().
   970	 */
   971	static int sched_copy_attr(struct sched_attr __user *uattr, struct sched_attr *attr)
   972	{
   973		u32 size;
   974		int ret;
   975	
   976		/* Zero the full structure, so that a short copy will be nice: */
   977		memset(attr, 0, sizeof(*attr));
   978	
 > 979		ret = get_user(size, &uattr->size);
   980		if (ret)
   981			return ret;
   982	
   983		/* ABI compatibility quirk: */
   984		if (!size)
   985			size = SCHED_ATTR_SIZE_VER0;
   986		if (size < SCHED_ATTR_SIZE_VER0 || size > PAGE_SIZE)
   987			goto err_size;
   988	
   989		ret = copy_struct_from_user(attr, sizeof(*attr), uattr, size);
   990		if (ret) {
   991			if (ret == -E2BIG)
   992				goto err_size;
   993			return ret;
   994		}
   995	
   996		if ((attr->sched_flags & SCHED_FLAG_UTIL_CLAMP) &&
   997		    size < SCHED_ATTR_SIZE_VER1)
   998			return -EINVAL;
   999	
  1000		/*
  1001		 * XXX: Do we want to be lenient like existing syscalls; or do we want
  1002		 * to be strict and return an error on out-of-bounds values?
  1003		 */
  1004		attr->sched_nice = clamp(attr->sched_nice, MIN_NICE, MAX_NICE);
  1005	
  1006		return 0;
  1007	
  1008	err_size:
  1009		put_user(sizeof(*attr), &uattr->size);
  1010		return -E2BIG;
  1011	}
  1012	

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

             reply	other threads:[~2025-04-08 12:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-08 12:10 kernel test robot [this message]
2025-04-10  6:56 ` kernel/sched/syscalls.c:979:8: error: unexpected token, expected comma Ingo Molnar
2025-04-13  2:23   ` Philip Li
2025-04-14 23:09     ` Nathan Chancellor
  -- strict thread matches above, loose matches on Subject: below --
2024-08-20  0:11 kernel test robot

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=202504082254.7GLSWAbI-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --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.