Skip to contentSkip to conversation

drivers: staging: speakup: fix sparse "warning: expression using sizeof bool"

PATCH In review Witos 3 participants 6 messages Mar 27, 2015 – Apr 3, 2015 Staging

lore
Share & tools
lore

Witos

author
#0 lore raw

PATCH 1/1 drivers: staging: speakup: fix sparse "warning: expression using sizeof bool"

Changed bool to u8 to get rid of sparse warning.

---
 drivers/staging/speakup/fakekey.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/speakup/fakekey.c +1 -1
index 4299cf4..3dfb6bd 100644
@@ -28,7 +28,7 @@
 #define PRESSED 1
 #define RELEASED 0
 
-static DEFINE_PER_CPU(bool, reporting_keystroke);
+static DEFINE_PER_CPU(u8, reporting_keystroke);
 
 static struct input_dev *virt_keyboard;
 
Signature · 1 line
2.0.5
#1 lore raw
Quoted 1 line · Witos

Changed bool to u8 to get rid of sparse warning.

but i am not getting this warning. which version of sparse are you using?
and why you have sent the same patch two times?

regards
sudip

Quoted 2 lines
#2 lore raw
Quoted 4 lines · Sudip Mukherjee
Quoted 1 line · Witos

Changed bool to u8 to get rid of sparse warning.

but i am not getting this warning. which version of sparse are you using?

sparse 0.5.0, see: http://yarchive.net/comp/linux/bool.html

Quoted 1 line

and why you have sent the same patch two times?

sorry my mistake, first time I wanted send it to myself, I forgot that I filled CC list.

Quoted 6 lines

regards
sudip

Quoted 2 lines
#3 lore raw
Quoted 7 lines · Piotr Witosławski
Quoted 4 lines · Sudip Mukherjee
Quoted 1 line · Witos

Changed bool to u8 to get rid of sparse warning.

but i am not getting this warning. which version of sparse are you using?

sparse 0.5.0, see: http://yarchive.net/comp/linux/bool.html

looks like you have done quite a lot of research on it .. :) i am using 0.5.0-22-gd92353b, and my sparse is not showing me this warning.

regards
sudip

Quoted 12 lines
Quoted 2 lines

and why you have sent the same patch two times?

sorry my mistake, first time I wanted send it to myself, I forgot that I filled CC list.

Quoted 6 lines

regards
sudip

Quoted 2 lines
#4 lore raw

Re: [PATCH] drivers: staging: speakup: fix sparse "warning: expression using sizeof bool"[email protected],

Quoted 11 lines · Sudip Mukherjee
Quoted 7 lines · Piotr Witosławski
Quoted 4 lines · Sudip Mukherjee
Quoted 1 line · Witos

Changed bool to u8 to get rid of sparse warning.

but i am not getting this warning. which version of sparse are you using?

sparse 0.5.0, see: http://yarchive.net/comp/linux/bool.html

looks like you have done quite a lot of research on it .. :) i am using 0.5.0-22-gd92353b, and my sparse is not showing me this warning.

Checked it on the git source, it was moved from default
to the -Wsizeof-bool flag with commit: 2667c2d4ab3342b54283d16f1d62e6d715f3b373. That's why I got the warning and you didn't. If you turn on this flag, you'll get it. It's not really anything important, I'm doing a patch for the eudyptula-challange, if you don't accept it, I'll find sth else in drivers/staging.

Quoted 15 lines

regards
sudip

Quoted 12 lines
Quoted 2 lines

and why you have sent the same patch two times?

sorry my mistake, first time I wanted send it to myself, I forgot that I filled CC list.

Quoted 6 lines

regards
sudip

Quoted 2 lines
#5 lore raw
In reply to Witos
Quoted 12 lines · Witos

Changed bool to u8 to get rid of sparse warning.

---
 drivers/staging/speakup/fakekey.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/speakup/fakekey.c +0 -0
index 4299cf4..3dfb6bd 100644

drivers/staging/speakup/fakekey.c line 31

Quoted 5 lines
drivers/staging/speakup/fakekey.c +1 -1
@@ -28,7 +28,7 @@
 #define PRESSED 1
 #define RELEASED 0
 
-static DEFINE_PER_CPU(bool, reporting_keystroke);
+static DEFINE_PER_CPU(u8, reporting_keystroke);

Why send this twice?

And again, I don't think this is fixing anything, what is wrong with this code?

confused,

greg k-h