* [PATCH] atm/ambassador: fix return code bug
@ 2006-10-01 13:33 Jeff Garzik
0 siblings, 0 replies; only message in thread
From: Jeff Garzik @ 2006-10-01 13:33 UTC (permalink / raw)
To: chas, netdev; +Cc: LKML, Andrew Morton
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.
Signed-off-by: Jeff Garzik <jeff@garzik.org>
diff --git a/drivers/atm/ambassador.c b/drivers/atm/ambassador.c
index 4521a24..da599e6 100644
--- a/drivers/atm/ambassador.c
+++ b/drivers/atm/ambassador.c
@@ -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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2006-10-01 13:33 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-10-01 13:33 [PATCH] atm/ambassador: fix return code bug Jeff Garzik
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome