[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-trivial] [Qemu-devel] [PATCH v4 34/40] hw/net: Use the IEC bin
From: |
Stefan Weil |
Subject: |
Re: [Qemu-trivial] [Qemu-devel] [PATCH v4 34/40] hw/net: Use the IEC binary prefix definitions |
Date: |
Mon, 11 Jun 2018 21:20:58 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 |
Am 11.06.2018 um 03:14 schrieb Philippe Mathieu-Daudé:
> It eases code review, unit is explicit.
>
> Patch generated using:
>
> $ git grep -E '(1024|2048|4096|8192|(<<|>>).?(10|20|30))' hw/ include/hw/
>
> and modified manually.
>
> Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
> Reviewed-by: Stefan Weil <address@hidden>
> ---
> hw/net/ne2000.h | 5 +++--
> include/hw/net/allwinner_emac.h | 5 +++--
> hw/net/e1000e.c | 7 ++++---
> hw/net/e1000x_common.c | 3 ++-
> hw/net/eepro100.c | 3 +--
> 5 files changed, 13 insertions(+), 10 deletions(-)
>
> diff --git a/hw/net/ne2000.h b/hw/net/ne2000.h
> index adb8021bd1..2cd193e4c6 100644
> --- a/hw/net/ne2000.h
> +++ b/hw/net/ne2000.h
> @@ -1,11 +1,12 @@
> #ifndef HW_NE2000_H
> #define HW_NE2000_H
>
> +#include "qemu/units.h"
> #include "hw/hw.h"
> #include "net/net.h"
>
> -#define NE2000_PMEM_SIZE (32*1024)
> -#define NE2000_PMEM_START (16*1024)
> +#define NE2000_PMEM_SIZE (32 * KiB)
> +#define NE2000_PMEM_START (16 * KiB)
> #define NE2000_PMEM_END (NE2000_PMEM_SIZE+NE2000_PMEM_START)
> #define NE2000_MEM_SIZE NE2000_PMEM_END
>
> diff --git a/include/hw/net/allwinner_emac.h b/include/hw/net/allwinner_emac.h
> index 4cc8aab7ec..905a43deb4 100644
> --- a/include/hw/net/allwinner_emac.h
> +++ b/include/hw/net/allwinner_emac.h
> @@ -23,6 +23,7 @@
> #ifndef ALLWINNER_EMAC_H
> #define ALLWINNER_EMAC_H
>
> +#include "qemu/units.h"
> #include "net/net.h"
> #include "qemu/fifo8.h"
> #include "hw/net/mii.h"
> @@ -125,8 +126,8 @@
> #define EMAC_INT_RX (1 << 8)
>
> /* Due to lack of specifications, size of fifos is chosen arbitrarily */
> -#define TX_FIFO_SIZE (4 * 1024)
> -#define RX_FIFO_SIZE (32 * 1024)
> +#define TX_FIFO_SIZE (4 * KiB)
> +#define RX_FIFO_SIZE (32 * KiB)
>
> #define NUM_TX_FIFOS 2
> #define RX_HDR_SIZE 8
> diff --git a/hw/net/e1000e.c b/hw/net/e1000e.c
> index cda8d48333..510ddb3897 100644
> --- a/hw/net/e1000e.c
> +++ b/hw/net/e1000e.c
> @@ -34,6 +34,7 @@
> */
>
> #include "qemu/osdep.h"
> +#include "qemu/units.h"
> #include "net/net.h"
> #include "net/tap.h"
> #include "qemu/range.h"
> @@ -81,10 +82,10 @@ typedef struct E1000EState {
> #define E1000E_IO_IDX 2
> #define E1000E_MSIX_IDX 3
>
> -#define E1000E_MMIO_SIZE (128 * 1024)
> -#define E1000E_FLASH_SIZE (128 * 1024)
> +#define E1000E_MMIO_SIZE (128 * KiB)
> +#define E1000E_FLASH_SIZE (128 * KiB)
> #define E1000E_IO_SIZE (32)
> -#define E1000E_MSIX_SIZE (16 * 1024)
> +#define E1000E_MSIX_SIZE (16 * KiB)
>
> #define E1000E_MSIX_TABLE (0x0000)
> #define E1000E_MSIX_PBA (0x2000)
> diff --git a/hw/net/e1000x_common.c b/hw/net/e1000x_common.c
> index eb0e097137..09047806f2 100644
> --- a/hw/net/e1000x_common.c
> +++ b/hw/net/e1000x_common.c
> @@ -23,6 +23,7 @@
> */
>
> #include "qemu/osdep.h"
> +#include "qemu/units.h"
> #include "hw/hw.h"
> #include "hw/pci/pci.h"
> #include "net/net.h"
> @@ -111,7 +112,7 @@ bool e1000x_is_oversized(uint32_t *mac, size_t size)
> static const int maximum_ethernet_vlan_size = 1522;
> /* this is the size past which hardware will
> drop packets when setting LPE=1 */
> - static const int maximum_ethernet_lpe_size = 16384;
> + static const int maximum_ethernet_lpe_size = 16 * KiB;
>
> if ((size > maximum_ethernet_lpe_size ||
> (size > maximum_ethernet_vlan_size
> diff --git a/hw/net/eepro100.c b/hw/net/eepro100.c
> index a07a63247e..e761daf551 100644
> --- a/hw/net/eepro100.c
> +++ b/hw/net/eepro100.c
> @@ -41,6 +41,7 @@
> */
>
> #include "qemu/osdep.h"
> +#include "qemu/units.h"
> #include "hw/hw.h"
> #include "hw/pci/pci.h"
> #include "net/net.h"
> @@ -60,8 +61,6 @@
> * changed to pad short packets itself. */
> #define CONFIG_PAD_RECEIVED_FRAMES
>
> -#define KiB 1024
> -
> /* Debug EEPRO100 card. */
> #if 0
> # define DEBUG_EEPRO100
>
Reviewed-by: Stefan Weil <address@hidden>
Thank you!
signature.asc
Description: OpenPGP digital signature
- [Qemu-trivial] [PATCH v4 25/40] hw/nios2: Use the IEC binary prefix definitions, (continued)
- [Qemu-trivial] [PATCH v4 25/40] hw/nios2: Use the IEC binary prefix definitions, Philippe Mathieu-Daudé, 2018/06/10
- [Qemu-trivial] [PATCH v4 26/40] hw/cris: Use the IEC binary prefix definitions, Philippe Mathieu-Daudé, 2018/06/10
- [Qemu-trivial] [PATCH v4 27/40] hw/lm32: Use the IEC binary prefix definitions, Philippe Mathieu-Daudé, 2018/06/10
- [Qemu-trivial] [PATCH v4 28/40] hw/sh4: Use the IEC binary prefix definitions, Philippe Mathieu-Daudé, 2018/06/10
- [Qemu-trivial] [PATCH v4 29/40] hw/mips/r4k: Constify params_size, Philippe Mathieu-Daudé, 2018/06/10
- [Qemu-trivial] [PATCH v4 30/40] hw/mips: Use the IEC binary prefix definitions, Philippe Mathieu-Daudé, 2018/06/10
- [Qemu-trivial] [PATCH v4 32/40] hw/ppc: Use the IEC binary prefix definitions, Philippe Mathieu-Daudé, 2018/06/10
- [Qemu-trivial] [PATCH v4 34/40] hw/net: Use the IEC binary prefix definitions, Philippe Mathieu-Daudé, 2018/06/10
- Re: [Qemu-trivial] [Qemu-devel] [PATCH v4 34/40] hw/net: Use the IEC binary prefix definitions,
Stefan Weil <=
- [Qemu-trivial] [PATCH v4 35/40] hw/usb: Use the IEC binary prefix definitions, Philippe Mathieu-Daudé, 2018/06/10
- [Qemu-trivial] [PATCH v4 36/40] hw/sd: Use the IEC binary prefix definitions, Philippe Mathieu-Daudé, 2018/06/10
- [Qemu-trivial] [PATCH v4 37/40] hw/vfio: Use the IEC binary prefix definitions, Philippe Mathieu-Daudé, 2018/06/10
- [Qemu-trivial] [PATCH v4 38/40] hw/virtio: Use the IEC binary prefix definitions, Philippe Mathieu-Daudé, 2018/06/10
- [Qemu-trivial] [PATCH v4 39/40] hw/rdma: Use the IEC binary prefix definitions, Philippe Mathieu-Daudé, 2018/06/10
- [Qemu-trivial] [PATCH v4 40/40] cutils: Do not include "qemu/units.h" directly, Philippe Mathieu-Daudé, 2018/06/10
- Message not available
- Re: [Qemu-trivial] [PATCH v4 00/40] Use the IEC binary prefix definitions, Michael S. Tsirkin, 2018/06/11