qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: David Ahern <dsahern@gmail.com>
To: sfeldma@gmail.com, jiri@resnulli.us, stefanha@gmail.com
Cc: qemu-devel@nongnu.org, David Ahern <dsahern@gmail.com>
Subject: [Qemu-devel] [PATCH] rocker: fix clang compiler errors
Date: Fri,  6 Mar 2015 17:06:24 -0700	[thread overview]
Message-ID: <1425686784-98837-1-git-send-email-dsahern@gmail.com> (raw)

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

             reply	other threads:[~2015-03-07  0:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-07  0:06 David Ahern [this message]
2015-03-07 14:30 ` [Qemu-devel] [PATCH] rocker: fix clang compiler errors Jiri Pirko
2015-03-12 13:18 ` Stefan Hajnoczi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1425686784-98837-1-git-send-email-dsahern@gmail.com \
    --to=dsahern@gmail.com \
    --cc=jiri@resnulli.us \
    --cc=qemu-devel@nongnu.org \
    --cc=sfeldma@gmail.com \
    --cc=stefanha@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).