* [PATCH 0/3] clk: zynq: Clean up
@ 2014-09-02 23:02 Soren Brinkmann
2014-09-02 23:02 ` [PATCH 1/3] clk: zynq: Remove unnecessary OOM message Soren Brinkmann
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Soren Brinkmann @ 2014-09-02 23:02 UTC (permalink / raw)
To: linux-arm-kernel
Hi,
triggered by that discussion whether checkpatch should be used to check
files, I ran checkpatch on Zynq's clock code. A few of the reported
issues I found worth fixing.
Thanks,
S?ren
Soren Brinkmann (3):
clk: zynq: Remove unnecessary OOM message
clk: zynq: Remove pointless return at end of void function
clk: zynq: Move const initdata into correct code section
drivers/clk/zynq/clkc.c | 30 ++++++++++++++----------------
drivers/clk/zynq/pll.c | 4 +---
2 files changed, 15 insertions(+), 19 deletions(-)
--
2.1.0.1.g27b9230
^ permalink raw reply [flat|nested] 5+ messages in thread* [PATCH 1/3] clk: zynq: Remove unnecessary OOM message 2014-09-02 23:02 [PATCH 0/3] clk: zynq: Clean up Soren Brinkmann @ 2014-09-02 23:02 ` Soren Brinkmann 2014-09-02 23:02 ` [PATCH 2/3] clk: zynq: Remove pointless return at end of void function Soren Brinkmann ` (2 subsequent siblings) 3 siblings, 0 replies; 5+ messages in thread From: Soren Brinkmann @ 2014-09-02 23:02 UTC (permalink / raw) To: linux-arm-kernel As checkpatch suggests: WARNING: Possible unnecessary 'out of memory' message, remove an error message after failing kmalloc() from the PLL driver. Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com> --- drivers/clk/zynq/pll.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/clk/zynq/pll.c b/drivers/clk/zynq/pll.c index cec97596fe65..00d72fb5c036 100644 --- a/drivers/clk/zynq/pll.c +++ b/drivers/clk/zynq/pll.c @@ -211,10 +211,8 @@ struct clk *clk_register_zynq_pll(const char *name, const char *parent, }; pll = kmalloc(sizeof(*pll), GFP_KERNEL); - if (!pll) { - pr_err("%s: Could not allocate Zynq PLL clk.\n", __func__); + if (!pll) return ERR_PTR(-ENOMEM); - } /* Populate the struct */ pll->hw.init = &initd; -- 2.1.0.1.g27b9230 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/3] clk: zynq: Remove pointless return at end of void function 2014-09-02 23:02 [PATCH 0/3] clk: zynq: Clean up Soren Brinkmann 2014-09-02 23:02 ` [PATCH 1/3] clk: zynq: Remove unnecessary OOM message Soren Brinkmann @ 2014-09-02 23:02 ` Soren Brinkmann 2014-09-02 23:02 ` [PATCH 3/3] clk: zynq: Move const initdata into correct code section Soren Brinkmann 2014-09-03 2:38 ` [PATCH 0/3] clk: zynq: Clean up Mike Turquette 3 siblings, 0 replies; 5+ messages in thread From: Soren Brinkmann @ 2014-09-02 23:02 UTC (permalink / raw) To: linux-arm-kernel Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com> --- drivers/clk/zynq/clkc.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/clk/zynq/clkc.c b/drivers/clk/zynq/clkc.c index 246cf1226eaa..6ab793ac8c2c 100644 --- a/drivers/clk/zynq/clkc.c +++ b/drivers/clk/zynq/clkc.c @@ -619,5 +619,4 @@ void __init zynq_clock_init(void) np_err: of_node_put(np); BUG(); - return; } -- 2.1.0.1.g27b9230 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 3/3] clk: zynq: Move const initdata into correct code section 2014-09-02 23:02 [PATCH 0/3] clk: zynq: Clean up Soren Brinkmann 2014-09-02 23:02 ` [PATCH 1/3] clk: zynq: Remove unnecessary OOM message Soren Brinkmann 2014-09-02 23:02 ` [PATCH 2/3] clk: zynq: Remove pointless return at end of void function Soren Brinkmann @ 2014-09-02 23:02 ` Soren Brinkmann 2014-09-03 2:38 ` [PATCH 0/3] clk: zynq: Clean up Mike Turquette 3 siblings, 0 replies; 5+ messages in thread From: Soren Brinkmann @ 2014-09-02 23:02 UTC (permalink / raw) To: linux-arm-kernel Use __initconst instead of __initdata for constant init data. Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com> --- drivers/clk/zynq/clkc.c | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/drivers/clk/zynq/clkc.c b/drivers/clk/zynq/clkc.c index 6ab793ac8c2c..9037bebd69f7 100644 --- a/drivers/clk/zynq/clkc.c +++ b/drivers/clk/zynq/clkc.c @@ -85,24 +85,22 @@ static DEFINE_SPINLOCK(canmioclk_lock); static DEFINE_SPINLOCK(dbgclk_lock); static DEFINE_SPINLOCK(aperclk_lock); -static const char dummy_nm[] __initconst = "dummy_name"; - -static const char *armpll_parents[] __initdata = {"armpll_int", "ps_clk"}; -static const char *ddrpll_parents[] __initdata = {"ddrpll_int", "ps_clk"}; -static const char *iopll_parents[] __initdata = {"iopll_int", "ps_clk"}; -static const char *gem0_mux_parents[] __initdata = {"gem0_div1", dummy_nm}; -static const char *gem1_mux_parents[] __initdata = {"gem1_div1", dummy_nm}; -static const char *can0_mio_mux2_parents[] __initdata = {"can0_gate", +static const char *armpll_parents[] __initconst = {"armpll_int", "ps_clk"}; +static const char *ddrpll_parents[] __initconst = {"ddrpll_int", "ps_clk"}; +static const char *iopll_parents[] __initconst = {"iopll_int", "ps_clk"}; +static const char *gem0_mux_parents[] __initconst = {"gem0_div1", "dummy_name"}; +static const char *gem1_mux_parents[] __initconst = {"gem1_div1", "dummy_name"}; +static const char *can0_mio_mux2_parents[] __initconst = {"can0_gate", "can0_mio_mux"}; -static const char *can1_mio_mux2_parents[] __initdata = {"can1_gate", +static const char *can1_mio_mux2_parents[] __initconst = {"can1_gate", "can1_mio_mux"}; -static const char *dbg_emio_mux_parents[] __initdata = {"dbg_div", - dummy_nm}; +static const char *dbg_emio_mux_parents[] __initconst = {"dbg_div", + "dummy_name"}; -static const char *dbgtrc_emio_input_names[] __initdata = {"trace_emio_clk"}; -static const char *gem0_emio_input_names[] __initdata = {"gem0_emio_clk"}; -static const char *gem1_emio_input_names[] __initdata = {"gem1_emio_clk"}; -static const char *swdt_ext_clk_input_names[] __initdata = {"swdt_ext_clk"}; +static const char *dbgtrc_emio_input_names[] __initconst = {"trace_emio_clk"}; +static const char *gem0_emio_input_names[] __initconst = {"gem0_emio_clk"}; +static const char *gem1_emio_input_names[] __initconst = {"gem1_emio_clk"}; +static const char *swdt_ext_clk_input_names[] __initconst = {"swdt_ext_clk"}; static void __init zynq_clk_register_fclk(enum zynq_clk fclk, const char *clk_name, void __iomem *fclk_ctrl_reg, @@ -230,6 +228,7 @@ static void __init zynq_clk_setup(struct device_node *np) const char *periph_parents[4]; const char *swdt_ext_clk_mux_parents[2]; const char *can_mio_mux_parents[NUM_MIO_PINS]; + const char *dummy_nm = "dummy_name"; pr_info("Zynq clock init\n"); -- 2.1.0.1.g27b9230 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 0/3] clk: zynq: Clean up 2014-09-02 23:02 [PATCH 0/3] clk: zynq: Clean up Soren Brinkmann ` (2 preceding siblings ...) 2014-09-02 23:02 ` [PATCH 3/3] clk: zynq: Move const initdata into correct code section Soren Brinkmann @ 2014-09-03 2:38 ` Mike Turquette 3 siblings, 0 replies; 5+ messages in thread From: Mike Turquette @ 2014-09-03 2:38 UTC (permalink / raw) To: linux-arm-kernel Quoting Soren Brinkmann (2014-09-02 16:02:06) > Hi, > > triggered by that discussion whether checkpatch should be used to check > files, I ran checkpatch on Zynq's clock code. A few of the reported > issues I found worth fixing. Applied to clk-next. Regards, Mike > > Thanks, > S?ren > > Soren Brinkmann (3): > clk: zynq: Remove unnecessary OOM message > clk: zynq: Remove pointless return at end of void function > clk: zynq: Move const initdata into correct code section > > drivers/clk/zynq/clkc.c | 30 ++++++++++++++---------------- > drivers/clk/zynq/pll.c | 4 +--- > 2 files changed, 15 insertions(+), 19 deletions(-) > > -- > 2.1.0.1.g27b9230 > ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-09-03 2:38 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2014-09-02 23:02 [PATCH 0/3] clk: zynq: Clean up Soren Brinkmann 2014-09-02 23:02 ` [PATCH 1/3] clk: zynq: Remove unnecessary OOM message Soren Brinkmann 2014-09-02 23:02 ` [PATCH 2/3] clk: zynq: Remove pointless return at end of void function Soren Brinkmann 2014-09-02 23:02 ` [PATCH 3/3] clk: zynq: Move const initdata into correct code section Soren Brinkmann 2014-09-03 2:38 ` [PATCH 0/3] clk: zynq: Clean up Mike Turquette
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox