From: Arnaldo Carvalho de Melo <acme@conectiva.com.br>
To: Adrian Bunk <bunk@fs.tum.de>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [2.6 patch] fix a drivers/char/isicom.c compile warning
Date: Mon, 12 Jan 2004 22:17:46 -0200 [thread overview]
Message-ID: <20040113001746.GN18853@conectiva.com.br> (raw)
In-Reply-To: <20040113000055.GU9677@fs.tum.de>
Em Tue, Jan 13, 2004 at 01:00:56AM +0100, Adrian Bunk escreveu:
> I got the following compile warning in 2.6.1-mm2 (but it doesn't seem to
> be specific to -mm):
>
>
> <-- snip -->
>
> ...
> CC [M] drivers/char/isicom.o
> ...
> drivers/char/isicom.c: In function `unregister_drivers':
> drivers/char/isicom.c:1677: warning: `error' might be used uninitialized in this function
> ...
>
> <-- snip -->
>
>
> The following patch fixes this issue:
>
>
> --- linux-2.6.1-mm2-modular-no-smp/drivers/char/isicom.c.old 2004-01-13 00:40:02.000000000 +0100
> +++ linux-2.6.1-mm2-modular-no-smp/drivers/char/isicom.c 2004-01-13 00:49:00.000000000 +0100
> @@ -1675,7 +1675,7 @@
> static void unregister_drivers(void)
> {
> int error;
> - if (tty_unregister_driver(isicom_normal))
> + if ((error=tty_unregister_driver(isicom_normal)))
> printk(KERN_DEBUG "ISICOM: couldn't unregister normal driver error=%d.\n",error);
OK, the patch is right, but couldn't we take the opportunity to make this
more readable while at it? Ssomething like:
static void unregister_drivers(void)
{
int error = tty_unregister_driver(isicom_normal);
if (error)
printk(KERN_DEBUG "ISICOM: couldn't unregister normal "
"driver error=%d.\n", error);
? :-)
- Arnaldo
next prev parent reply other threads:[~2004-01-13 0:07 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-01-13 0:00 [2.6 patch] fix a drivers/char/isicom.c compile warning Adrian Bunk
2004-01-13 0:17 ` Arnaldo Carvalho de Melo [this message]
2004-01-13 0:23 ` Adrian Bunk
2004-01-13 0:38 ` Arnaldo Carvalho de Melo
2004-01-13 11:45 ` Angelo Dell'Aera
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=20040113001746.GN18853@conectiva.com.br \
--to=acme@conectiva.com.br \
--cc=bunk@fs.tum.de \
--cc=linux-kernel@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