Re: [PATCH] mmc: mediatek: mark PM functions as __maybe_unused

2020-12-08 Thread Paul Cercueil
Le mar. 8 déc. 2020 à 15:04, Arnd Bergmann a écrit : On Mon, Dec 7, 2020 at 1:33 PM Paul Cercueil wrote: Le ven. 4 déc. 2020 à 15:14, Arnd Bergmann a écrit By the way, as I'm ending up doing the same in a different context, I think it would be useful to have a IF_ENABLED() macro def

Re: [PATCH] mmc: mediatek: mark PM functions as __maybe_unused

2020-12-08 Thread Arnd Bergmann
On Mon, Dec 7, 2020 at 1:33 PM Paul Cercueil wrote: > Le ven. 4 déc. 2020 à 15:14, Arnd Bergmann a écrit > By the way, as I'm ending up doing the same in a different context, I > think it would be useful to have a IF_ENABLED() macro defined like this: > > #define IF_ENABLED(_cfg, _ptr) (IS_ENABL

Re: [PATCH] mmc: mediatek: mark PM functions as __maybe_unused

2020-12-07 Thread Paul Cercueil
Hi Arnd, Le ven. 4 déc. 2020 à 15:14, Arnd Bergmann a écrit : On Fri, Dec 4, 2020 at 11:02 AM Ulf Hansson wrote: On Thu, 3 Dec 2020 at 23:29, Arnd Bergmann wrote: > -#ifdef CONFIG_PM > static void msdc_save_reg(struct msdc_host *host) Shouldn't msdc_save|restore_reg() be turned int

Re: [PATCH] mmc: mediatek: mark PM functions as __maybe_unused

2020-12-04 Thread Paul Cercueil
Hi, Le ven. 4 déc. 2020 à 15:14, Arnd Bergmann a écrit : On Fri, Dec 4, 2020 at 11:02 AM Ulf Hansson wrote: On Thu, 3 Dec 2020 at 23:29, Arnd Bergmann wrote: > -#ifdef CONFIG_PM > static void msdc_save_reg(struct msdc_host *host) Shouldn't msdc_save|restore_reg() be turned into "__

Re: [PATCH] mmc: mediatek: mark PM functions as __maybe_unused

2020-12-04 Thread Arnd Bergmann
On Fri, Dec 4, 2020 at 3:38 PM Ulf Hansson wrote: . > > > > I don't see a lot of other instances of that yet, and it's fairly new. > > Maybe we should fix it before it gets propagated further. > > > > I would suggest we redefine pm_ptr like > > > > #define pm_ptr(_ptr) (IS_ENABLED(CONFIG_PM) ? (_p

Re: [PATCH] mmc: mediatek: mark PM functions as __maybe_unused

2020-12-04 Thread Ulf Hansson
On Fri, 4 Dec 2020 at 15:14, Arnd Bergmann wrote: > > On Fri, Dec 4, 2020 at 11:02 AM Ulf Hansson wrote: > > On Thu, 3 Dec 2020 at 23:29, Arnd Bergmann wrote: > > > > -#ifdef CONFIG_PM > > > static void msdc_save_reg(struct msdc_host *host) > > > > Shouldn't msdc_save|restore_reg() be turned in

Re: [PATCH] mmc: mediatek: mark PM functions as __maybe_unused

2020-12-04 Thread Arnd Bergmann
On Fri, Dec 4, 2020 at 11:02 AM Ulf Hansson wrote: > On Thu, 3 Dec 2020 at 23:29, Arnd Bergmann wrote: > > -#ifdef CONFIG_PM > > static void msdc_save_reg(struct msdc_host *host) > > Shouldn't msdc_save|restore_reg() be turned into "__maybe_unused" as well? There is no need since the compiler

Re: [PATCH] mmc: mediatek: mark PM functions as __maybe_unused

2020-12-04 Thread Ulf Hansson
On Thu, 3 Dec 2020 at 23:29, Arnd Bergmann wrote: > > From: Arnd Bergmann > > The #ifdef check for the suspend/resume functions is wrong: > > drivers/mmc/host/mtk-sd.c:2765:12: error: unused function 'msdc_suspend' > [-Werror,-Wunused-function] > static int msdc_suspend(struct device *dev) > dri