[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAA+hA=Rtkm_FpkoBvHNnB0TSeTrqXaRVwOzkywsL7QO6ec_K7Q@mail.gmail.com>
Date: Thu, 2 Jul 2020 13:38:10 +0800
From: Dong Aisheng <dongas86@...il.com>
To: Anson Huang <anson.huang@....com>
Cc: Michael Turquette <mturquette@...libre.com>,
Stephen Boyd <sboyd@...nel.org>,
Shawn Guo <shawnguo@...nel.org>,
Sascha Hauer <s.hauer@...gutronix.de>,
Sascha Hauer <kernel@...gutronix.de>,
Fabio Estevam <festevam@...il.com>,
Peng Fan <peng.fan@....com>, Arnd Bergmann <arnd@...db.de>,
Abel Vesa <abel.vesa@....com>,
Aisheng Dong <aisheng.dong@....com>,
Andy Duan <fugang.duan@....com>,
Daniel Baluta <daniel.baluta@....com>,
YueHaibing <yuehaibing@...wei.com>,
Stephen Rothwell <sfr@...b.auug.org.au>,
linux-clk <linux-clk@...r.kernel.org>,
open list <linux-kernel@...r.kernel.org>,
"moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE"
<linux-arm-kernel@...ts.infradead.org>,
dl-linux-imx <linux-imx@....com>
Subject: Re: [PATCH V4 3/5] clk: imx: Support building i.MX common clock
driver as module
On Thu, Jul 2, 2020 at 11:26 AM Anson Huang <anson.huang@....com> wrote:
[...]
> > > @@ -143,16 +148,18 @@ void imx_cscmr1_fixup(u32 *val)
> > > static int imx_keep_uart_clocks;
> > > static struct clk ** const *imx_uart_clocks;
> > >
> > > -static int __init imx_keep_uart_clocks_param(char *str)
> > > +static int __maybe_unused imx_keep_uart_clocks_param(char *str)
> > > {
> > > imx_keep_uart_clocks = 1;
> > >
> > > return 0;
> > > }
> > > +#ifndef MODULE
> > > __setup_param("earlycon", imx_keep_uart_earlycon,
> > > imx_keep_uart_clocks_param, 0);
> > > __setup_param("earlyprintk", imx_keep_uart_earlyprintk,
> > > imx_keep_uart_clocks_param, 0);
> >
> > I feel not only the __setup_param, the whole logic of keep_uart_clocks
> > are not needed for Module case. Is it true?
>
> Yes, but the 'keep_uart_clocks' is false by default and the function imx_keep_uart_clocks_param()
> already has '__maybe_unused', it does NOT impact anything if it is for module build, so I did NOT
> add the #ifndef check for them, just to keep code easy and clean.
>
IMHO do not compile them is a more easy and clean way. Then users
don't have to look into the code logic
which is meaingless for Module case.
BTW, it really does not make any sense to only condionally compile
__setup_parm() but left
the param functions definition to be handled by __maybe_unnused.
They're together part of code, aren't they?
Regards
Aisheng
Regards
Aisheng
> Thanks,
> Anson
>
Powered by blists - more mailing lists