[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 1/2] slirp: remove duplicate definition
From: |
Jan Kiszka |
Subject: |
Re: [Qemu-devel] [PATCH 1/2] slirp: remove duplicate definition |
Date: |
Fri, 17 Feb 2012 14:43:55 +0100 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 |
On 2012-02-15 09:30, Jan Kiszka wrote:
> On 2012-02-15 09:12, address@hidden wrote:
>> From: Zhi Yong Wu <address@hidden>
>>
>> Signed-off-by: Zhi Yong Wu <address@hidden>
>> ---
>> slirp/if.c | 2 --
>> 1 files changed, 0 insertions(+), 2 deletions(-)
>>
>> diff --git a/slirp/if.c b/slirp/if.c
>> index 2852396..8e0cac2 100644
>> --- a/slirp/if.c
>> +++ b/slirp/if.c
>> @@ -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)
>> {
>
> Let's grab the chance and move ifs_init to mbuf.h.
I've pushed the following into queues/slirp now. Michael, please use it
as base for your renaming.
-----8<-----
slirp: Clean up ifs_init
Remove duplicate ifs_init macros, reimplement the logic as static inline
in mbuf.h.
Signed-off-by: Jan Kiszka <address@hidden>
---
slirp/if.c | 2 --
slirp/if.h | 2 --
slirp/mbuf.h | 5 +++++
3 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/slirp/if.c b/slirp/if.c
index 2852396..8e0cac2 100644
--- a/slirp/if.c
+++ b/slirp/if.c
@@ -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)
{
diff --git a/slirp/if.h b/slirp/if.h
index 2dac1c7..3327023 100644
--- a/slirp/if.h
+++ b/slirp/if.h
@@ -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
diff --git a/slirp/mbuf.h b/slirp/mbuf.h
index 0708840..8d7951f 100644
--- a/slirp/mbuf.h
+++ b/slirp/mbuf.h
@@ -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