Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 71096
b: refs/heads/master
c: 75e8b71
h: refs/heads/master
v: v3
  • Loading branch information
Maciej W. Rozycki authored and Linus Torvalds committed Oct 18, 2007
1 parent f4695c7 commit 335603e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 77bf2bab91e4e7df361963451c7b9a803516438c
refs/heads/master: 75e8b71d559632dd70c9799ea8b5c133a2ddcea9
11 changes: 8 additions & 3 deletions trunk/drivers/char/tty_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,8 @@ EXPORT_SYMBOL(tty_termios_input_baud_rate);
* and will all go away once this is done.
*/

void tty_termios_encode_baud_rate(struct ktermios *termios, speed_t ibaud, speed_t obaud)
void tty_termios_encode_baud_rate(struct ktermios *termios,
speed_t ibaud, speed_t obaud)
{
int i = 0;
int ifound = -1, ofound = -1;
Expand Down Expand Up @@ -263,11 +264,15 @@ void tty_termios_encode_baud_rate(struct ktermios *termios, speed_t ibaud, speed
*/

do {
if (obaud - oclose >= baud_table[i] && obaud + oclose <= baud_table[i]) {
if (obaud - oclose <= baud_table[i] &&
obaud + oclose >= baud_table[i]) {
termios->c_cflag |= baud_bits[i];
ofound = i;
}
if (ibaud - iclose >= baud_table[i] && ibaud + iclose <= baud_table[i]) {
if (ibaud - iclose <= baud_table[i] &&
ibaud + iclose >= baud_table[i]) {
/* For the case input == output don't set IBAUD bits
if the user didn't do so */
if (ofound == i && !ibinput)
ifound = i;
#ifdef IBSHIFT
Expand Down

0 comments on commit 335603e

Please sign in to comment.