[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] Re: [PATCH v7 2/6] pcie/aer: helper functions for pcie aer
From: |
Michael S. Tsirkin |
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 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
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
[Qemu-devel] [PATCH v7 1/6] pcie_regs.h: more constants, Isaku Yamahata, 2010/11/02
[Qemu-devel] [PATCH v7 3/6] pcie/aer: glue aer error injection into qemu monitor, Isaku Yamahata, 2010/11/02
[Qemu-devel] [PATCH v7 5/6] x3130/upstream: support aer, Isaku Yamahata, 2010/11/02
[Qemu-devel] [PATCH v7 6/6] x3130/downstream: support aer., Isaku Yamahata, 2010/11/02
[Qemu-devel] Re: [PATCH v7 0/6] pcie port switch emulators, Michael S. Tsirkin, 2010/11/02