CC: [email protected]
BCC: [email protected]
TO: Jim Cromie <[email protected]>

tree:   https://github.com/jimc/linux.git dyndbg-next
head:   d5414e4a36850aa4acd1024e477a5da9efb2fb73
commit: b354c51c63aa31f1646329412608ffee1b34a629 [4/5] dyndbg: add 
DEFINE_DYNAMIC_DEBUG_CLASSES macro
:::::: branch date: 15 hours ago
:::::: commit date: 15 hours ago
config: x86_64-randconfig-m001-20220328 
(https://download.01.org/0day-ci/archive/20220329/[email protected]/config)
compiler: gcc-9 (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>
Reported-by: Dan Carpenter <[email protected]>

smatch warnings:
lib/dynamic_debug.c:637 param_set_dyndbg_class_strings() warn: this array is 
probably non-NULL. 'dcp->classes'
lib/dynamic_debug.c:658 param_set_dyndbg_class_strings() error: uninitialized 
symbol 'negate'.
lib/dynamic_debug.c:669 param_set_dyndbg_class_strings() error: uninitialized 
symbol 'inbits'.

vim +637 lib/dynamic_debug.c

b354c51c63aa31 Jim Cromie 2021-07-28  623  
b354c51c63aa31 Jim Cromie 2021-07-28  624  static int 
param_set_dyndbg_class_strings(const char *instr, const struct kernel_param *kp)
b354c51c63aa31 Jim Cromie 2021-07-28  625  {
b354c51c63aa31 Jim Cromie 2021-07-28  626       unsigned long inbits;
b354c51c63aa31 Jim Cromie 2021-07-28  627       int idx_rc, matches = 0, totct 
= 0;
b354c51c63aa31 Jim Cromie 2021-07-28  628       char query[FMT_QUERY_SIZE];
b354c51c63aa31 Jim Cromie 2021-07-28  629       struct dyndbg_classes_param 
*dcp = kp->arg;
b354c51c63aa31 Jim Cromie 2021-07-28  630       bool negate;
b354c51c63aa31 Jim Cromie 2021-07-28  631       char *cls, *p;
b354c51c63aa31 Jim Cromie 2021-07-28  632  
b354c51c63aa31 Jim Cromie 2021-07-28  633       if (!dcp) {
b354c51c63aa31 Jim Cromie 2021-07-28  634               
pr_err("set_dyndbg_classes: no bits=>queries map\n");
b354c51c63aa31 Jim Cromie 2021-07-28  635               return -EINVAL;
b354c51c63aa31 Jim Cromie 2021-07-28  636       }
b354c51c63aa31 Jim Cromie 2021-07-28 @637       if (!dcp->classes) {
b354c51c63aa31 Jim Cromie 2021-07-28  638               pr_err("module 
-get-classes: no classes\n");
b354c51c63aa31 Jim Cromie 2021-07-28  639               return -EINVAL;
b354c51c63aa31 Jim Cromie 2021-07-28  640       }
b354c51c63aa31 Jim Cromie 2021-07-28  641       cls = kstrdup(instr, 
GFP_KERNEL);
b354c51c63aa31 Jim Cromie 2021-07-28  642  
b354c51c63aa31 Jim Cromie 2021-07-28  643       for (p = strchr(cls, ','); cls; 
cls = strchr(p, ',')) {
b354c51c63aa31 Jim Cromie 2021-07-28  644               if (p)
b354c51c63aa31 Jim Cromie 2021-07-28  645                       *p++ = 0; /* 
chop and advance on comma */
b354c51c63aa31 Jim Cromie 2021-07-28  646               if (*cls == '!') {
b354c51c63aa31 Jim Cromie 2021-07-28  647                       negate = true;
b354c51c63aa31 Jim Cromie 2021-07-28  648                       cls++;
b354c51c63aa31 Jim Cromie 2021-07-28  649               } else if (*(p - 1) == 
'!') {
b354c51c63aa31 Jim Cromie 2021-07-28  650                       negate = true;
b354c51c63aa31 Jim Cromie 2021-07-28  651                       *(p - 1) = '0';
b354c51c63aa31 Jim Cromie 2021-07-28  652               }
b354c51c63aa31 Jim Cromie 2021-07-28  653               idx_rc = 
match_string(dcp->classes, _DPRINTK_CLASS_DFLT, cls);
b354c51c63aa31 Jim Cromie 2021-07-28  654               if (idx_rc < 0) {
b354c51c63aa31 Jim Cromie 2021-07-28  655                       pr_err("%s not 
found for module: %s\n", cls, KP_MOD_NAME);
b354c51c63aa31 Jim Cromie 2021-07-28  656                       return idx_rc;
b354c51c63aa31 Jim Cromie 2021-07-28  657               }
b354c51c63aa31 Jim Cromie 2021-07-28 @658               if (negate == 
test_bit(idx_rc, dcp->bits))
b354c51c63aa31 Jim Cromie 2021-07-28  659                       continue;
b354c51c63aa31 Jim Cromie 2021-07-28  660  
b354c51c63aa31 Jim Cromie 2021-07-28  661               snprintf(query, 
FMT_QUERY_SIZE, "class %s %c%s",
b354c51c63aa31 Jim Cromie 2021-07-28  662                        cls, !!negate 
? '-' : '+', dcp->flags);
b354c51c63aa31 Jim Cromie 2021-07-28  663  
b354c51c63aa31 Jim Cromie 2021-07-28  664               matches = 
ddebug_exec_queries(query, KP_MOD_NAME);
b354c51c63aa31 Jim Cromie 2021-07-28  665  
b354c51c63aa31 Jim Cromie 2021-07-28  666               v2pr_info("%d matches 
on class:%s\n", matches, cls);
b354c51c63aa31 Jim Cromie 2021-07-28  667               totct += matches;
b354c51c63aa31 Jim Cromie 2021-07-28  668       }
b354c51c63aa31 Jim Cromie 2021-07-28 @669       *dcp->bits = inbits;
b354c51c63aa31 Jim Cromie 2021-07-28  670       vpr_info("total matches: %d\n", 
totct);
b354c51c63aa31 Jim Cromie 2021-07-28  671       return 0;
b354c51c63aa31 Jim Cromie 2021-07-28  672  }
b354c51c63aa31 Jim Cromie 2021-07-28  673  

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp
_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to