aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char
diff options
context:
space:
mode:
authorHarvey Harrison <harvey.harrison@gmail.com>2008-04-30 03:53:51 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-30 11:29:44 -0400
commit709107fcd3c4ad82ff7c8137c27aa951d671706f (patch)
tree8d6fa7483f4c6acccac8d5f6e2330610bdf62cdf /drivers/char
parentd3ceb6562bfbe8f27fa32d1e24eea0e2d4de0347 (diff)
char: rocket.c: fix sparse variable shadowing and int as NULL pointer
Nested min() macros shadow _x, separate into two lines. drivers/char/rocket.c:451:7: warning: symbol '_x' shadows an earlier one drivers/char/rocket.c:451:7: originally declared here drivers/char/rocket.c:451:7: warning: symbol '_x' shadows an earlier one drivers/char/rocket.c:451:7: originally declared here drivers/char/rocket.c:451:7: warning: symbol '_y' shadows an earlier one drivers/char/rocket.c:451:7: originally declared here drivers/char/rocket.c:1754:7: warning: symbol '_x' shadows an earlier one drivers/char/rocket.c:1754:7: originally declared here drivers/char/rocket.c:1754:7: warning: symbol '_x' shadows an earlier one drivers/char/rocket.c:1754:7: originally declared here drivers/char/rocket.c:1754:7: warning: symbol '_y' shadows an earlier one drivers/char/rocket.c:1754:7: originally declared here drivers/char/rocket.c:1751:20: warning: Using plain integer as NULL pointer Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/rocket.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/char/rocket.c b/drivers/char/rocket.c
index 1b3fc6fd358e..32fe8dca24b6 100644
--- a/drivers/char/rocket.c
+++ b/drivers/char/rocket.c
@@ -449,7 +449,8 @@ static void rp_do_transmit(struct r_port *info)
449 while (1) { 449 while (1) {
450 if (tty->stopped || tty->hw_stopped) 450 if (tty->stopped || tty->hw_stopped)
451 break; 451 break;
452 c = min(info->xmit_fifo_room, min(info->xmit_cnt, XMIT_BUF_SIZE - info->xmit_tail)); 452 c = min(info->xmit_fifo_room, info->xmit_cnt);
453 c = min(c, XMIT_BUF_SIZE - info->xmit_tail);
453 if (c <= 0 || info->xmit_fifo_room <= 0) 454 if (c <= 0 || info->xmit_fifo_room <= 0)
454 break; 455 break;
455 sOutStrW(sGetTxRxDataIO(cp), (unsigned short *) (info->xmit_buf + info->xmit_tail), c / 2); 456 sOutStrW(sGetTxRxDataIO(cp), (unsigned short *) (info->xmit_buf + info->xmit_tail), c / 2);
@@ -1758,10 +1759,10 @@ static int rp_write(struct tty_struct *tty,
1758 1759
1759 /* Write remaining data into the port's xmit_buf */ 1760 /* Write remaining data into the port's xmit_buf */
1760 while (1) { 1761 while (1) {
1761 if (!info->tty) /* Seemingly obligatory check... */ 1762 if (!info->tty) /* Seemingly obligatory check... */
1762 goto end; 1763 goto end;
1763 1764 c = min(count, XMIT_BUF_SIZE - info->xmit_cnt - 1);
1764 c = min(count, min(XMIT_BUF_SIZE - info->xmit_cnt - 1, XMIT_BUF_SIZE - info->xmit_head)); 1765 c = min(c, XMIT_BUF_SIZE - info->xmit_head);
1765 if (c <= 0) 1766 if (c <= 0)
1766 break; 1767 break;
1767 1768