public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] serial: Fix missing bit coverage of ASYNC_FLAGS
@ 2010-05-25 16:26 John Villalovos
  0 siblings, 0 replies; only message in thread
From: John Villalovos @ 2010-05-25 16:26 UTC (permalink / raw)
  To: linux-kernel; +Cc: Alan Cox

It seems that currently ASYNC_FLAGS is one bit short of covering all the bits
of the ASYNC user flags.  In particular it does not cover the ASYNC_AUTOPROBE
bit.

ASYNCB_LAST_USER and ASYNCB_AUTOPROBE are both equal to 15.

Therefore:
ASYNC_AUTOPROBE = 1000 0000 0000 0000
ASYNC_FLAGS     = 0111 1111 1111 1111

So ASYNC_FLAGS is not covering the ASYNC_AUTOPROBE bit.

This patch fixes the issue and with the patch the values will be:
ASYNC_AUTOPROBE = 1000 0000 0000 0000
ASYNC_FLAGS     = 1111 1111 1111 1111

As a side note, doing a "git grep" I didn't find any use of
ASYNC_AUTOPROBE or ASYNCB_AUTOPROBE in the kernel, besides this include
file.

Signed-off-by: John Villalovos <john.l.villalovos@intel.com>

diff --git a/include/linux/serial.h b/include/linux/serial.h
index c8613c3..c3b45ad 100644
--- a/include/linux/serial.h
+++ b/include/linux/serial.h
@@ -151,7 +151,7 @@ struct serial_uart_config {
 #define ASYNC_BUGGY_UART	(1U << ASYNCB_BUGGY_UART)
 #define ASYNC_AUTOPROBE		(1U << ASYNCB_AUTOPROBE)
 
-#define ASYNC_FLAGS		((1U << ASYNCB_LAST_USER) - 1)
+#define ASYNC_FLAGS		((1U << (ASYNCB_LAST_USER + 1)) - 1)
 #define ASYNC_USR_MASK		(ASYNC_SPD_HI|ASYNC_SPD_VHI| \
 		ASYNC_CALLOUT_NOHUP|ASYNC_SPD_SHI|ASYNC_LOW_LATENCY)
 #define ASYNC_SPD_CUST		(ASYNC_SPD_HI|ASYNC_SPD_VHI)

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2010-05-25 16:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-25 16:26 [PATCH] serial: Fix missing bit coverage of ASYNC_FLAGS John Villalovos

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