diff options
author | Jiri Slaby <jslaby@novell.com> | 2009-12-09 15:34:13 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-03-02 17:43:11 -0500 |
commit | a357e777b5982d5f460a2783d697a8a90d497348 (patch) | |
tree | e26b86b5a0dc9c7c8f5b0b3470e8e8301e577c3c /drivers/char | |
parent | 1e091751cdb2c28f9f25041be0dcb4d33e4a833d (diff) |
serial: Char: cyclades, fix compiler warning
With gcc 4.0.2:
drivers/char/cyclades.c: In function 'cyy_interrupt':
drivers/char/cyclades.c:581: warning: 'info' may be used uninitialized in this function
introduced by
: commit 3aeea5b92210083c7cffd4f08a0bb141d3f2d574
: Author: Jiri Slaby <jirislaby@gmail.com>
: AuthorDate: Sat Sep 19 13:13:16 2009 -0700
: Commit: Live-CD User <linux@linux.site>
: CommitDate: Sat Sep 19 13:13:16 2009 -0700
:
: cyclades: introduce cyy_readb/writeb
In fact the true branch which uses uninitialized 'info' can never
happen because chip is always less than ->nchips and channel is
always less than 4 which we alloc.
So behave similar to rx handling and remove the test completely.
I wonder why gcc 4.4.1 doesn't spit a word.
Reported-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Alan Cox <alan@linux.intel.com>
Signed-off-by: Jiri Slaby <jslaby@novell.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/cyclades.c | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/drivers/char/cyclades.c b/drivers/char/cyclades.c index 4254457d3911..274e9651fa36 100644 --- a/drivers/char/cyclades.c +++ b/drivers/char/cyclades.c | |||
@@ -598,12 +598,6 @@ static void cyy_chip_tx(struct cyclades_card *cinfo, unsigned int chip, | |||
598 | save_car = readb(base_addr + (CyCAR << index)); | 598 | save_car = readb(base_addr + (CyCAR << index)); |
599 | cy_writeb(base_addr + (CyCAR << index), save_xir); | 599 | cy_writeb(base_addr + (CyCAR << index), save_xir); |
600 | 600 | ||
601 | /* validate the port# (as configured and open) */ | ||
602 | if (channel + chip * 4 >= cinfo->nports) { | ||
603 | cy_writeb(base_addr + (CySRER << index), | ||
604 | readb(base_addr + (CySRER << index)) & ~CyTxRdy); | ||
605 | goto end; | ||
606 | } | ||
607 | info = &cinfo->ports[channel + chip * 4]; | 601 | info = &cinfo->ports[channel + chip * 4]; |
608 | tty = tty_port_tty_get(&info->port); | 602 | tty = tty_port_tty_get(&info->port); |
609 | if (tty == NULL) { | 603 | if (tty == NULL) { |