serial: refactor ASYNC_ flags
commit9a8fdcea16e11afb6fee02d403df5258c78f1581
authorJiri Slaby <jirislaby@gmail.com>
Thu, 11 Jun 2009 11:39:12 +0000 (11 12:39 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 2 Jul 2009 23:49:45 +0000 (2 16:49 -0700)
treec6170ea990b0d9c77b5b176fc0fca413186f5097
parentd1905ce7450ef309f743ee8546b3356532e028c4
serial: refactor ASYNC_ flags

commit 70beaed22cbe12979e55d99b370e147e2e168562 upstream.

Define ASYNCB_* flags which are bit numbers of the ASYNC_* flags.
This is useful for {test,set,clear}_bit.

Also convert each ASYNC_% to be (1 << ASYNCB_%) and define masks
with the macros, not constants.

Tested with:
#include "PATH_TO_KERNEL/include/linux/serial.h"
static struct {
        unsigned int new, old;
} as[] = {
        { ASYNC_HUP_NOTIFY, 0x0001 },
        { ASYNC_FOURPORT, 0x0002 },
...
{ ASYNC_BOOT_ONLYMCA, 0x00400000 },
        { ASYNC_INTERNAL_FLAGS, 0xFFC00000 }
};
...
        for (a = 0; a < ARRAY_SIZE(as); a++)
                if (as[a].old != as[a].new)
                        printf("%.8x != %.8x\n", as[a].old, as[a].new);

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
include/linux/serial.h