qemu-devel
[Top][All Lists]
Advanced

[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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]