lkml.org 
[lkml]   [2004]   [Jan]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [2.6 patch] fix a drivers/char/isicom.c compile warning
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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:00    [W:7.071 / U:0.988 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site