[OPW,kernel] Staging: speakup: removing comparison of jiffies
diff mbox

Message ID 20131016110507.GA15088@Ashvini
State Rejected
Headers show

Commit Message

Ashvini Varatharaj Oct. 16, 2013, 11:05 a.m. UTC
Fix checkpatch warning: WARNING: Comparing jiffies is almost always
wrong; prefer time_after, time_before and friends

Signed-off-by: Ashvini Varatharaj <ashvinivaratharaj@gmail.com>
---
 drivers/staging/speakup/Module.symvers |   25 +++++++++++++++++++++++++
 drivers/staging/speakup/main.c         |    2 +-
 2 files changed, 26 insertions(+), 1 deletion(-)
 create mode 100644 drivers/staging/speakup/Module.symvers

Comments

Greg Kroah-Hartman Oct. 16, 2013, 1:13 p.m. UTC | #1
On Wed, Oct 16, 2013 at 04:35:07PM +0530, Ashvini Varatharaj wrote:
> Fix checkpatch warning: WARNING: Comparing jiffies is almost always
> wrong; prefer time_after, time_before and friends
> 
> Signed-off-by: Ashvini Varatharaj <ashvinivaratharaj@gmail.com>
> ---
>  drivers/staging/speakup/Module.symvers |   25 +++++++++++++++++++++++++

Why is this file included in the patch?  It shouldn't.

