kernel/task_work.c:73: warning: Function parameter or member 'data' not described in 'task_work_cancel_match'

From: kernel test robot
Date: Mon Sep 11 2023 - 18:43:56 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 0bb80ecc33a8fb5a682236443c1e740d5c917d1d
commit: c7aab1a7c52b82d9afd7e03c398eb03dc2aa0507 task_work: add helper for more targeted task_work canceling
date: 2 years, 5 months ago
config: openrisc-allnoconfig (https://download.01.org/0day-ci/archive/20230912/202309120307.zis3yQGe-lkp@xxxxxxxxx/config)
compiler: or1k-linux-gcc (GCC) 12.3.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20230912/202309120307.zis3yQGe-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/202309120307.zis3yQGe-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

>> kernel/task_work.c:73: warning: Function parameter or member 'data' not described in 'task_work_cancel_match'


vim +73 kernel/task_work.c

e73f8959af0439 Oleg Nesterov 2012-05-11 60
892f6668f3a708 Oleg Nesterov 2013-09-11 61 /**
c7aab1a7c52b82 Jens Axboe 2021-04-01 62 * task_work_cancel_match - cancel a pending work added by task_work_add()
892f6668f3a708 Oleg Nesterov 2013-09-11 63 * @task: the task which should execute the work
c7aab1a7c52b82 Jens Axboe 2021-04-01 64 * @match: match function to call
892f6668f3a708 Oleg Nesterov 2013-09-11 65 *
892f6668f3a708 Oleg Nesterov 2013-09-11 66 * RETURNS:
892f6668f3a708 Oleg Nesterov 2013-09-11 67 * The found work or NULL if not found.
892f6668f3a708 Oleg Nesterov 2013-09-11 68 */
67d1214551e800 Al Viro 2012-06-27 69 struct callback_head *
c7aab1a7c52b82 Jens Axboe 2021-04-01 70 task_work_cancel_match(struct task_struct *task,
c7aab1a7c52b82 Jens Axboe 2021-04-01 71 bool (*match)(struct callback_head *, void *data),
c7aab1a7c52b82 Jens Axboe 2021-04-01 72 void *data)
e73f8959af0439 Oleg Nesterov 2012-05-11 @73 {
ac3d0da8f3290b Oleg Nesterov 2012-08-26 74 struct callback_head **pprev = &task->task_works;
205e550a0fb469 Oleg Nesterov 2013-09-11 75 struct callback_head *work;
e73f8959af0439 Oleg Nesterov 2012-05-11 76 unsigned long flags;
61e96496d3c949 Oleg Nesterov 2016-08-02 77
61e96496d3c949 Oleg Nesterov 2016-08-02 78 if (likely(!task->task_works))
61e96496d3c949 Oleg Nesterov 2016-08-02 79 return NULL;
ac3d0da8f3290b Oleg Nesterov 2012-08-26 80 /*
ac3d0da8f3290b Oleg Nesterov 2012-08-26 81 * If cmpxchg() fails we continue without updating pprev.
ac3d0da8f3290b Oleg Nesterov 2012-08-26 82 * Either we raced with task_work_add() which added the
ac3d0da8f3290b Oleg Nesterov 2012-08-26 83 * new entry before this work, we will find it again. Or
9da33de62431c7 Oleg Nesterov 2012-08-26 84 * we raced with task_work_run(), *pprev == NULL/exited.
ac3d0da8f3290b Oleg Nesterov 2012-08-26 85 */
e73f8959af0439 Oleg Nesterov 2012-05-11 86 raw_spin_lock_irqsave(&task->pi_lock, flags);
506458efaf153c Will Deacon 2017-10-24 87 while ((work = READ_ONCE(*pprev))) {
c7aab1a7c52b82 Jens Axboe 2021-04-01 88 if (!match(work, data))
ac3d0da8f3290b Oleg Nesterov 2012-08-26 89 pprev = &work->next;
ac3d0da8f3290b Oleg Nesterov 2012-08-26 90 else if (cmpxchg(pprev, work, work->next) == work)
158e1645e07f3e Al Viro 2012-06-27 91 break;
158e1645e07f3e Al Viro 2012-06-27 92 }
e73f8959af0439 Oleg Nesterov 2012-05-11 93 raw_spin_unlock_irqrestore(&task->pi_lock, flags);
ac3d0da8f3290b Oleg Nesterov 2012-08-26 94
ac3d0da8f3290b Oleg Nesterov 2012-08-26 95 return work;
e73f8959af0439 Oleg Nesterov 2012-05-11 96 }
e73f8959af0439 Oleg Nesterov 2012-05-11 97

:::::: The code at line 73 was first introduced by commit
:::::: e73f8959af0439d114847eab5a8a5ce48f1217c4 task_work_add: generic process-context callbacks

:::::: TO: Oleg Nesterov <oleg@xxxxxxxxxx>
:::::: CC: Al Viro <viro@xxxxxxxxxxxxxxxxxx>

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