public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Staging: speakup: fixed reporting_keystroke variable type
@ 2014-05-17  0:46 Son P. Nguyen
  2014-05-17  7:56 ` Dan Carpenter
  0 siblings, 1 reply; 2+ messages in thread
From: Son P. Nguyen @ 2014-05-17  0:46 UTC (permalink / raw)
  To: w.d.hubbs
  Cc: chris, kirk, samuel.thibault, gregkh, speakup, devel,
	linux-kernel, Son P. Nguyen

From: "Son P. Nguyen" <fastmutex@gmail.com>

Fixed reporting_keystroke type to int instead of bool to quiet sparse
complaints of error cannot size expression.

This is a part of eudyptula-challenge.

Signed-off-by: Son P. Nguyen <fastmutex@gmail.com>
---
 drivers/staging/speakup/fakekey.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/speakup/fakekey.c b/drivers/staging/speakup/fakekey.c
index 4299cf4..44ebb36 100644
--- a/drivers/staging/speakup/fakekey.c
+++ b/drivers/staging/speakup/fakekey.c
@@ -28,7 +28,7 @@
 #define PRESSED 1
 #define RELEASED 0
 
-static DEFINE_PER_CPU(bool, reporting_keystroke);
+static DEFINE_PER_CPU(int, reporting_keystroke);
 
 static struct input_dev *virt_keyboard;
 
@@ -78,10 +78,10 @@ void speakup_fake_down_arrow(void)
 	/* don't change CPU */
 	preempt_disable();
 
-	__this_cpu_write(reporting_keystroke, true);
+	__this_cpu_write(reporting_keystroke, 1);
 	input_report_key(virt_keyboard, KEY_DOWN, PRESSED);
 	input_report_key(virt_keyboard, KEY_DOWN, RELEASED);
-	__this_cpu_write(reporting_keystroke, false);
+	__this_cpu_write(reporting_keystroke, 0);
 
 	/* reenable preemption */
 	preempt_enable();
-- 
1.8.1.2


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

* Re: [PATCH] Staging: speakup: fixed reporting_keystroke variable type
  2014-05-17  0:46 [PATCH] Staging: speakup: fixed reporting_keystroke variable type Son P. Nguyen
@ 2014-05-17  7:56 ` Dan Carpenter
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2014-05-17  7:56 UTC (permalink / raw)
  To: Son P. Nguyen
  Cc: w.d.hubbs, devel, kirk, speakup, gregkh, linux-kernel,
	samuel.thibault, chris

On Sat, May 17, 2014 at 12:46:43AM +0000, Son P. Nguyen wrote:
> From: "Son P. Nguyen" <fastmutex@gmail.com>
> 
> Fixed reporting_keystroke type to int instead of bool to quiet sparse
> complaints of error cannot size expression.
> 
> This is a part of eudyptula-challenge.
> 

This is a bug in Sparse.  The original code is correct.

regards,
dan carpenter


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

end of thread, other threads:[~2014-05-17  8:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-17  0:46 [PATCH] Staging: speakup: fixed reporting_keystroke variable type Son P. Nguyen
2014-05-17  7:56 ` Dan Carpenter

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