rocker: fix clang compiler errors
PATCH 1/1 rocker: fix clang compiler errors
Consolidate all forward typedef declarations to rocker.h.
Signed-off-by David Ahern <[email protected]>
Acked-by Scott Feldman <[email protected]>
--- hw/net/rocker/rocker.c | 4 ++-- hw/net/rocker/rocker.h | 7 +++---- hw/net/rocker/rocker_desc.c | 10 ++++------ hw/net/rocker/rocker_desc.h | 4 ---- hw/net/rocker/rocker_fp.c | 4 ++-- hw/net/rocker/rocker_fp.h | 2 -- hw/net/rocker/rocker_of_dpa.h | 3 --- hw/net/rocker/rocker_world.c | 6 ++---- hw/net/rocker/rocker_world.h | 7 ++----- 9 files changed, 15 insertions(+), 32 deletions(-)
hw/net/rocker/rocker.c +2 -2
@@ -32,7 +32,7 @@#include "rocker_world.h" #include "rocker_of_dpa.h" -typedef struct rocker { +struct rocker {/* private */ PCIDevice parent_obj;/* public */
@@ -65,7 +65,7 @@ typedef struct rocker {World *world_dflt;QLIST_ENTRY (rocker) next; -} Rocker; +};#define ROCKER "rocker"
hw/net/rocker/rocker.h +3 -4
@@ -21,8 +21,6 @@#include "qemu/sockets.h" -#include "rocker_world.h" -#if defined(DEBUG_ROCKER )# define DPRINTF (fmt, ...) \ do { \
@@ -68,11 +66,12 @@ static inline bool ipv6_addr_is_multicast(const Ipv6Addr *addr)return (addr->addr32[0 ] &htonl (0xFF000000 )) ==htonl (0xFF000000 ); } -typedef struct world World ;typedef struct rocker Rocker ; +typedef struct world World ; +typedef struct desc_info DescInfo ; +typedef struct desc_ring DescRing ;Rocker *rocker_find (const char *name); -World *rocker_get_world (Rocker *r,enum rocker_world_type type);uint32_t rocker_fp_ports (Rocker *r);int rocker_event_link_changed (Rocker *r,uint32_t pport,bool link_up); int rocker_event_mac_vlan_seen(Rocker *r, uint32_t pport, uint8_t *addr,
hw/net/rocker/rocker_desc.c +4 -6
@@ -22,9 +22,7 @@#include "rocker_hw.h" #include "rocker_desc.h" -typedef struct desc_info DescInfo ; - -typedef struct desc_ring { +struct desc_ring {hwaddr base_addr;uint32_t size;uint32_t head;
@@ -36,14 +34,14 @@ typedef struct desc_ring {int index;desc_ring_consume *consume;unsigned msix_vector; -} DescRing; +}; -typedef struct desc_info { +struct desc_info {DescRing *ring;RockerDesc desc;char *buf;size_t buf_size; -}DescInfo ; +};uint16_t desc_buf_size (DescInfo *info) {
hw/net/rocker/rocker_desc.h +0 -4
@@ -20,10 +20,6 @@#include "rocker_hw.h" -typedef struct rocker Rocker ; -typedef struct desc_ring DescRing ; -typedef struct desc_info DescInfo ; -typedef int (desc_ring_consume )(Rocker *r,DescInfo *info);uint16_t desc_buf_size (DescInfo *info);
hw/net/rocker/rocker_fp.c +2 -2
@@ -26,7 +26,7 @@ enum duplex {DUPLEX_FULL }; -typedef struct fp_port { +struct fp_port {Rocker *r;World *world;unsigned int index;
@@ -39,7 +39,7 @@ typedef struct fp_port {uint8_t learning;NICState *nic;NICConf conf; -} FpPort; +};bool fp_port_get_link_up (FpPort *port) {
hw/net/rocker/rocker_fp.h +0 -2
@@ -22,9 +22,7 @@#define ROCKER_FP_PORTS_MAX 62 -typedef struct rocker Rocker ;typedef struct fp_port FpPort ; -typedef struct world World ;int fp_port_eg (FpPort *port,const struct iovec *iov,int iovcnt);
hw/net/rocker/rocker_of_dpa.h +0 -3
@@ -17,9 +17,6 @@#ifndef _ROCKER_OF_DPA_H_#define _ROCKER_OF_DPA_H_ -typedef struct rocker Rocker ; -typedef struct world World ; -World *of_dpa_world_alloc (Rocker *r);#endif /* _ROCKER_OF_DPA_H_ */
hw/net/rocker/rocker_world.c +2 -4
@@ -19,13 +19,11 @@#include "rocker.h" #include "rocker_world.h" -typedef struct rocker Rocker ; - -typedef struct world { +struct world {Rocker *r;enum rocker_world_type type;WorldOps *ops; -}World ; +};ssize_t world_ingress (World *world,uint32_t pport,const struct iovec *iov,int iovcnt)
hw/net/rocker/rocker_world.h +2 -5
@@ -19,11 +19,6 @@#include "rocker_hw.h" -typedef struct world World ; -typedef struct rocker Rocker ; -typedef struct rocker_tlv RockerTlv ; -typedef struct desc_info DescInfo ; -enum rocker_world_type {ROCKER_WORLD_TYPE_OF_DPA =ROCKER_PORT_MODE_OF_DPA ,ROCKER_WORLD_TYPE_MAX ,
@@ -60,4 +55,6 @@ Rocker *world_rocker(World *world);enum rocker_world_type world_type (World *world);const char *world_name (World *world); +World *rocker_get_world (Rocker *r,enum rocker_world_type type); +#endif /* _ROCKER_WORLD_H_ */
Signature · 1 line
2.1.0
Quoted 4 lines · Sat, Mar 07, 2015 at 01:06:24AM CET, [email protected] wrote:
Consolidate all forward typedef declarations to
rocker.h.Signed-off-by David Ahern <[email protected]>Acked-by Scott Feldman <[email protected]>
Thanks for taking care of this David.
Acked-by Jiri Pirko <[email protected]>
Stefan Hajnoczi
AppliedQuoted 4 lines · David Ahern
Consolidate all forward typedef declarations to
rocker.h.Signed-off-by David Ahern <[email protected]>Acked-by Scott Feldman <[email protected]>
Quoted 11 lines
--- hw/net/rocker/rocker.c | 4 ++-- hw/net/rocker/rocker.h | 7 +++---- hw/net/rocker/rocker_desc.c | 10 ++++------ hw/net/rocker/rocker_desc.h | 4 ---- hw/net/rocker/rocker_fp.c | 4 ++-- hw/net/rocker/rocker_fp.h | 2 -- hw/net/rocker/rocker_of_dpa.h | 3 --- hw/net/rocker/rocker_world.c | 6 ++---- hw/net/rocker/rocker_world.h | 7 ++----- 9 files changed, 15 insertions(+), 32 deletions(-)
I've squashed this into "rocker: add new rocker switch device" so that git-bisect(1) does not see the source tree in a state where builds fail.
Thanks, applied to my net tree:
https://github.com/stefanha/qemu/commits/net
Stefan