Re: [PATCH] tty_ioctl: Fix the baud_table check in encode_baud_rate

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Roel Kluin
Date: Tuesday, October 16, 2007 - 4:05 pm

Since you were sending a fix, possibly I shouldn't comment on this. If so please disregard my
suggestion for a trivial cleanup.

Roel

Maciej W. Rozycki wrote:

if(a - b <= c && a + b >= c)
if(a <= c + b && a + b >= c)
if(c + b >= a && a + b >= c)
if(b >= a - c && b >= c - a)
true, if:
b >= |a - c|
so
		if (oclose >= abs(obaud - baud_table[i])) {

should work as well


similarly,
		if (iclose >= abs(ibaud - baud_table[i])) {

-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] tty_ioctl: Fix the baud_table check in encode_baud ..., Maciej W. Rozycki, (Tue Oct 16, 11:12 am)
Re: [PATCH] tty_ioctl: Fix the baud_table check in encode_ ..., Roel Kluin, (Tue Oct 16, 4:05 pm)
Re: [PATCH] tty_ioctl: Fix the baud_table check in encode_ ..., Maciej W. Rozycki, (Tue Oct 23, 10:27 am)
Re: [PATCH] tty_ioctl: Fix the baud_table check in encode_ ..., Maciej W. Rozycki, (Tue Oct 23, 10:32 am)