Re: [PATCH] tty: n_tty: annotate lockless read of ldata->icanon in input_available_p()
From: kernel test robot
Date: Mon Mar 16 2026 - 18:25:19 EST
Hi Ziyu,
kernel test robot noticed the following build errors:
[auto build test ERROR on tty/tty-testing]
[also build test ERROR on tty/tty-next tty/tty-linus linus/master v6.16-rc1 next-20260316]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Ziyu-Zhang/tty-n_tty-annotate-lockless-read-of-ldata-icanon-in-input_available_p/20260316-224221
base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git tty-testing
patch link: https://lore.kernel.org/r/20260316132827.17855-1-ziyuzhang201%40gmail.com
patch subject: [PATCH] tty: n_tty: annotate lockless read of ldata->icanon in input_available_p()
config: x86_64-kexec (https://download.01.org/0day-ci/archive/20260316/202603162328.vY9JOJWL-lkp@xxxxxxxxx/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260316/202603162328.vY9JOJWL-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/202603162328.vY9JOJWL-lkp@xxxxxxxxx/
All errors (new ones prefixed by >>):
>> drivers/tty/n_tty.c:1913:6: error: cannot pass bit-field as __auto_type initializer in C
1913 | if (data_race(ldata->icanon) && !L_EXTPROC(tty))
| ^
include/linux/compiler.h:194:13: note: expanded from macro 'data_race'
194 | auto __v = (expr); \
| ^
1 error generated.
vim +1913 drivers/tty/n_tty.c
1906
1907 static inline int input_available_p(const struct tty_struct *tty, int poll)
1908 {
1909 const struct n_tty_data *ldata = tty->disc_data;
1910 int amt = poll && !TIME_CHAR(tty) && MIN_CHAR(tty) ? MIN_CHAR(tty) : 1;
1911
1912 /* data_race: benign race, poll readiness is best-effort */
> 1913 if (data_race(ldata->icanon) && !L_EXTPROC(tty))
1914 return ldata->canon_head != ldata->read_tail;
1915 else
1916 return ldata->commit_head - ldata->read_tail >= amt;
1917 }
1918
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki