From mboxrd@z Thu Jan 1 00:00:00 1970 From: okaya-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org Subject: Re: [PATCH V7 4/4] dmaengine: qcom_hidma: add MSI support for interrupts Date: Mon, 24 Oct 2016 07:07:19 -0400 Message-ID: <12f6cc8ec2b83237b61965f8576cface@codeaurora.org> References: <1477067879-23750-1-git-send-email-okaya@codeaurora.org> <1477067879-23750-5-git-send-email-okaya@codeaurora.org> <36163853-ac4a-e146-0c1b-eaf42e8b234d@codeaurora.org> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Sender: devicetree-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Andy Shevchenko Cc: dmaengine , Timur Tabi , devicetree , Christopher Covington , Vinod Koul , Jon Masters , Andy Gross , Arnd Bergmann , linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-arm Mailing List , Dan Williams , Dave Jiang , Lars-Peter Clausen , linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, dmaengine-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: devicetree@vger.kernel.org On 2016-10-24 03:30, Andy Shevchenko wrote: > On Mon, Oct 24, 2016 at 5:55 AM, Sinan Kaya > 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). This was my initial approach. I was asked to remove the stub functions. So, I did it. -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html