public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] tty: moxa: fix bit test in moxa_start()
@ 2012-03-07 10:05 Dan Carpenter
  2012-03-07 12:26 ` Jiri Slaby
  2012-03-08 16:08 ` Alan Cox
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2012-03-07 10:05 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-kernel, kernel-janitors

This is supposed to be doing a shift before the comparison instead of
just doing a bitwise AND directly.  The current code means the start()
just returns without doing anything.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/tty/moxa.c b/drivers/tty/moxa.c
index d15a071..0174d2d 100644
--- a/drivers/tty/moxa.c
+++ b/drivers/tty/moxa.c
@@ -1331,7 +1331,7 @@ static void moxa_start(struct tty_struct *tty)
 	if (ch == NULL)
 		return;
 
-	if (!(ch->statusflags & TXSTOPPED))
+	if (!test_bit(TXSTOPPED, &ch->statusflags))
 		return;
 
 	MoxaPortTxEnable(ch);

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

* Re: [patch] tty: moxa: fix bit test in moxa_start()
  2012-03-07 10:05 [patch] tty: moxa: fix bit test in moxa_start() Dan Carpenter
@ 2012-03-07 12:26 ` Jiri Slaby
  2012-03-08 16:08 ` Alan Cox
  1 sibling, 0 replies; 3+ messages in thread
From: Jiri Slaby @ 2012-03-07 12:26 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Greg Kroah-Hartman, linux-kernel, kernel-janitors, Alan Cox,
	Jiri Slaby

On 03/07/2012 11:05 AM, Dan Carpenter wrote:
> This is supposed to be doing a shift before the comparison instead of
> just doing a bitwise AND directly.  The current code means the start()
> just returns without doing anything.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

ACK.

It was introduced by this commit which forgot to change that location:
commit a808ac0c4a2c5d81ba38a2a76d4ddc1de40d1539
Author: Alan Cox <alan@linux.intel.com>
Date:   Mon Nov 30 13:18:02 2009 +0000

    tty: moxa: Locking clean up

> diff --git a/drivers/tty/moxa.c b/drivers/tty/moxa.c
> index d15a071..0174d2d 100644
> --- a/drivers/tty/moxa.c
> +++ b/drivers/tty/moxa.c
> @@ -1331,7 +1331,7 @@ static void moxa_start(struct tty_struct *tty)
>  	if (ch == NULL)
>  		return;
>  
> -	if (!(ch->statusflags & TXSTOPPED))
> +	if (!test_bit(TXSTOPPED, &ch->statusflags))
>  		return;
>  
>  	MoxaPortTxEnable(ch);

thanks,
-- 
js
suse labs

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

* Re: [patch] tty: moxa: fix bit test in moxa_start()
  2012-03-07 10:05 [patch] tty: moxa: fix bit test in moxa_start() Dan Carpenter
  2012-03-07 12:26 ` Jiri Slaby
@ 2012-03-08 16:08 ` Alan Cox
  1 sibling, 0 replies; 3+ messages in thread
From: Alan Cox @ 2012-03-08 16:08 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: Greg Kroah-Hartman, linux-kernel, kernel-janitors

On Wed, 7 Mar 2012 13:05:00 +0300
Dan Carpenter <dan.carpenter@oracle.com> wrote:

> This is supposed to be doing a shift before the comparison instead of
> just doing a bitwise AND directly.  The current code means the start()
> just returns without doing anything.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Acked-by: Alan Cox <alan@linux.intel.com>

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

end of thread, other threads:[~2012-03-08 16:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-07 10:05 [patch] tty: moxa: fix bit test in moxa_start() Dan Carpenter
2012-03-07 12:26 ` Jiri Slaby
2012-03-08 16:08 ` Alan Cox

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