[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20121004075442.GD2258@dhcp-26-207.brq.redhat.com>
Date: Thu, 4 Oct 2012 09:54:43 +0200
From: Alexander Gordeev <agordeev@...hat.com>
To: Ingo Molnar <mingo@...nel.org>
Cc: linux-kernel@...r.kernel.org, Ingo Molnar <mingo@...hat.com>,
Thomas Gleixner <tglx@...utronix.de>,
Bjorn Helgaas <bhelgaas@...gle.com>,
Suresh Siddha <suresh.b.siddha@...el.com>,
Yinghai Lu <yinghai@...nel.org>,
Jeff Garzik <jgarzik@...ox.com>,
Matthew Wilcox <willy@...ux.intel.com>, x86@...nel.org,
linux-pci@...r.kernel.org, linux-ide@...r.kernel.org
Subject: Re: [PATCH v3 -tip 1/5] x86, MSI: Support multiple MSIs in presense
of IRQ remapping
On Tue, Oct 02, 2012 at 01:25:24PM +0200, Ingo Molnar wrote:
> > > > @@ -584,8 +586,12 @@ int __irq_alloc_descs(int irq, unsigned int from, unsigned int cnt, int node,
> > > > #define irq_alloc_desc_from(from, node) \
> > > > irq_alloc_descs(-1, from, 1, node)
> > > >
> > > > +#define irq_alloc_descs_from(from, cnt, node) \
> > > > + irq_alloc_descs(-1, from, cnt, node)
> > > > +
> > >
> > > Please use inlines instead of macros. Might transform the one
> > > above it as well in the process.
> >
> > You mean here do not introduce irq_alloc_descs_from, but rather use
> > irq_alloc_descs() directly?
>
> My suggestion is to add irq_alloc_descs_from() as a (very
> simple) inline function and change irq_alloc_desc_from() to be
> an inline function as well.
These defines were added on purpose with commit ec53cf2 ("irq: don't put
module.h into irq.h for tracking irqgen modules.") - the relevant hunk is
below. I suppose we do not want to revert it?
@@ -567,29 +567,21 @@ static inline struct msi_desc *irq_data_get_msi(struct irq_data *d)
int __irq_alloc_descs(int irq, unsigned int from, unsigned int cnt, int node,
struct module *owner);
-static inline int irq_alloc_descs(int irq, unsigned int from, unsigned int cnt,
- int node)
-{
- return __irq_alloc_descs(irq, from, cnt, node, THIS_MODULE);
-}
+/* use macros to avoid needing export.h for THIS_MODULE */
+#define irq_alloc_descs(irq, from, cnt, node) \
+ __irq_alloc_descs(irq, from, cnt, node, THIS_MODULE)
-void irq_free_descs(unsigned int irq, unsigned int cnt);
-int irq_reserve_irqs(unsigned int from, unsigned int cnt);
+#define irq_alloc_desc(node) \
+ irq_alloc_descs(-1, 0, 1, node)
-static inline int irq_alloc_desc(int node)
-{
- return irq_alloc_descs(-1, 0, 1, node);
-}
+#define irq_alloc_desc_at(at, node) \
+ irq_alloc_descs(at, at, 1, node)
-static inline int irq_alloc_desc_at(unsigned int at, int node)
-{
- return irq_alloc_descs(at, at, 1, node);
-}
+#define irq_alloc_desc_from(from, node) \
+ irq_alloc_descs(-1, from, 1, node)
-static inline int irq_alloc_desc_from(unsigned int from, int node)
-{
- return irq_alloc_descs(-1, from, 1, node);
-}
+void irq_free_descs(unsigned int irq, unsigned int cnt);
+int irq_reserve_irqs(unsigned int from, unsigned int cnt);
static inline void irq_free_desc(unsigned int irq)
{
--
Regards,
Alexander Gordeev
agordeev@...hat.com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists