Commit ce6bf4c1 authored by Jakub Kicinski's avatar Jakub Kicinski Committed by David S. Miller

sb1000: fix variable set but not used warnings

GCC 8 complains:

drivers/net/sb1000.c: In function ‘card_send_command’:
drivers/net/sb1000.c:319:14: warning: variable ‘x’ set but not used [-Wunused-but-set-variable]
  int status, x;
              ^
drivers/net/sb1000.c: In function ‘sb1000_check_CRC’:
drivers/net/sb1000.c:493:6: warning: variable ‘crc’ set but not used [-Wunused-but-set-variable]
  int crc, status;
      ^~~
Signed-off-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: default avatarDirk van der Merwe <dirk.vandermerwe@netronome.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 503c0188
...@@ -316,7 +316,7 @@ static int ...@@ -316,7 +316,7 @@ static int
card_send_command(const int ioaddr[], const char* name, card_send_command(const int ioaddr[], const char* name,
const unsigned char out[], unsigned char in[]) const unsigned char out[], unsigned char in[])
{ {
int status, x; int status;
if ((status = card_wait_for_busy_clear(ioaddr, name))) if ((status = card_wait_for_busy_clear(ioaddr, name)))
return status; return status;
...@@ -345,9 +345,7 @@ card_send_command(const int ioaddr[], const char* name, ...@@ -345,9 +345,7 @@ card_send_command(const int ioaddr[], const char* name,
out[0], out[1], out[2], out[3], out[4], out[5]); out[0], out[1], out[2], out[3], out[4], out[5]);
} }
if (out[1] == 0x1b) { if (out[1] != 0x1b) {
x = (out[2] == 0x02);
} else {
if (out[0] >= 0x80 && in[0] != (out[1] | 0x80)) if (out[0] >= 0x80 && in[0] != (out[1] | 0x80))
return -EIO; return -EIO;
} }
...@@ -490,14 +488,13 @@ sb1000_check_CRC(const int ioaddr[], const char* name) ...@@ -490,14 +488,13 @@ sb1000_check_CRC(const int ioaddr[], const char* name)
static const unsigned char Command0[6] = {0x80, 0x1f, 0x00, 0x00, 0x00, 0x00}; static const unsigned char Command0[6] = {0x80, 0x1f, 0x00, 0x00, 0x00, 0x00};
unsigned char st[7]; unsigned char st[7];
int crc, status; int status;
/* check CRC */ /* check CRC */
if ((status = card_send_command(ioaddr, name, Command0, st))) if ((status = card_send_command(ioaddr, name, Command0, st)))
return status; return status;
if (st[1] != st[3] || st[2] != st[4]) if (st[1] != st[3] || st[2] != st[4])
return -EIO; return -EIO;
crc = st[1] << 8 | st[2];
return 0; return 0;
} }
......
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