Thread (6 messages) 6 messages, 4 authors, 2021-11-08

Re: [PATCH v4] tty: vt: keyboard: add default switch-case, to handle smatch-warnings in method vt_do_kdgkb_ioctl

From: Jiri Slaby <jirislaby@kernel.org>
Date: 2021-11-08 07:03:29
Also in: lkml

On 07. 11. 21, 4:17, Ajay Garg wrote:
smatch-kchecker gives the following warnings when run on keyboard.c :

vt_do_kdgkb_ioctl() error: uninitialized symbol 'kbs'.
vt_do_kdgkb_ioctl() error: uninitialized symbol 'ret'.

This usually happens when switch has no default case and static
analyzers and even sometimes compilers can’t prove that all possible
values are covered.


Thus, the default switch-case has been added, which sets the values
for the two variables :
Just to shut up random static analyzers? Please don't.


-- 
js
suse labs
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help