Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

clk: pxa: Constify static struct clk_ops

Constify a couple of static struct clk_ops that are not modified. Their
only usage is inside the macros and their address is passed to
clk_register_composite() which takes pointers to const struct clk_ops.
This allows the compiler to put them in read-only memory.

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Link: https://lore.kernel.org/r/20200922184715.1854-1-rikard.falkeborn@gmail.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>

authored by

Rikard Falkeborn and committed by
Stephen Boyd
6487649e 9123e3a7

+4 -4
+4 -4
drivers/clk/pxa/clk-pxa.h
··· 19 19 #define MUX_RO_RATE_RO_OPS(name, clk_name) \ 20 20 static struct clk_hw name ## _mux_hw; \ 21 21 static struct clk_hw name ## _rate_hw; \ 22 - static struct clk_ops name ## _mux_ops = { \ 22 + static const struct clk_ops name ## _mux_ops = { \ 23 23 .get_parent = name ## _get_parent, \ 24 24 .set_parent = dummy_clk_set_parent, \ 25 25 }; \ 26 - static struct clk_ops name ## _rate_ops = { \ 26 + static const struct clk_ops name ## _rate_ops = { \ 27 27 .recalc_rate = name ## _get_rate, \ 28 28 }; \ 29 29 static struct clk * __init clk_register_ ## name(void) \ ··· 38 38 39 39 #define RATE_RO_OPS(name, clk_name) \ 40 40 static struct clk_hw name ## _rate_hw; \ 41 - static const struct clk_ops name ## _rate_ops = { \ 41 + static const struct clk_ops name ## _rate_ops = { \ 42 42 .recalc_rate = name ## _get_rate, \ 43 43 }; \ 44 44 static struct clk * __init clk_register_ ## name(void) \ ··· 53 53 54 54 #define RATE_OPS(name, clk_name) \ 55 55 static struct clk_hw name ## _rate_hw; \ 56 - static struct clk_ops name ## _rate_ops = { \ 56 + static const struct clk_ops name ## _rate_ops = { \ 57 57 .recalc_rate = name ## _get_rate, \ 58 58 .set_rate = name ## _set_rate, \ 59 59 .determine_rate = name ## _determine_rate, \