> --- a/drivers/staging/speakup/main.c
> +++ b/drivers/staging/speakup/main.c
> @@ -2069,7 +2069,7 @@ speakup_key(struct vc_data *vc, int shift_state, int keycode, u_short keysym,
>  			if (up_flag)
>  				goto out;
>  			if (last_keycode == keycode &&
> -			    last_spk_jiffy + MAX_DELAY > jiffies) {
> +			time_after((last_spk_jiffy + MAX_DELAY), jiffies)) {
>  				spk_close_press = 1;

Did you run your patch through checkpatch.pl after making it?  I think
it would have complained about this.  If not, your indentation isn't
correct, as you can see above.

Care to try it again?

thanks,

greg k-h
Ashvini Varatharaj Oct. 16, 2013, 1:53 p.m. UTC | #2
Hey I ran it through checkpatch.pl after make. It is showing line over 80
char warning in other lines no where close to this. And this line doesnt
have any errors or warnings as I checked. Can you tell me what I am
supposed to change?

Thankyou.


*Ashvini Varatharaj *



On Wed, Oct 16, 2013 at 6:43 PM, Greg KH <gregkh@linuxfoundation.org> wrote:

> On Wed, Oct 16, 2013 at 04:35:07PM +0530, Ashvini Varatharaj wrote:
> > Fix checkpatch warning: WARNING: Comparing jiffies is almost always
> > wrong; prefer time_after, time_before and friends
> >
> > Signed-off-by: Ashvini Varatharaj <ashvinivaratharaj@gmail.com>
> > ---
> >  drivers/staging/speakup/Module.symvers |   25 +++++++++++++++++++++++++
>
> Why is this file included in the patch?  It shouldn't.
>
> > --- a/drivers/staging/speakup/main.c
> > +++ b/drivers/staging/speakup/main.c
> > @@ -2069,7 +2069,7 @@ speakup_key(struct vc_data *vc, int shift_state,
> int keycode, u_short keysym,
> >                       if (up_flag)
> >                               goto out;
> >                       if (last_keycode == keycode &&
> > -                         last_spk_jiffy + MAX_DELAY > jiffies) {
> > +                     time_after((last_spk_jiffy + MAX_DELAY), jiffies))
> {
> >                               spk_close_press = 1;
>
> Did you run your patch through checkpatch.pl after making it?  I think
> it would have complained about this.  If not, your indentation isn't
> correct, as you can see above.
>
> Care to try it again?
>
> thanks,
>
> greg k-h
>
Greg Kroah-Hartman Oct. 16, 2013, 2:01 p.m. UTC | #3
A: http://en.wikipedia.org/wiki/Top_post
Q: Were do I find info about this thing called top-posting?
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

A: No.
Q: Should I include quotations after my reply?

http://daringfireball.net/2007/07/on_top

On Wed, Oct 16, 2013 at 07:23:35PM +0530, Ashvini Varatharaj wrote:
> Hey I ran it through checkpatch.pl after make. It is showing line over 80 char
> warning in other lines no where close to this. And this line doesnt have any
> errors or warnings as I checked. Can you tell me what I am supposed to change?

Look at the code, does it now make sense with the indentation that you
are using?  Is it readable and understandable properly?

greg k-h

Patch
diff mbox

diff --git a/drivers/staging/speakup/Module.symvers b/drivers/staging/speakup/Module.symvers
new file mode 100644
index 0000000..0eb706a
--- /dev/null
+++ b/drivers/staging/speakup/Module.symvers
@@ -0,0 +1,25 @@ 
+0xa8d01f22	synth_remove	drivers/staging/speakup/speakup	EXPORT_SYMBOL_GPL
+0xdd825f1a	synth_add	drivers/staging/speakup/speakup	EXPORT_SYMBOL_GPL
+0xe7e810f8	spk_serial_in	drivers/staging/speakup/speakup	EXPORT_SYMBOL_GPL
+0x475e158a	synth_request_region	drivers/staging/speakup/speakup	EXPORT_SYMBOL_GPL
+0x541ad416	spk_var_show	drivers/staging/speakup/speakup	EXPORT_SYMBOL_GPL
+0xbbd15a51	speakup_start_ttys	drivers/staging/speakup/speakup	EXPORT_SYMBOL_GPL
+0xc766ae09	synth_printf	drivers/staging/speakup/speakup	EXPORT_SYMBOL_GPL
+0x4449e1dd	synth_buffer_clear	drivers/staging/speakup/speakup	EXPORT_SYMBOL_GPL
+0x9a888082	synth_buffer_getc	drivers/staging/speakup/speakup	EXPORT_SYMBOL_GPL
+0xde7ae2e8	speakup_info	drivers/staging/speakup/speakup	EXPORT_SYMBOL_GPL
+0x37cdb397	spk_var_store	drivers/staging/speakup/speakup	EXPORT_SYMBOL_GPL
+0x0bfad5d7	spk_synth_is_alive_restart	drivers/staging/speakup/speakup	EXPORT_SYMBOL_GPL
+0x0e81c76d	spk_serial_out	drivers/staging/speakup/speakup	EXPORT_SYMBOL_GPL
+0x14f06fe7	spk_serial_in_nowait	drivers/staging/speakup/speakup	EXPORT_SYMBOL_GPL
+0xcda38867	speakup_event	drivers/staging/speakup/speakup	EXPORT_SYMBOL_GPL
+0x8e146195	synth_release_region	drivers/staging/speakup/speakup	EXPORT_SYMBOL_GPL
+0xf0d524fb	spk_do_catch_up	drivers/staging/speakup/speakup	EXPORT_SYMBOL_GPL
+0x41a160e5	synth_buffer_empty	drivers/staging/speakup/speakup	EXPORT_SYMBOL_GPL
+0x0dee3a00	spk_synth_is_alive_nop	drivers/staging/speakup/speakup	EXPORT_SYMBOL_GPL
+0xb48956f8	synth_buffer_peek	drivers/staging/speakup/speakup	EXPORT_SYMBOL_GPL
+0x8d66d3f3	spk_synth_flush	drivers/staging/speakup/speakup	EXPORT_SYMBOL_GPL
+0xb67b6d52	spk_serial_synth_probe	drivers/staging/speakup/speakup	EXPORT_SYMBOL_GPL
+0xce6ebc6c	spk_synth_immediate	drivers/staging/speakup/speakup	EXPORT_SYMBOL_GPL
+0xd1b551a2	spk_get_var	drivers/staging/speakup/speakup	EXPORT_SYMBOL_GPL
+0xe7cd4558	spk_serial_release	drivers/staging/speakup/speakup	EXPORT_SYMBOL_GPL
diff --git a/drivers/staging/speakup/main.c b/drivers/staging/speakup/main.c
index 47502fa..32b728e 100644
--- a/drivers/staging/speakup/main.c
+++ b/drivers/staging/speakup/main.c
@@ -2069,7 +2069,7 @@  speakup_key(struct vc_data *vc, int shift_state, int keycode, u_short keysym,
 			if (up_flag)
 				goto out;
 			if (last_keycode == keycode &&
-			    last_spk_jiffy + MAX_DELAY > jiffies) {
+			time_after((last_spk_jiffy + MAX_DELAY), jiffies)) {
 				spk_close_press = 1;
 				offset = spk_shift_table[shift_info + 32];
 				/* double press? */