From: "Andreas Färber" <afaerber@suse.de>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: zwu.kernel@gmail.com, Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>,
Jan Kiszka <jan.kiszka@web.de>,
qemu-devel@nongnu.org, stefanha@linux.vnet.ibm.com
Subject: Re: [Qemu-devel] [PATCH 1/2] slirp: remove duplicate definition
Date: Thu, 16 Feb 2012 00:02:15 +0100 [thread overview]
Message-ID: <4F3C3977.1060306@suse.de> (raw)
In-Reply-To: <20120215093800.GB30825@redhat.com>
Am 15.02.2012 10:38, schrieb Michael S. Tsirkin:
> why does slirp have all these
> defines in the first place?
>
> slirp/mbuf.h:#define m_nextpkt m_hdr.mh_nextpkt
> slirp/mbuf.h:#define ifs_next m_nextpkt
>
> Seriously, #define for a field name?
We have some such #defines in ibm8514 graphics card code, too (not yet
upstream). It is handy to make code match the datasheet while hiding
some of the implementation details, like two levels of array accesses
into implementation-defined-or-whatever registers.
Doesn't seem to apply here obviously. Maybe historically
m_hdr.mh_nextpkt was m_nextpkt and someone tried to avoid a full
refactoring.
Andreas
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
next prev parent reply other threads:[~2012-02-15 23:02 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 [this message]
2012-02-15 23:21 ` Peter Maydell
2012-02-17 13:43 ` Jan Kiszka
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=4F3C3977.1060306@suse.de \
--to=afaerber@suse.de \
--cc=jan.kiszka@web.de \
--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 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).