From: Jeff Garzik <jeff@garzik.org>
To: chas@cmf.nrl.navy.mil, netdev@vger.kernel.org
Cc: LKML <linux-kernel@vger.kernel.org>, Andrew Morton <akpm@osdl.org>
Subject: [PATCH] atm/ambassador: fix return code bug
Date: Sun, 1 Oct 2006 09:33:32 -0400 [thread overview]
Message-ID: <20061001133332.GA32354@havoc.gtf.org> (raw)
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
reply other threads:[~2006-10-01 13:33 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20061001133332.GA32354@havoc.gtf.org \
--to=jeff@garzik.org \
--cc=akpm@osdl.org \
--cc=chas@cmf.nrl.navy.mil \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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