public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] speakup: genmap: initialization the variable
@ 2024-08-14  3:02 bajing
  2024-08-14  6:01 ` Samuel Thibault
  2024-08-15  3:47 ` kernel test robot
  0 siblings, 2 replies; 3+ messages in thread
From: bajing @ 2024-08-14  3:02 UTC (permalink / raw)
  To: w.d.hubbs
  Cc: chris, kirk, samuel.thibault, nicolas, masahiroy, speakup,
	linux-kernel, bajing

The variable lc is not initialized before use, so the initialization operation on it is added.

Signed-off-by: bajing <bajing@cmss.chinamobile.com>
---
 drivers/accessibility/speakup/genmap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/accessibility/speakup/genmap.c b/drivers/accessibility/speakup/genmap.c
index 0882bab10fb8..a1ea0ce45c20 100644
--- a/drivers/accessibility/speakup/genmap.c
+++ b/drivers/accessibility/speakup/genmap.c
@@ -48,7 +48,7 @@ static int get_shift_value(int state)
 int
 main(int argc, char *argv[])
 {
-	int value, shift_state, i, spk_val = 0, lock_val = 0;
+	int value, shift_state, i, lc, spk_val = 0, lock_val = 0;
 	int max_key_used = 0, num_keys_used = 0;
 	struct st_key *this;
 	struct st_key_init *p_init;
-- 
2.33.0




^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] speakup: genmap: initialization the variable
  2024-08-14  3:02 [PATCH] speakup: genmap: initialization the variable bajing
@ 2024-08-14  6:01 ` Samuel Thibault
  2024-08-15  3:47 ` kernel test robot
  1 sibling, 0 replies; 3+ messages in thread
From: Samuel Thibault @ 2024-08-14  6:01 UTC (permalink / raw)
  To: bajing; +Cc: w.d.hubbs, chris, kirk, nicolas, masahiroy, speakup, linux-kernel

bajing, le mer. 14 août 2024 11:02:43 +0800, a ecrit:
> The variable lc is not initialized before use, so the initialization operation on it is added.
> 
> Signed-off-by: bajing <bajing@cmss.chinamobile.com>
> ---
>  drivers/accessibility/speakup/genmap.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/accessibility/speakup/genmap.c b/drivers/accessibility/speakup/genmap.c
> index 0882bab10fb8..a1ea0ce45c20 100644
> --- a/drivers/accessibility/speakup/genmap.c
> +++ b/drivers/accessibility/speakup/genmap.c
> @@ -48,7 +48,7 @@ static int get_shift_value(int state)
>  int
>  main(int argc, char *argv[])
>  {
> -	int value, shift_state, i, spk_val = 0, lock_val = 0;
> +	int value, shift_state, i, lc, spk_val = 0, lock_val = 0;

You have already sent a patch that does drop the use before
initialization.

Samuel

>  	int max_key_used = 0, num_keys_used = 0;
>  	struct st_key *this;
>  	struct st_key_init *p_init;
> -- 
> 2.33.0
> 
> 
> 

-- 
Samuel
 Cliquez sur le lien qui suit dans ce mail...vous n'avez plus qu'a vous
 inscrire pour gagner de l'argent en restant connecte....et puis faites
 passer le message et vous gagnerez encore plus d'argent ...
 -+- AC in NPC : Neuneu a rencontré le Pere Noël -+-

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] speakup: genmap: initialization the variable
  2024-08-14  3:02 [PATCH] speakup: genmap: initialization the variable bajing
  2024-08-14  6:01 ` Samuel Thibault
@ 2024-08-15  3:47 ` kernel test robot
  1 sibling, 0 replies; 3+ messages in thread
From: kernel test robot @ 2024-08-15  3:47 UTC (permalink / raw)
  To: bajing, w.d.hubbs
  Cc: llvm, oe-kbuild-all, chris, kirk, samuel.thibault, nicolas,
	masahiroy, speakup, linux-kernel, bajing

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@intel.com/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@intel.com/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@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202408151133.RcP4kFGW-lkp@intel.com/

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-08-15  3:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-14  3:02 [PATCH] speakup: genmap: initialization the variable bajing
2024-08-14  6:01 ` Samuel Thibault
2024-08-15  3:47 ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox