From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41834) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1esoI0-0003zZ-6b for qemu-devel@nongnu.org; Mon, 05 Mar 2018 06:28:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1esoHy-0007HN-UF for qemu-devel@nongnu.org; Mon, 05 Mar 2018 06:28:20 -0500 Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Mon, 5 Mar 2018 08:27:25 -0300 Message-Id: <20180305112732.26471-24-f4bug@amsat.org> In-Reply-To: <20180305112732.26471-1-f4bug@amsat.org> References: <20180305112732.26471-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [Qemu-devel] [PATCH v2 23/30] hw/net: use the BYTE-based definitions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-trivial@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org, Dmitry Fleytman , Jason Wang , Stefan Weil , Beniamino Galvani , "open list:Allwinner-a10" 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é --- include/hw/net/allwinner_emac.h | 4 ++-- hw/net/e1000e.c | 6 +++--- hw/net/eepro100.c | 6 ++---- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/include/hw/net/allwinner_emac.h b/include/hw/net/allwinner_emac.h index 4cc8aab7ec..93ec0e7067 100644 --- a/include/hw/net/allwinner_emac.h +++ b/include/hw/net/allwinner_emac.h @@ -125,8 +125,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 * K_BYTE) +#define RX_FIFO_SIZE (32 * K_BYTE) #define NUM_TX_FIFOS 2 #define RX_HDR_SIZE 8 diff --git a/hw/net/e1000e.c b/hw/net/e1000e.c index 16a9417a85..767b35fca8 100644 --- a/hw/net/e1000e.c +++ b/hw/net/e1000e.c @@ -81,10 +81,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 * K_BYTE) +#define E1000E_FLASH_SIZE (128 * K_BYTE) #define E1000E_IO_SIZE (32) -#define E1000E_MSIX_SIZE (16 * 1024) +#define E1000E_MSIX_SIZE (16 * K_BYTE) #define E1000E_MSIX_TABLE (0x0000) #define E1000E_MSIX_PBA (0x2000) diff --git a/hw/net/eepro100.c b/hw/net/eepro100.c index a07a63247e..6fdeb05259 100644 --- a/hw/net/eepro100.c +++ b/hw/net/eepro100.c @@ -60,8 +60,6 @@ * changed to pad short packets itself. */ #define CONFIG_PAD_RECEIVED_FRAMES -#define KiB 1024 - /* Debug EEPRO100 card. */ #if 0 # define DEBUG_EEPRO100 @@ -104,9 +102,9 @@ /* Use 64 word EEPROM. TODO: could be a runtime option. */ #define EEPROM_SIZE 64 -#define PCI_MEM_SIZE (4 * KiB) +#define PCI_MEM_SIZE (4 * K_BYTE) #define PCI_IO_SIZE 64 -#define PCI_FLASH_SIZE (128 * KiB) +#define PCI_FLASH_SIZE (128 * K_BYTE) #define BITS(n, m) (((0xffffffffU << (31 - n)) >> (31 - n + m)) << m) -- 2.16.2