From: Jan Kiszka <jan.kiszka@siemens.com>
To: zwu.kernel@gmail.com, mst@redhat.com
Cc: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>,
qemu-devel@nongnu.org, stefanha@linux.vnet.ibm.com
Subject: Re: [Qemu-devel] [PATCH 1/2] slirp: remove duplicate definition
Date: Fri, 17 Feb 2012 14:43:55 +0100 [thread overview]
Message-ID: <4F3E599B.3090004@siemens.com> (raw)
In-Reply-To: <4F3B6D1F.9010607@web.de>
On 2012-02-15 09:30, Jan Kiszka wrote:
> On 2012-02-15 09:12, zwu.kernel@gmail.com wrote:
>> From: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>
>>
>> Signed-off-by: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>
>> ---
>> 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 <jan.kiszka@siemens.com>
---
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
prev parent reply other threads:[~2012-02-17 13:44 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-15 8:12 [Qemu-devel] [PATCH 1/2] slirp: remove duplicate definition zwu.kernel
2012-02-15 8:30 ` Jan Kiszka
2012-02-15 9:38 ` Michael S. Tsirkin
2012-02-15 9:48 ` Jan Kiszka
2012-02-15 23:02 ` Andreas Färber
2012-02-15 23:21 ` Peter Maydell
2012-02-17 13:43 ` Jan Kiszka [this message]
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=4F3E599B.3090004@siemens.com \
--to=jan.kiszka@siemens.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@linux.vnet.ibm.com \
--cc=wuzhy@linux.vnet.ibm.com \
--cc=zwu.kernel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.