summaryrefslogtreecommitdiff
path: root/hw/net
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2014-08-15 18:44:47 +0100
committerPeter Maydell <peter.maydell@linaro.org>2014-08-15 18:44:48 +0100
commit142f4ac5d5e024670ef4725e8943702b027e4218 (patch)
tree244dd20bd9d562a7f22ea8aadefddff719557165 /hw/net
parentf2c85a2f36f57f155cda7bc9f7c42b44f1a2439e (diff)
parent5edbdbcdf882e4220adc7dbf433351077cd1fbbc (diff)
downloadqemu-142f4ac5d5e024670ef4725e8943702b027e4218.tar.gz
Merge remote-tracking branch 'remotes/mjt/tags/trivial-patches-2014-08-15' into staging
trivial patches for 2014-08-15 # gpg: Signature made Fri 15 Aug 2014 16:13:03 BST using RSA key ID A4C3D7DB # gpg: Good signature from "Michael Tokarev <mjt@tls.msk.ru>" # gpg: aka "Michael Tokarev <mjt@corpit.ru>" # gpg: aka "Michael Tokarev <mjt@debian.org>" # gpg: WARNING: This key is not certified with a trusted signature! # gpg: There is no indication that the signature belongs to the owner. # Primary key fingerprint: 6EE1 95D1 886E 8FFB 810D 4324 457C E0A0 8044 65C5 # Subkey fingerprint: 6F67 E18E 7C91 C5B1 5514 66A7 BEE5 9D74 A4C3 D7DB * remotes/mjt/tags/trivial-patches-2014-08-15: ivshmem: check the value returned by fstat() l2cap: fix access to freed memory intc: i8259: Convert Array allocation to g_new0 ppc: convert g_new(qemu_irq usages to g_new0 ssi: xilinx_spi: Initialise CS GPIOs as NULL vl: free err qemu-options.hx: fix typo about l2tpv3 vmxnet3: don't use 'Yoda conditions' vl: don't use 'Yoda conditions' spice: don't use 'Yoda conditions' don't use 'Yoda conditions' isa-bus: don't use 'Yoda conditions' audio: don't use 'Yoda conditions' usb: don't use 'Yoda conditions' CODING_STYLE: Section about conditional statement pci-host: update uncorresponding description pci-host: update obsolete reference about piix_pci.c qemu-options.hx: fix a typo of chardev memory: Update obsolete comment about AddrRange field type apic: Fix reported DFR content Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/net')
-rw-r--r--hw/net/vmxnet3.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/hw/net/vmxnet3.c b/hw/net/vmxnet3.c
index 77bea6f89f..588149d8b6 100644
--- a/hw/net/vmxnet3.c
+++ b/hw/net/vmxnet3.c
@@ -1009,7 +1009,7 @@ vmxnet3_indicate_packet(VMXNET3State *s)
vmxnet3_dump_rx_descr(&rxd);
- if (0 != ready_rxcd_pa) {
+ if (ready_rxcd_pa != 0) {
cpu_physical_memory_write(ready_rxcd_pa, &rxcd, sizeof(rxcd));
}
@@ -1020,7 +1020,7 @@ vmxnet3_indicate_packet(VMXNET3State *s)
rxcd.gen = new_rxcd_gen;
rxcd.rqID = RXQ_IDX + rx_ridx * s->rxq_num;
- if (0 == bytes_left) {
+ if (bytes_left == 0) {
vmxnet3_rx_update_descr(s->rx_pkt, &rxcd);
}
@@ -1038,16 +1038,16 @@ vmxnet3_indicate_packet(VMXNET3State *s)
num_frags++;
}
- if (0 != ready_rxcd_pa) {
+ if (ready_rxcd_pa != 0) {
rxcd.eop = 1;
- rxcd.err = (0 != bytes_left);
+ rxcd.err = (bytes_left != 0);
cpu_physical_memory_write(ready_rxcd_pa, &rxcd, sizeof(rxcd));
/* Flush RX descriptor changes */
smp_wmb();
}
- if (0 != new_rxcd_pa) {
+ if (new_rxcd_pa != 0) {
vmxnet3_revert_rxc_descr(s, RXQ_IDX);
}
@@ -1190,8 +1190,8 @@ static void vmxnet3_update_mcast_filters(VMXNET3State *s)
s->mcast_list_len = list_bytes / sizeof(s->mcast_list[0]);
s->mcast_list = g_realloc(s->mcast_list, list_bytes);
- if (NULL == s->mcast_list) {
- if (0 == s->mcast_list_len) {
+ if (!s->mcast_list) {
+ if (s->mcast_list_len == 0) {
VMW_CFPRN("Current multicast list is empty");
} else {
VMW_ERPRN("Failed to allocate multicast list of %d elements",
@@ -1667,7 +1667,7 @@ vmxnet3_io_bar1_write(void *opaque,
* memory address. We save it to temp variable and set the
* shared address only after we get the high part
*/
- if (0 == val) {
+ if (val == 0) {
s->device_active = false;
}
s->temp_shared_guest_driver_memory = val;