mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: Jiri Slaby <jirislaby@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	<linux-kernel@vger.kernel.org>, Adrian Bunk <bunk@kernel.org>,
	Michael Tokarev <mjt@tls.msk.ru>,
	Jiri Slaby <jirislaby@gmail.com>
Subject: Re: [PATCH 1/1] mxser, remove it
Date: Sat, 29 Dec 2007 02:29:30 +0000	[thread overview]
Message-ID: <20071229022930.2c66c694@the-village.bc.nu> (raw)
In-Reply-To: <1198836540-8042-1-git-send-email-jirislaby@gmail.com>

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


  parent reply	other threads:[~2007-12-29  2:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-28 10:09 Jiri Slaby
2007-12-29  1:29 ` Jan Engelhardt
2007-12-29  2:23   ` Alan Cox
2007-12-29 16:09     ` Jiri Slaby
2007-12-29  2:29 ` Alan Cox [this message]
  -- strict thread matches above, loose matches on Subject: below --
2007-12-27 13:38 Jiri Slaby
2007-12-27 15:19 ` Michael Tokarev
2007-12-27 17:21   ` Adrian Bunk
2007-12-27 20:54     ` Jiri Slaby

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071229022930.2c66c694@the-village.bc.nu \
    --to=alan@lxorguk.ukuu.org.uk \
    --cc=akpm@linux-foundation.org \
    --cc=bunk@kernel.org \
    --cc=jirislaby@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mjt@tls.msk.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®