From: "Michael S. Tsirkin" <mst@redhat.com>
To: Isaku Yamahata <yamahata@valinux.co.jp>
Cc: skandasa@cisco.com, adnan@khaleel.us, etmartin@cisco.com,
qemu-devel@nongnu.org, wexu2@cisco.com
Subject: [Qemu-devel] Re: [PATCH v7 2/6] pcie/aer: helper functions for pcie aer capability
Date: Wed, 3 Nov 2010 09:30:49 +0200 [thread overview]
Message-ID: <20101103073049.GB6772@redhat.com> (raw)
In-Reply-To: <20101103012430.GA26077@valinux.co.jp>
On Wed, Nov 03, 2010 at 10:24:30AM +0900, Isaku Yamahata wrote:
> On Tue, Nov 02, 2010 at 02:57:12PM +0200, Michael S. Tsirkin wrote:
> > > +static void pcie_aer_clear_error(PCIDevice *dev);
> > > +static void pcie_aer_msg(PCIDevice *dev, const PCIEAERMsg *msg);
> > > +
> >
> > so what exactly is the order of calls that makes
> > removing the forward declarations impractical?
> > Is there a recursive call? If yes I'd like to
> > see it documented much better.
>
> Why do you think forward declaration is so bad?
> I don't see any such consensus and I don't think they aren't
> accused generally like goto.
> Can you please elaborate why you're trying so hard to prevent it?
Well no, I do not claim they are that bad. In my opinion avoiding them
just makes for a slightly better code usually:
- They make for code duplication where if you change
a function there's another place to edit.
- Just generally add more code.
- Avoiding forward declarations makes you put functions
in some sensible order.
- Also makes you avoid recursion where a loop will do.
But all this doesn't always apply. I was trying to understand
whether there's recursion here that I am missing.
If there is a comment might be helpful.
> --
> yamahata
next prev parent reply other threads:[~2010-11-03 7:31 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-02 9:32 [Qemu-devel] [PATCH v7 0/6] pcie port switch emulators Isaku Yamahata
2010-11-02 9:32 ` [Qemu-devel] [PATCH v7 1/6] pcie_regs.h: more constants Isaku Yamahata
2010-11-02 9:32 ` [Qemu-devel] [PATCH v7 2/6] pcie/aer: helper functions for pcie aer capability Isaku Yamahata
2010-11-02 12:57 ` [Qemu-devel] " Michael S. Tsirkin
2010-11-03 1:24 ` Isaku Yamahata
2010-11-03 7:30 ` Michael S. Tsirkin [this message]
2010-11-15 7:35 ` Isaku Yamahata
2010-11-15 7:44 ` Michael S. Tsirkin
2010-11-02 13:54 ` Michael S. Tsirkin
2010-11-02 9:32 ` [Qemu-devel] [PATCH v7 3/6] pcie/aer: glue aer error injection into qemu monitor Isaku Yamahata
2010-11-02 12:10 ` [Qemu-devel] " Michael S. Tsirkin
2010-11-02 9:32 ` [Qemu-devel] [PATCH v7 4/6] ioh3420: support aer Isaku Yamahata
2010-11-02 9:32 ` [Qemu-devel] [PATCH v7 5/6] x3130/upstream: " Isaku Yamahata
2010-11-02 9:32 ` [Qemu-devel] [PATCH v7 6/6] x3130/downstream: " Isaku Yamahata
2010-11-02 14:05 ` [Qemu-devel] Re: [PATCH v7 0/6] pcie port switch emulators Michael S. Tsirkin
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=20101103073049.GB6772@redhat.com \
--to=mst@redhat.com \
--cc=adnan@khaleel.us \
--cc=etmartin@cisco.com \
--cc=qemu-devel@nongnu.org \
--cc=skandasa@cisco.com \
--cc=wexu2@cisco.com \
--cc=yamahata@valinux.co.jp \
/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.