Skip to contentSkip to conversation

atm/ambassador: fix return code bug

PATCH New Jeff Garzik 1 participant 1 message Oct 1, 2006

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 atm/ambassador: fix return code bug

While auditing a 'may be used uninitialized' warning, I found a minor
bug: make_rate() has the standard error code convention -- zero for success, negative errno on error -- but its return type is defined as unsigned.

Change the return type to reflect reality.

drivers/atm/ambassador.c +2 -2
index 4521a24..da599e6 100644
@@ -915,8 +915,8 @@ #endif
 
 /********** make rate (not quite as much fun as Horizon) **********/
 
-static unsigned int make_rate (unsigned int rate, rounding r,
-			       u16 * bits, unsigned int * actual) {
+static int make_rate (unsigned int rate, rounding r,
+		      u16 * bits, unsigned int * actual) {
   unsigned char exp = -1; // hush gcc
   unsigned int man = -1;  // hush gcc