Patchwork [POWERPC] unsigned speed cannot be negative

login
register
mail settings
Submitter roel kluin
Date Oct. 15, 2008, 12:36 a.m.
Message ID <48F53B0F.5010301@gmail.com>
Download mbox | patch
Permalink /patch/4490/
State Accepted, archived
Commit bb5e6491cae4c5d6ddfa3e173e22efb35f595949
Delegated to: Benjamin Herrenschmidt
Headers show

Comments

roel kluin - Oct. 15, 2008, 12:36 a.m.
unsigned speed cannot be negative

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
N.B. It could be possible that a different fix is needed.

Patch

diff --git a/arch/powerpc/kernel/udbg_16550.c b/arch/powerpc/kernel/udbg_16550.c
index cb01ebc..7b7da8c 100644
--- a/arch/powerpc/kernel/udbg_16550.c
+++ b/arch/powerpc/kernel/udbg_16550.c
@@ -142,7 +142,7 @@  unsigned int udbg_probe_uart_speed(void __iomem *comport, unsigned int clock)
 	speed = (clock / prescaler) / (divisor * 16);
 
 	/* sanity check */
-	if (speed < 0 || speed > (clock / 16))
+	if (speed > (clock / 16))
 		speed = 9600;
 
 	return speed;