Re: [PATCH 1/1] mxser, remove it

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> +	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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux