Re: [PATCH v2] genirq: procfs: Make smp_affinity read-only for interrupts that userspace can't set

From: kernel test robot
Date: Tue Aug 27 2024 - 02:23:06 EST


Hi Jeff,

kernel test robot noticed the following build warnings:

[auto build test WARNING on tip/irq/core]
[also build test WARNING on linus/master v6.11-rc5 next-20240826]
[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/Jeff-Xie/genirq-procfs-Make-smp_affinity-read-only-for-interrupts-that-userspace-can-t-set/20240826-153926
base: tip/irq/core
patch link: https://lore.kernel.org/r/20240825131911.107119-1-jeff.xie%40linux.dev
patch subject: [PATCH v2] genirq: procfs: Make smp_affinity read-only for interrupts that userspace can't set
config: openrisc-allnoconfig (https://download.01.org/0day-ci/archive/20240827/202408271311.szIyk0et-lkp@xxxxxxxxx/config)
compiler: or1k-linux-gcc (GCC) 14.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240827/202408271311.szIyk0et-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/202408271311.szIyk0et-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

kernel/irq/proc.c: In function 'register_irq_proc':
>> kernel/irq/proc.c:343:17: warning: unused variable 'umode' [-Wunused-variable]
343 | umode_t umode = S_IRUGO;
| ^~~~~


vim +/umode +343 kernel/irq/proc.c

337
338 void register_irq_proc(unsigned int irq, struct irq_desc *desc)
339 {
340 static DEFINE_MUTEX(register_lock);
341 void __maybe_unused *irqp = (void *)(unsigned long) irq;
342 char name [MAX_NAMELEN];
> 343 umode_t umode = S_IRUGO;
344
345 if (!root_irq_dir || (desc->irq_data.chip == &no_irq_chip))
346 return;
347
348 /*
349 * irq directories are registered only when a handler is
350 * added, not when the descriptor is created, so multiple
351 * tasks might try to register at the same time.
352 */
353 mutex_lock(&register_lock);
354
355 if (desc->dir)
356 goto out_unlock;
357
358 sprintf(name, "%d", irq);
359
360 /* create /proc/irq/1234 */
361 desc->dir = proc_mkdir(name, root_irq_dir);
362 if (!desc->dir)
363 goto out_unlock;
364

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