diff options
author | Andreas Hansson <andreas.hansson@arm.com> | 2016-01-11 05:52:20 -0500 |
---|---|---|
committer | Andreas Hansson <andreas.hansson@arm.com> | 2016-01-11 05:52:20 -0500 |
commit | 12eb0343784f52994110df7e7fce4a0b639a6ec3 (patch) | |
tree | 12ff1c51b8051bb7e7d889eed499bee0dcd4cd1e /src/dev | |
parent | 7661f1c2bf2b45603264076fabce2eb42373cd18 (diff) | |
download | gem5-12eb0343784f52994110df7e7fce4a0b639a6ec3.tar.xz |
scons: Enable -Wextra by default
Make best use of the compiler, and enable -Wextra as well as
-Wall. There are a few issues that had to be resolved, but they are
all trivial.
Diffstat (limited to 'src/dev')
-rw-r--r-- | src/dev/arm/hdlcd.hh | 2 | ||||
-rw-r--r-- | src/dev/arm/pl011.hh | 2 | ||||
-rw-r--r-- | src/dev/net/ethertap.cc | 2 | ||||
-rw-r--r-- | src/dev/net/ns_gige_reg.h | 3 | ||||
-rw-r--r-- | src/dev/net/pktfifo.hh | 2 | ||||
-rw-r--r-- | src/dev/sparc/iob.cc | 6 | ||||
-rw-r--r-- | src/dev/terminal.cc | 2 |
7 files changed, 11 insertions, 8 deletions
diff --git a/src/dev/arm/hdlcd.hh b/src/dev/arm/hdlcd.hh index 3ce12a24d..721935457 100644 --- a/src/dev/arm/hdlcd.hh +++ b/src/dev/arm/hdlcd.hh @@ -316,7 +316,7 @@ class HDLcd: public AmbaDmaDevice } /** Masked interrupt status register */ - const uint32_t intStatus() const { return int_rawstat & int_mask; } + uint32_t intStatus() const { return int_rawstat & int_mask; } protected: // Pixel output class PixelPump : public BasePixelPump diff --git a/src/dev/arm/pl011.hh b/src/dev/arm/pl011.hh index 936dd81ed..e19c74fa2 100644 --- a/src/dev/arm/pl011.hh +++ b/src/dev/arm/pl011.hh @@ -110,7 +110,7 @@ class Pl011 : public Uart, public AmbaDevice void clearInterrupts(uint16_t ints) { setInterrupts(rawInt & ~ints, imsc); } /** Masked interrupt status register */ - const inline uint16_t maskInt() const { return rawInt & imsc; } + inline uint16_t maskInt() const { return rawInt & imsc; } /** Wrapper to create an event out of the thing */ EventWrapper<Pl011, &Pl011::generateInterrupt> intEvent; diff --git a/src/dev/net/ethertap.cc b/src/dev/net/ethertap.cc index e8d6a363c..e8ece152e 100644 --- a/src/dev/net/ethertap.cc +++ b/src/dev/net/ethertap.cc @@ -241,8 +241,8 @@ EtherTap::process(int revent) packet->length = data_len; memcpy(packet->data, data, data_len); + assert(buffer_offset >= data_len + sizeof(uint32_t)); buffer_offset -= data_len + sizeof(uint32_t); - assert(buffer_offset >= 0); if (buffer_offset > 0) { memmove(buffer, data + data_len, buffer_offset); data_len = ntohl(*(uint32_t *)buffer); diff --git a/src/dev/net/ns_gige_reg.h b/src/dev/net/ns_gige_reg.h index c37c06aed..4cecbb158 100644 --- a/src/dev/net/ns_gige_reg.h +++ b/src/dev/net/ns_gige_reg.h @@ -93,6 +93,7 @@ enum ChipCommandRegister { /* configuration register */ enum ConfigurationRegisters { + CFGR_ZERO = 0x00000000, CFGR_LNKSTS = 0x80000000, CFGR_SPDSTS = 0x60000000, CFGR_SPDSTS1 = 0x40000000, @@ -395,7 +396,7 @@ static inline int SPDSTS_POLARITY(int lnksts) { return (CFGR_SPDSTS1 | CFGR_SPDSTS0 | CFGR_DUPSTS | - (lnksts ? CFGR_LNKSTS : 0)); + (lnksts ? CFGR_LNKSTS : CFGR_ZERO)); } #endif /* __DEV_NS_GIGE_REG_H__ */ diff --git a/src/dev/net/pktfifo.hh b/src/dev/net/pktfifo.hh index 5ef75423c..456c4433b 100644 --- a/src/dev/net/pktfifo.hh +++ b/src/dev/net/pktfifo.hh @@ -106,8 +106,8 @@ class PacketFifo unsigned reserve(unsigned len = 0) { + assert(avail() >= len); _reserved += len; - assert(avail() >= 0); return _reserved; } diff --git a/src/dev/sparc/iob.cc b/src/dev/sparc/iob.cc index c8462b9be..55cb93f37 100644 --- a/src/dev/sparc/iob.cc +++ b/src/dev/sparc/iob.cc @@ -91,7 +91,8 @@ Iob::readIob(PacketPtr pkt) { Addr accessAddr = pkt->getAddr() - iobManAddr; - if (accessAddr >= IntManAddr && accessAddr < IntManAddr + IntManSize) { + assert(IntManAddr == 0); + if (accessAddr < IntManAddr + IntManSize) { int index = (accessAddr - IntManAddr) >> 3; uint64_t data = intMan[index].cpu << 8 | intMan[index].vector << 0; pkt->set(data); @@ -186,7 +187,8 @@ Iob::writeIob(PacketPtr pkt) int index; uint64_t data; - if (accessAddr >= IntManAddr && accessAddr < IntManAddr + IntManSize) { + assert(IntManAddr == 0); + if (accessAddr < IntManAddr + IntManSize) { index = (accessAddr - IntManAddr) >> 3; data = pkt->get<uint64_t>(); intMan[index].cpu = bits(data,12,8); diff --git a/src/dev/terminal.cc b/src/dev/terminal.cc index e653ee115..6db43ef88 100644 --- a/src/dev/terminal.cc +++ b/src/dev/terminal.cc @@ -249,7 +249,7 @@ Terminal::read(uint8_t *buf, size_t len) if (data_fd < 0) panic("Terminal not properly attached.\n"); - size_t ret; + ssize_t ret; do { ret = ::read(data_fd, buf, len); } while (ret == -1 && errno == EINTR); |