Re: [PATCH] speakup: genmap: initialization the variable

From: kernel test robot
Date: Wed Aug 14 2024 - 23:48:06 EST


Hi bajing,

kernel test robot noticed the following build warnings:

[auto build test WARNING on linus/master]
[also build test WARNING on v6.11-rc3 next-20240814]
[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/bajing/speakup-genmap-initialization-the-variable/20240815-000631
base: linus/master
patch link: https://lore.kernel.org/r/20240814030243.2138-1-bajing%40cmss.chinamobile.com
patch subject: [PATCH] speakup: genmap: initialization the variable
config: x86_64-randconfig-005-20240815 (https://download.01.org/0day-ci/archive/20240815/202408151133.RcP4kFGW-lkp@xxxxxxxxx/config)
compiler: clang version 18.1.5 (https://github.com/llvm/llvm-project 617a15a9eac96088ae5e9134248d8236e34b91b1)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240815/202408151133.RcP4kFGW-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/202408151133.RcP4kFGW-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

>> drivers/accessibility/speakup/genmap.c:75:3: warning: variable 'lc' is uninitialized when used here [-Wuninitialized]
75 | lc++;
| ^~
drivers/accessibility/speakup/genmap.c:52:31: note: initialize the variable 'lc' to silence this warning
52 | int value, shift_state, i, lc, spk_val = 0, lock_val = 0;
| ^
| = 0
1 warning generated.


vim +/lc +75 drivers/accessibility/speakup/genmap.c

6a5c94d92699b7 Samuel Thibault 2022-06-12 48
6a5c94d92699b7 Samuel Thibault 2022-06-12 49 int
6a5c94d92699b7 Samuel Thibault 2022-06-12 50 main(int argc, char *argv[])
6a5c94d92699b7 Samuel Thibault 2022-06-12 51 {
1cb16586b0aba7 bajing 2024-08-14 52 int value, shift_state, i, lc, spk_val = 0, lock_val = 0;
6a5c94d92699b7 Samuel Thibault 2022-06-12 53 int max_key_used = 0, num_keys_used = 0;
6a5c94d92699b7 Samuel Thibault 2022-06-12 54 struct st_key *this;
6a5c94d92699b7 Samuel Thibault 2022-06-12 55 struct st_key_init *p_init;
6a5c94d92699b7 Samuel Thibault 2022-06-12 56 char buffer[256];
6a5c94d92699b7 Samuel Thibault 2022-06-12 57
6a5c94d92699b7 Samuel Thibault 2022-06-12 58 bzero(key_table, sizeof(key_table));
6a5c94d92699b7 Samuel Thibault 2022-06-12 59 bzero(key_data, sizeof(key_data));
6a5c94d92699b7 Samuel Thibault 2022-06-12 60
6a5c94d92699b7 Samuel Thibault 2022-06-12 61 shift_table[0] = 0;
6a5c94d92699b7 Samuel Thibault 2022-06-12 62 for (i = 1; i <= 16; i++)
6a5c94d92699b7 Samuel Thibault 2022-06-12 63 shift_table[i] = -1;
6a5c94d92699b7 Samuel Thibault 2022-06-12 64
6a5c94d92699b7 Samuel Thibault 2022-06-12 65 if (argc < 2) {
6a5c94d92699b7 Samuel Thibault 2022-06-12 66 fputs("usage: genmap filename\n", stderr);
6a5c94d92699b7 Samuel Thibault 2022-06-12 67 exit(1);
6a5c94d92699b7 Samuel Thibault 2022-06-12 68 }
6a5c94d92699b7 Samuel Thibault 2022-06-12 69
6a5c94d92699b7 Samuel Thibault 2022-06-12 70 for (p_init = init_key_data; p_init->name[0] != '.'; p_init++)
6a5c94d92699b7 Samuel Thibault 2022-06-12 71 add_key(p_init->name, p_init->value, p_init->shift);
6a5c94d92699b7 Samuel Thibault 2022-06-12 72
6a5c94d92699b7 Samuel Thibault 2022-06-12 73 open_input(NULL, argv[1]);
6a5c94d92699b7 Samuel Thibault 2022-06-12 74 while (fgets(buffer, sizeof(buffer), infile)) {
6a5c94d92699b7 Samuel Thibault 2022-06-12 @75 lc++;

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