Hi Steven,

kernel test robot noticed the following build warnings:

[auto build test WARNING on trace/for-next]
[also build test WARNING on linus/master v6.18-rc6 next-20251121]
[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/Steven-Rostedt/tracing-Add-system-trigger-file-to-enable-triggers-for-all-the-system-s-events/20251121-050454
base:   https://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace 
for-next
patch link:    
https://lore.kernel.org/r/20251120160003.2fa33d80%40gandalf.local.home
patch subject: [PATCH] tracing: Add system trigger file to enable triggers for 
all the system's events
config: sparc64-defconfig 
(https://download.01.org/0day-ci/archive/20251122/[email protected]/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/20251122/[email protected]/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 <[email protected]>
| Closes: 
https://lore.kernel.org/oe-kbuild-all/[email protected]/

All warnings (new ones prefixed by >>):

>> kernel/trace/trace_events_trigger.c:432:6: warning: variable 'len' set but 
>> not used [-Wunused-but-set-variable]
     432 |         int len;
         |             ^
   1 warning generated.


vim +/len +432 kernel/trace/trace_events_trigger.c

   420  
   421  static ssize_t
   422  event_system_trigger_write(struct file *filp, const char __user *ubuf,
   423                      size_t cnt, loff_t *ppos)
   424  {
   425          struct trace_subsystem_dir *dir = filp->private_data;
   426          struct event_command *p;
   427          char *command, *next;
   428          char *buf __free(kfree) = get_user_buf(ubuf, cnt);
   429          bool remove = false;
   430          bool found = false;
   431          ssize_t ret;
 > 432          int len;
   433  
   434          if (!buf)
   435                  return 0;
   436  
   437          if (IS_ERR(buf))
   438                  return PTR_ERR(buf);
   439  
   440          /* system triggers are not allowed to have counters */
   441          if (strchr(buf, ':'))
   442                  return -EINVAL;
   443  
   444          /* If opened for read too, dir is in the seq_file descriptor */
   445          if (filp->f_mode & FMODE_READ) {
   446                  struct seq_file *m = filp->private_data;
   447                  dir = m->private;
   448          }
   449  
   450          /* Skip added space at beginning of buf */
   451          next = buf;
   452          strim(next);
   453  
   454          command = strsep(&next, " \t");
   455          if (next) {
   456                  next = skip_spaces(next);
   457                  if (!*next)
   458                          next = NULL;
   459          }
   460          if (command[0] == '!') {
   461                  remove = true;
   462                  command++;
   463          }
   464  
   465          len = strlen(command);
   466          if (next)
   467                  len += strlen(next) + 1;
   468  
   469          guard(mutex)(&event_mutex);
   470          guard(mutex)(&trigger_cmd_mutex);
   471  
   472          list_for_each_entry(p, &trigger_commands, list) {
   473                  /* Allow to remove any trigger */
   474                  if (!remove && !(p->flags & EVENT_CMD_FL_SYSTEM))
   475                          continue;
   476                  if (strcmp(p->name, command) == 0) {
   477                          found = true;
   478                          ret = process_system_events(dir, p, buf, 
command, next);
   479                          break;
   480                  }
   481          }
   482  
   483          if (!found)
   484                  ret = -ENODEV;
   485  
   486          if (!ret)
   487                  *ppos += cnt;
   488  
   489          if (remove || ret < 0)
   490                  return ret ? : cnt;
   491  
   492          return cnt;
   493  }
   494  

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

Reply via email to