summaryrefslogtreecommitdiffstats
path: root/hw/smc91c111.c
diff options
context:
space:
mode:
authorBlue Swirl <blauwirbel@gmail.com>2010-04-25 19:31:06 +0000
committerBlue Swirl <blauwirbel@gmail.com>2010-04-25 19:31:06 +0000
commit22ed1d34789b184aaaa28c1e4620ce4467744cec (patch)
tree1402cbaab355bffa77a60e37c74ef54c3032b45d /hw/smc91c111.c
parent7f5b7d3e2c19c0aa52dcac0a10d473c7fd142450 (diff)
downloadhqemu-22ed1d34789b184aaaa28c1e4620ce4467744cec.zip
hqemu-22ed1d34789b184aaaa28c1e4620ce4467744cec.tar.gz
arm: remove dead assignments, spotted by clang analyzer
Value stored is never read. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'hw/smc91c111.c')
-rw-r--r--hw/smc91c111.c35
1 files changed, 18 insertions, 17 deletions
diff --git a/hw/smc91c111.c b/hw/smc91c111.c
index e4a2447..f7d58e1 100644
--- a/hw/smc91c111.c
+++ b/hw/smc91c111.c
@@ -160,7 +160,6 @@ static void smc91c111_do_tx(smc91c111_state *s)
int i;
int len;
int control;
- int add_crc;
int packetnum;
uint8_t *p;
@@ -187,20 +186,22 @@ static void smc91c111_do_tx(smc91c111_state *s)
len = 64;
}
#if 0
- /* The card is supposed to append the CRC to the frame. However
- none of the other network traffic has the CRC appended.
- Suspect this is low level ethernet detail we don't need to worry
- about. */
- add_crc = (control & 0x10) || (s->tcr & TCR_NOCRC) == 0;
- if (add_crc) {
- uint32_t crc;
-
- crc = crc32(~0, p, len);
- memcpy(p + len, &crc, 4);
- len += 4;
+ {
+ int add_crc;
+
+ /* The card is supposed to append the CRC to the frame.
+ However none of the other network traffic has the CRC
+ appended. Suspect this is low level ethernet detail we
+ don't need to worry about. */
+ add_crc = (control & 0x10) || (s->tcr & TCR_NOCRC) == 0;
+ if (add_crc) {
+ uint32_t crc;
+
+ crc = crc32(~0, p, len);
+ memcpy(p + len, &crc, 4);
+ len += 4;
+ }
}
-#else
- add_crc = 0;
#endif
if (s->ctr & CTR_AUTO_RELEASE)
/* Race? */
@@ -670,14 +671,14 @@ static ssize_t smc91c111_receive(VLANClientState *nc, const uint8_t *buf, size_t
*(p++) = crc & 0xff; crc >>= 8;
*(p++) = crc & 0xff; crc >>= 8;
*(p++) = crc & 0xff; crc >>= 8;
- *(p++) = crc & 0xff; crc >>= 8;
+ *(p++) = crc & 0xff;
}
if (size & 1) {
*(p++) = buf[size - 1];
- *(p++) = 0x60;
+ *p = 0x60;
} else {
*(p++) = 0;
- *(p++) = 0x40;
+ *p = 0x40;
}
/* TODO: Raise early RX interrupt? */
s->int_level |= INT_RCV;
OpenPOWER on IntegriCloud