Messages in this thread | | | Date | Sat, 29 Dec 2007 02:29:30 +0000 | From | Alan Cox <> | Subject | Re: [PATCH 1/1] mxser, remove it |
| |
> + if (cmd == MOXA_SET_SPECIAL_BAUD_RATE) { > + int speed; > + > + if (get_user(speed, (int __user *)argp)) > + return -EFAULT; > + if (speed <= 0 || speed > info->max_baud) > + return -EFAULT;
-EINVAL
> + if (!info->tty || !info->tty->termios || !info->ioaddr) > + return 0;
!info->tty and !info->tty->termios can't happen
> + info->tty->termios->c_cflag &= ~(CBAUD | CBAUDEX);
No...
> + for (i = 0; i < BAUD_TABLE_NO; i++) > + if (speed == mxvar_baud_table[i]) > + break; > + if (i == BAUD_TABLE_NO) { > + info->tty->termios->c_cflag |= B_SPEC; > + } else if (speed != 0) > + info->tty->termios->c_cflag |= mxvar_baud_table1[i];
Replace all the above mess with a single tty_encode_baud_rate call
| |