[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75VettN=-S+iqKQbqixRe2BM=AiS26VGM+8yLophbkc+Z8g@mail.gmail.com>
Date: Mon, 24 Oct 2016 10:30:12 +0300
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Sinan Kaya <okaya@...eaurora.org>
Cc: dmaengine <dmaengine@...r.kernel.org>,
Timur Tabi <timur@...eaurora.org>,
devicetree <devicetree@...r.kernel.org>,
Christopher Covington <cov@...eaurora.org>,
Vinod Koul <vinod.koul@...el.com>,
Jon Masters <jcm@...hat.com>,
Andy Gross <agross@...eaurora.org>,
Arnd Bergmann <arnd@...db.de>, linux-arm-msm@...r.kernel.org,
linux-arm Mailing List <linux-arm-kernel@...ts.infradead.org>,
Dan Williams <dan.j.williams@...el.com>,
Dave Jiang <dave.jiang@...el.com>,
Lars-Peter Clausen <lars@...afoo.de>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH V7 4/4] dmaengine: qcom_hidma: add MSI support for interrupts
On Mon, Oct 24, 2016 at 5:55 AM, Sinan Kaya <okaya@...eaurora.org> wrote:
> On 10/21/2016 12:11 PM, Andy Shevchenko wrote:
>>> +static void hidma_free_msis(struct hidma_dev *dmadev)
>>> > +{
>>> > +#ifdef CONFIG_GENERIC_MSI_IRQ_DOMAIN
>> Perhaps one #ifdef and two definitions of functions?
>
> I don't think it will make a difference. I'll have to move
> #ifdef around the caller of hidma_free_msis instead which
> I think is uglier.
>
> The hidma_write_msi_msg function gets called only when
> CONFIG_GENERIC_MSI_IRQ_DOMAIN is defined. If I don't put
> this around the function definition, I get unused function
> warning from the compiler. This is the reason why preprocessor
> definition is outside of the function definition.
I am talking about something like below:
#ifdef UGLY_DEFINE
myfunc_a()
{
}
myfunc_b()
{
}
#else
static inline myfunc_a() {}
static inline myfunc_b() {}
#endif
There is another way as well, namely use of IS_ENABLED(), IS_BUILTIN()
macros (I don't remember how exactly second one is spelt).
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists