Skip to content

Commit

Permalink
char: rocket.c: fix sparse variable shadowing and int as NULL pointer
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Harvey Harrison authored and Linus Torvalds committed Apr 30, 2008
1 parent d3ceb65 commit 709107f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions drivers/char/rocket.c
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,8 @@ static void rp_do_transmit(struct r_port *info)
while (1) {
if (tty->stopped || tty->hw_stopped)
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)
break;
sOutStrW(sGetTxRxDataIO(cp), (unsigned short *) (info->xmit_buf + info->xmit_tail), c / 2);
Expand Down Expand Up @@ -1758,10 +1759,10 @@ static int rp_write(struct tty_struct *tty,

/* Write remaining data into the port's xmit_buf */
while (1) {
if (!info->tty) /* Seemingly obligatory check... */
if (!info->tty) /* Seemingly obligatory check... */
goto end;

c = min(count, min(XMIT_BUF_SIZE - info->xmit_cnt - 1, XMIT_BUF_SIZE - info->xmit_head));
c = min(count, XMIT_BUF_SIZE - info->xmit_cnt - 1);
c = min(c, XMIT_BUF_SIZE - info->xmit_head);
if (c <= 0)
break;

Expand Down

0 comments on commit 709107f

Please sign in to comment.