tty: mxser: Fix build warning introduced by dfc7b837c7f9 (Re: linux-next: build warni...
authorMatwey V. Kornilov <matwey@sai.msu.ru>
Wed, 22 May 2013 07:13:38 +0000 (11:13 +0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 May 2013 17:26:02 +0000 (10:26 -0700)
Fix build warning at mxser.c introduced by dfc7b837c7f9 (tty: mxser: fix
usage of opmode_ioaddr)

Signed-off-by: Matwey V. Kornilov <matwey@sai.msu.ru>
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/mxser.c

index f97b196693c658727608d8bcf3527874426cf9e4..4c4a236745692ab1ee2e674f5d7dbf0334002dae 100644 (file)
@@ -1674,15 +1674,15 @@ static int mxser_ioctl(struct tty_struct *tty,
                return mxser_ioctl_special(cmd, argp);
 
        if (cmd == MOXA_SET_OP_MODE || cmd == MOXA_GET_OP_MODE) {
-               if (info->board->chip_flag != MOXA_MUST_MU860_HWID)
-                       return -EFAULT;
-
                int p;
                unsigned long opmode;
                static unsigned char ModeMask[] = { 0xfc, 0xf3, 0xcf, 0x3f };
                int shiftbit;
                unsigned char val, mask;
 
+               if (info->board->chip_flag != MOXA_MUST_MU860_HWID)
+                       return -EFAULT;
+
                p = tty->index % 4;
                if (cmd == MOXA_SET_OP_MODE) {
                        if (get_user(opmode, (int __user *) argp))