Skip to content

Commit

Permalink
tty: serial: remove set but not used variable 'error'
Browse files Browse the repository at this point in the history
Fixes gcc '-Wunused-but-set-variable' warning:

drivers/tty/serial/pmac_zilog.c: In function 'pmz_receive_chars':
drivers/tty/serial/pmac_zilog.c:222:30: warning:
 variable 'error' set but not used [-Wunused-but-set-variable]

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
YueHaibing authored and Greg Kroah-Hartman committed Sep 20, 2018
1 parent 1cd25cb commit 13b4353
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/tty/serial/pmac_zilog.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ static void pmz_interrupt_control(struct uart_pmac_port *uap, int enable)
static bool pmz_receive_chars(struct uart_pmac_port *uap)
{
struct tty_port *port;
unsigned char ch, r1, drop, error, flag;
unsigned char ch, r1, drop, flag;
int loops = 0;

/* Sanity check, make sure the old bug is no longer happening */
Expand All @@ -231,7 +231,6 @@ static bool pmz_receive_chars(struct uart_pmac_port *uap)
port = &uap->port.state->port;

while (1) {
error = 0;
drop = 0;

r1 = read_zsreg(uap, R1);
Expand Down Expand Up @@ -273,7 +272,6 @@ static bool pmz_receive_chars(struct uart_pmac_port *uap)
uap->port.icount.rx++;

if (r1 & (PAR_ERR | Rx_OVR | CRC_ERR | BRK_ABRT)) {
error = 1;
if (r1 & BRK_ABRT) {
pmz_debug("pmz: got break !\n");
r1 &= ~(PAR_ERR | CRC_ERR);
Expand Down

0 comments on commit 13b4353

Please sign in to comment.