Commit 709107fc authored by Harvey Harrison's avatar Harvey Harrison Committed by Linus Torvalds

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: default avatarHarvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent d3ceb656
...@@ -449,7 +449,8 @@ static void rp_do_transmit(struct r_port *info) ...@@ -449,7 +449,8 @@ static void rp_do_transmit(struct r_port *info)
while (1) { while (1) {
if (tty->stopped || tty->hw_stopped) if (tty->stopped || tty->hw_stopped)
break; break;
c = min(info->xmit_fifo_room, min(info->xmit_cnt, XMIT_BUF_SIZE - info->xmit_tail)); c = min(info->xmit_fifo_room, info->xmit_cnt);
c = min(c, XMIT_BUF_SIZE - info->xmit_tail);
if (c <= 0 || info->xmit_fifo_room <= 0) if (c <= 0 || info->xmit_fifo_room <= 0)
break; break;
sOutStrW(sGetTxRxDataIO(cp), (unsigned short *) (info->xmit_buf + info->xmit_tail), c / 2); 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,10 +1759,10 @@ static int rp_write(struct tty_struct *tty,
/* Write remaining data into the port's xmit_buf */ /* Write remaining data into the port's xmit_buf */
while (1) { while (1) {
if (!info->tty) /* Seemingly obligatory check... */ if (!info->tty) /* Seemingly obligatory check... */
goto end; goto end;
c = min(count, XMIT_BUF_SIZE - info->xmit_cnt - 1);
c = min(count, min(XMIT_BUF_SIZE - info->xmit_cnt - 1, XMIT_BUF_SIZE - info->xmit_head)); c = min(c, XMIT_BUF_SIZE - info->xmit_head);
if (c <= 0) if (c <= 0)
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment