From: kernel test robot <lkp@intel.com>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: oe-kbuild-all@lists.linux.dev
Subject: [tglx-devel:timers/posix 10/19] kernel/time/posix-timers.c:423:9: error: 'new_timer_id' undeclared; did you mean 'new_timer'?
Date: Sun, 23 Feb 2025 04:47:33 +0800 [thread overview]
Message-ID: <202502230433.CF74INaB-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/tglx/devel.git timers/posix
head: 9d4caab4067bd0c9023b7e98205b0747dece9f66
commit: ee35cb454088487035734ec7320ec5974a69651e [10/19] posix-timers: Rework the timer valid mechanism
config: arc-randconfig-002-20250223 (https://download.01.org/0day-ci/archive/20250223/202502230433.CF74INaB-lkp@intel.com/config)
compiler: arc-elf-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250223/202502230433.CF74INaB-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/202502230433.CF74INaB-lkp@intel.com/
All errors (new ones prefixed by >>):
kernel/time/posix-timers.c: In function 'posix_timer_add':
kernel/time/posix-timers.c:105:42: error: initialization of 'struct list_head *' from incompatible pointer type 'struct hlist_head *' [-Werror=incompatible-pointer-types]
105 | struct list_head *head = &posix_timers_hashtable[hash(sig, id)];
| ^
kernel/time/posix-timers.c:110:53: error: passing argument 1 of 'posix_timer_hashed' from incompatible pointer type [-Werror=incompatible-pointer-types]
110 | hashed = posix_timer_hashed(head, sig, id);
| ^~~~
| |
| struct list_head *
kernel/time/posix-timers.c:69:51: note: expected 'struct hlist_head *' but argument is of type 'struct list_head *'
69 | static bool posix_timer_hashed(struct hlist_head *head, struct signal_struct *sig, timer_t id)
| ~~~~~~~~~~~~~~~~~~~^~~~
kernel/time/posix-timers.c:123:41: error: passing argument 1 of 'posix_timer_hashed' from incompatible pointer type [-Werror=incompatible-pointer-types]
123 | if (!posix_timer_hashed(head, sig, id)) {
| ^~~~
| |
| struct list_head *
kernel/time/posix-timers.c:69:51: note: expected 'struct hlist_head *' but argument is of type 'struct list_head *'
69 | static bool posix_timer_hashed(struct hlist_head *head, struct signal_struct *sig, timer_t id)
| ~~~~~~~~~~~~~~~~~~~^~~~
kernel/time/posix-timers.c:132:60: error: passing argument 2 of 'hlist_add_head_rcu' from incompatible pointer type [-Werror=incompatible-pointer-types]
132 | hlist_add_head_rcu(&timer->t_hash, head);
| ^~~~
| |
| struct list_head *
In file included from include/linux/dcache.h:8,
from include/linux/fs.h:8,
from include/linux/compat.h:17,
from kernel/time/posix-timers.c:12:
include/linux/rculist.h:634:60: note: expected 'struct hlist_head *' but argument is of type 'struct list_head *'
634 | struct hlist_head *h)
| ~~~~~~~~~~~~~~~~~~~^
kernel/time/posix-timers.c: In function 'do_timer_create':
>> kernel/time/posix-timers.c:423:9: error: 'new_timer_id' undeclared (first use in this function); did you mean 'new_timer'?
423 | new_timer_id = posix_timer_add(new_timer);
| ^~~~~~~~~~~~
| new_timer
kernel/time/posix-timers.c:423:9: note: each undeclared identifier is reported only once for each function it appears in
cc1: some warnings being treated as errors
vim +423 kernel/time/posix-timers.c
838394fbf98997 kernel/posix-timers.c Thomas Gleixner 2011-02-01 399
^1da177e4c3f41 kernel/posix-timers.c Linus Torvalds 2005-04-16 400 /* Create a POSIX.1b interval timer. */
2482097c6c0f01 kernel/time/posix-timers.c Al Viro 2017-06-07 401 static int do_timer_create(clockid_t which_clock, struct sigevent *event,
2482097c6c0f01 kernel/time/posix-timers.c Al Viro 2017-06-07 402 timer_t __user *created_timer_id)
^1da177e4c3f41 kernel/posix-timers.c Linus Torvalds 2005-04-16 403 {
d3ba5a9a345b12 kernel/time/posix-timers.c Christoph Hellwig 2017-05-26 404 const struct k_clock *kc = clockid_to_kclock(which_clock);
2cd499e38ec241 kernel/posix-timers.c Oleg Nesterov 2008-09-22 405 struct k_itimer *new_timer;
ee35cb45408848 kernel/time/posix-timers.c Thomas Gleixner 2025-02-18 406 int error;
^1da177e4c3f41 kernel/posix-timers.c Linus Torvalds 2005-04-16 407
838394fbf98997 kernel/posix-timers.c Thomas Gleixner 2011-02-01 408 if (!kc)
^1da177e4c3f41 kernel/posix-timers.c Linus Torvalds 2005-04-16 409 return -EINVAL;
838394fbf98997 kernel/posix-timers.c Thomas Gleixner 2011-02-01 410 if (!kc->timer_create)
838394fbf98997 kernel/posix-timers.c Thomas Gleixner 2011-02-01 411 return -EOPNOTSUPP;
^1da177e4c3f41 kernel/posix-timers.c Linus Torvalds 2005-04-16 412
^1da177e4c3f41 kernel/posix-timers.c Linus Torvalds 2005-04-16 413 new_timer = alloc_posix_timer();
^1da177e4c3f41 kernel/posix-timers.c Linus Torvalds 2005-04-16 414 if (unlikely(!new_timer))
^1da177e4c3f41 kernel/posix-timers.c Linus Torvalds 2005-04-16 415 return -EAGAIN;
^1da177e4c3f41 kernel/posix-timers.c Linus Torvalds 2005-04-16 416
^1da177e4c3f41 kernel/posix-timers.c Linus Torvalds 2005-04-16 417 spin_lock_init(&new_timer->it_lock);
ae88967d71f1b4 kernel/time/posix-timers.c Thomas Gleixner 2023-04-25 418
ae88967d71f1b4 kernel/time/posix-timers.c Thomas Gleixner 2023-04-25 419 /*
ae88967d71f1b4 kernel/time/posix-timers.c Thomas Gleixner 2023-04-25 420 * Add the timer to the hash table. The timer is not yet valid
e577c6d8698192 kernel/time/posix-timers.c Eric Dumazet 2025-02-19 421 * after insertion, but has a unique ID allocated.
ae88967d71f1b4 kernel/time/posix-timers.c Thomas Gleixner 2023-04-25 422 */
5ed67f05f66c41 kernel/posix-timers.c Pavel Emelyanov 2013-03-11 @423 new_timer_id = posix_timer_add(new_timer);
5ed67f05f66c41 kernel/posix-timers.c Pavel Emelyanov 2013-03-11 424 if (new_timer_id < 0) {
5d916a0988eed5 kernel/time/posix-timers.c Thomas Gleixner 2024-11-05 425 posixtimer_free_timer(new_timer);
8cc96ca2c75f6d kernel/time/posix-timers.c Thomas Gleixner 2023-04-25 426 return new_timer_id;
^1da177e4c3f41 kernel/posix-timers.c Linus Torvalds 2005-04-16 427 }
^1da177e4c3f41 kernel/posix-timers.c Linus Torvalds 2005-04-16 428
^1da177e4c3f41 kernel/posix-timers.c Linus Torvalds 2005-04-16 429 new_timer->it_clock = which_clock;
d97bb75ddd2f38 kernel/time/posix-timers.c Thomas Gleixner 2017-05-30 430 new_timer->kclock = kc;
78c9c4dfbf8c04 kernel/time/posix-timers.c Thomas Gleixner 2018-06-26 431 new_timer->it_overrun = -1LL;
^1da177e4c3f41 kernel/posix-timers.c Linus Torvalds 2005-04-16 432
2482097c6c0f01 kernel/time/posix-timers.c Al Viro 2017-06-07 433 if (event) {
36b2f046000b35 kernel/posix-timers.c Oleg Nesterov 2008-09-22 434 rcu_read_lock();
2482097c6c0f01 kernel/time/posix-timers.c Al Viro 2017-06-07 435 new_timer->it_pid = get_pid(good_sigevent(event));
36b2f046000b35 kernel/posix-timers.c Oleg Nesterov 2008-09-22 436 rcu_read_unlock();
899921025b406a kernel/posix-timers.c Oleg Nesterov 2008-12-01 437 if (!new_timer->it_pid) {
^1da177e4c3f41 kernel/posix-timers.c Linus Torvalds 2005-04-16 438 error = -EINVAL;
^1da177e4c3f41 kernel/posix-timers.c Linus Torvalds 2005-04-16 439 goto out;
^1da177e4c3f41 kernel/posix-timers.c Linus Torvalds 2005-04-16 440 }
2482097c6c0f01 kernel/time/posix-timers.c Al Viro 2017-06-07 441 new_timer->it_sigev_notify = event->sigev_notify;
6017a158beb13b kernel/time/posix-timers.c Thomas Gleixner 2024-11-05 442 new_timer->sigq.info.si_signo = event->sigev_signo;
6017a158beb13b kernel/time/posix-timers.c Thomas Gleixner 2024-11-05 443 new_timer->sigq.info.si_value = event->sigev_value;
^1da177e4c3f41 kernel/posix-timers.c Linus Torvalds 2005-04-16 444 } else {
2482097c6c0f01 kernel/time/posix-timers.c Al Viro 2017-06-07 445 new_timer->it_sigev_notify = SIGEV_SIGNAL;
6017a158beb13b kernel/time/posix-timers.c Thomas Gleixner 2024-11-05 446 new_timer->sigq.info.si_signo = SIGALRM;
6017a158beb13b kernel/time/posix-timers.c Thomas Gleixner 2024-11-05 447 memset(&new_timer->sigq.info.si_value, 0, sizeof(sigval_t));
6017a158beb13b kernel/time/posix-timers.c Thomas Gleixner 2024-11-05 448 new_timer->sigq.info.si_value.sival_int = new_timer->it_id;
899921025b406a kernel/posix-timers.c Oleg Nesterov 2008-12-01 449 new_timer->it_pid = get_pid(task_tgid(current));
^1da177e4c3f41 kernel/posix-timers.c Linus Torvalds 2005-04-16 450 }
^1da177e4c3f41 kernel/posix-timers.c Linus Torvalds 2005-04-16 451
ef1c5bcd6daa67 kernel/time/posix-timers.c Thomas Gleixner 2024-11-05 452 if (new_timer->it_sigev_notify & SIGEV_THREAD_ID)
ef1c5bcd6daa67 kernel/time/posix-timers.c Thomas Gleixner 2024-11-05 453 new_timer->it_pid_type = PIDTYPE_PID;
ef1c5bcd6daa67 kernel/time/posix-timers.c Thomas Gleixner 2024-11-05 454 else
ef1c5bcd6daa67 kernel/time/posix-timers.c Thomas Gleixner 2024-11-05 455 new_timer->it_pid_type = PIDTYPE_TGID;
ef1c5bcd6daa67 kernel/time/posix-timers.c Thomas Gleixner 2024-11-05 456
6017a158beb13b kernel/time/posix-timers.c Thomas Gleixner 2024-11-05 457 new_timer->sigq.info.si_tid = new_timer->it_id;
6017a158beb13b kernel/time/posix-timers.c Thomas Gleixner 2024-11-05 458 new_timer->sigq.info.si_code = SI_TIMER;
717835d94d3e3d kernel/posix-timers.c Oleg Nesterov 2008-09-22 459
52f090b164b59c kernel/time/posix-timers.c Thomas Gleixner 2023-04-25 460 if (copy_to_user(created_timer_id, &new_timer_id, sizeof (new_timer_id))) {
2b08de0073a569 kernel/posix-timers.c Andrey Vagin 2010-07-20 461 error = -EFAULT;
2b08de0073a569 kernel/posix-timers.c Andrey Vagin 2010-07-20 462 goto out;
2b08de0073a569 kernel/posix-timers.c Andrey Vagin 2010-07-20 463 }
52f090b164b59c kernel/time/posix-timers.c Thomas Gleixner 2023-04-25 464 /*
ee35cb45408848 kernel/time/posix-timers.c Thomas Gleixner 2025-02-18 465 * After successful copy out, the timer ID is visible to user space
ee35cb45408848 kernel/time/posix-timers.c Thomas Gleixner 2025-02-18 466 * now but not yet valid because new_timer::it_valid is still false.
52f090b164b59c kernel/time/posix-timers.c Thomas Gleixner 2023-04-25 467 *
52f090b164b59c kernel/time/posix-timers.c Thomas Gleixner 2023-04-25 468 * Complete the initialization with the clock specific create
52f090b164b59c kernel/time/posix-timers.c Thomas Gleixner 2023-04-25 469 * callback.
52f090b164b59c kernel/time/posix-timers.c Thomas Gleixner 2023-04-25 470 */
838394fbf98997 kernel/posix-timers.c Thomas Gleixner 2011-02-01 471 error = kc->timer_create(new_timer);
45e0fffc8a7778 kernel/posix-timers.c Andrey Vagin 2010-05-24 472 if (error)
45e0fffc8a7778 kernel/posix-timers.c Andrey Vagin 2010-05-24 473 goto out;
45e0fffc8a7778 kernel/posix-timers.c Andrey Vagin 2010-05-24 474
36b2f046000b35 kernel/posix-timers.c Oleg Nesterov 2008-09-22 475 spin_lock_irq(¤t->sighand->siglock);
ee35cb45408848 kernel/time/posix-timers.c Thomas Gleixner 2025-02-18 476 /* Set the valid marker so it's visible for syscall operations. */
ee35cb45408848 kernel/time/posix-timers.c Thomas Gleixner 2025-02-18 477 WRITE_ONCE(new_timer->it_valid, true);
52dea0a15cc888 kernel/time/posix-timers.c Thomas Gleixner 2024-06-10 478 hlist_add_head(&new_timer->list, ¤t->signal->posix_timers);
36b2f046000b35 kernel/posix-timers.c Oleg Nesterov 2008-09-22 479 spin_unlock_irq(¤t->sighand->siglock);
^1da177e4c3f41 kernel/posix-timers.c Linus Torvalds 2005-04-16 480 /*
52f090b164b59c kernel/time/posix-timers.c Thomas Gleixner 2023-04-25 481 * After unlocking sighand::siglock @new_timer is subject to
52f090b164b59c kernel/time/posix-timers.c Thomas Gleixner 2023-04-25 482 * concurrent removal and cannot be touched anymore
^1da177e4c3f41 kernel/posix-timers.c Linus Torvalds 2005-04-16 483 */
52f090b164b59c kernel/time/posix-timers.c Thomas Gleixner 2023-04-25 484 return 0;
^1da177e4c3f41 kernel/posix-timers.c Linus Torvalds 2005-04-16 485 out:
8cc96ca2c75f6d kernel/time/posix-timers.c Thomas Gleixner 2023-04-25 486 posix_timer_unhash_and_free(new_timer);
^1da177e4c3f41 kernel/posix-timers.c Linus Torvalds 2005-04-16 487 return error;
^1da177e4c3f41 kernel/posix-timers.c Linus Torvalds 2005-04-16 488 }
^1da177e4c3f41 kernel/posix-timers.c Linus Torvalds 2005-04-16 489
:::::: The code at line 423 was first introduced by commit
:::::: 5ed67f05f66c41e39880a6d61358438a25f9fee5 posix timers: Allocate timer id per process (v2)
:::::: TO: Pavel Emelyanov <xemul@parallels.com>
:::::: CC: Thomas Gleixner <tglx@linutronix.de>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2025-02-22 20:48 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=202502230433.CF74INaB-lkp@intel.com \
--to=lkp@intel.com \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=tglx@linutronix.de \
/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.