Skip to content

Commit

Permalink
slirp: Clean up ifs_init
Browse files Browse the repository at this point in the history
Remove duplicate ifs_init macros, reimplement the logic as static inline
in mbuf.h.

CC: Zhi Yong Wu <[email protected]>
CC: Michael S. Tsirkin <[email protected]>
Signed-off-by: Jan Kiszka <[email protected]>
  • Loading branch information
jan-kiszka committed Feb 27, 2012
1 parent b4bd0b1 commit 79e7e93
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 0 additions & 2 deletions slirp/if.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
#include <slirp.h>
#include "qemu-timer.h"

#define ifs_init(ifm) ((ifm)->ifs_next = (ifm)->ifs_prev = (ifm))

static void
ifs_insque(struct mbuf *ifm, struct mbuf *ifmhead)
{
Expand Down
2 changes: 0 additions & 2 deletions slirp/if.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,4 @@
/* 2 for alignment, 14 for ethernet, 40 for TCP/IP */
#define IF_MAXLINKHDR (2 + 14 + 40)

#define ifs_init(ifm) ((ifm)->ifs_next = (ifm)->ifs_prev = (ifm))

#endif
5 changes: 5 additions & 0 deletions slirp/mbuf.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,4 +124,9 @@ void m_adj(struct mbuf *, int);
int m_copy(struct mbuf *, struct mbuf *, int, int);
struct mbuf * dtom(Slirp *, void *);

static inline void ifs_init(struct mbuf *ifm)
{
ifm->ifs_next = ifm->ifs_prev = ifm;
}

#endif

0 comments on commit 79e7e93

Please sign in to comment.