Thread (21 messages) 21 messages, 4 authors, 2020-07-02

Re: [PATCH V4 3/5] clk: imx: Support building i.MX common clock driver as module

From: Dong Aisheng <hidden>
Date: 2020-07-02 05:52:15
Also in: linux-clk, lkml

On Thu, Jul 2, 2020 at 11:26 AM Anson Huang [off-list ref] wrote:
[...]
quoted
quoted
@@ -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
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help