* [Qemu-devel] [PATCH] rocker: fix clang compiler errors
@ 2015-03-07 0:06 David Ahern
2015-03-07 14:30 ` Jiri Pirko
2015-03-12 13:18 ` Stefan Hajnoczi
0 siblings, 2 replies; 3+ messages in thread
From: David Ahern @ 2015-03-07 0:06 UTC (permalink / raw)
To: sfeldma, jiri, stefanha; +Cc: qemu-devel, David Ahern
Consolidate all forward typedef declarations to rocker.h.
Signed-off-by: David Ahern <dsahern@gmail.com>
Acked-by: Scott Feldman <sfeldma@gmail.com>
---
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(-)
diff --git a/hw/net/rocker/rocker.c b/hw/net/rocker/rocker.c
index 41052750a434..de0f7b96c54e 100644
--- a/hw/net/rocker/rocker.c
+++ b/hw/net/rocker/rocker.c
@@ -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"
diff --git a/hw/net/rocker/rocker.h b/hw/net/rocker/rocker.h
index 656d7226746b..b3310b61ebc2 100644
--- a/hw/net/rocker/rocker.h
+++ b/hw/net/rocker/rocker.h
@@ -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,
diff --git a/hw/net/rocker/rocker_desc.c b/hw/net/rocker/rocker_desc.c
index 0a6dfae63b26..9d896fe470d8 100644
--- a/hw/net/rocker/rocker_desc.c
+++ b/hw/net/rocker/rocker_desc.c
@@ -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)
{
diff --git a/hw/net/rocker/rocker_desc.h b/hw/net/rocker/rocker_desc.h
index 0b57ba75275e..d4041f5c4c58 100644
--- a/hw/net/rocker/rocker_desc.h
+++ b/hw/net/rocker/rocker_desc.h
@@ -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);
diff --git a/hw/net/rocker/rocker_fp.c b/hw/net/rocker/rocker_fp.c
index 75513309f9a3..2f1e3b348a52 100644
--- a/hw/net/rocker/rocker_fp.c
+++ b/hw/net/rocker/rocker_fp.c
@@ -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)
{
diff --git a/hw/net/rocker/rocker_fp.h b/hw/net/rocker/rocker_fp.h
index eb67c64abeec..a5f28f120d5a 100644
--- a/hw/net/rocker/rocker_fp.h
+++ b/hw/net/rocker/rocker_fp.h
@@ -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);
diff --git a/hw/net/rocker/rocker_of_dpa.h b/hw/net/rocker/rocker_of_dpa.h
index 0af479085fa7..f3f6d77807a6 100644
--- a/hw/net/rocker/rocker_of_dpa.h
+++ b/hw/net/rocker/rocker_of_dpa.h
@@ -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_ */
diff --git a/hw/net/rocker/rocker_world.c b/hw/net/rocker/rocker_world.c
index a21829071fbc..b991e871d3b6 100644
--- a/hw/net/rocker/rocker_world.c
+++ b/hw/net/rocker/rocker_world.c
@@ -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)
diff --git a/hw/net/rocker/rocker_world.h b/hw/net/rocker/rocker_world.h
index a84419884c73..18d277b92720 100644
--- a/hw/net/rocker/rocker_world.h
+++ b/hw/net/rocker/rocker_world.h
@@ -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_ */
--
2.1.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] rocker: fix clang compiler errors
2015-03-07 0:06 [Qemu-devel] [PATCH] rocker: fix clang compiler errors David Ahern
@ 2015-03-07 14:30 ` Jiri Pirko
2015-03-12 13:18 ` Stefan Hajnoczi
1 sibling, 0 replies; 3+ messages in thread
From: Jiri Pirko @ 2015-03-07 14:30 UTC (permalink / raw)
To: David Ahern; +Cc: stefanha, sfeldma, qemu-devel
Sat, Mar 07, 2015 at 01:06:24AM CET, dsahern@gmail.com wrote:
>Consolidate all forward typedef declarations to rocker.h.
>
>Signed-off-by: David Ahern <dsahern@gmail.com>
>Acked-by: Scott Feldman <sfeldma@gmail.com>
Thanks for taking care of this David.
Acked-by: Jiri Pirko <jiri@resnulli.us>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] rocker: fix clang compiler errors
2015-03-07 0:06 [Qemu-devel] [PATCH] rocker: fix clang compiler errors David Ahern
2015-03-07 14:30 ` Jiri Pirko
@ 2015-03-12 13:18 ` Stefan Hajnoczi
1 sibling, 0 replies; 3+ messages in thread
From: Stefan Hajnoczi @ 2015-03-12 13:18 UTC (permalink / raw)
To: David Ahern; +Cc: jiri, sfeldma, qemu-devel
[-- Attachment #1: Type: text/plain, Size: 932 bytes --]
On Fri, Mar 06, 2015 at 05:06:24PM -0700, David Ahern wrote:
> Consolidate all forward typedef declarations to rocker.h.
>
> Signed-off-by: David Ahern <dsahern@gmail.com>
> Acked-by: Scott Feldman <sfeldma@gmail.com>
> ---
> 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
[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-03-12 13:19 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-07 0:06 [Qemu-devel] [PATCH] rocker: fix clang compiler errors David Ahern
2015-03-07 14:30 ` Jiri Pirko
2015-03-12 13:18 ` Stefan Hajnoczi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).