Skip to content

Commit cb870fd

Browse files
ColinIanKingbroonie
authored andcommitted
ASoC: uniphier: aio-core: Make some read-only arrays static const
Don't populate the read-only arrays slotsel_2ch, slotsel_multi, v_pll and v_div on the stack but instead make them static const. Also makes the object code a little smaller. Signed-off-by: Colin Ian King <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent e110ede commit cb870fd

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

sound/soc/uniphier/aio-core.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -277,17 +277,18 @@ void aio_port_reset(struct uniphier_aio_sub *sub)
277277
static int aio_port_set_ch(struct uniphier_aio_sub *sub)
278278
{
279279
struct regmap *r = sub->aio->chip->regmap;
280-
u32 slotsel_2ch[] = {
280+
static const u32 slotsel_2ch[] = {
281281
0, 0, 0, 0, 0,
282282
};
283-
u32 slotsel_multi[] = {
283+
static const u32 slotsel_multi[] = {
284284
OPORTMXTYSLOTCTR_SLOTSEL_SLOT0,
285285
OPORTMXTYSLOTCTR_SLOTSEL_SLOT1,
286286
OPORTMXTYSLOTCTR_SLOTSEL_SLOT2,
287287
OPORTMXTYSLOTCTR_SLOTSEL_SLOT3,
288288
OPORTMXTYSLOTCTR_SLOTSEL_SLOT4,
289289
};
290-
u32 mode, *slotsel;
290+
u32 mode;
291+
const u32 *slotsel;
291292
int i;
292293

293294
switch (params_channels(&sub->params)) {
@@ -515,13 +516,13 @@ static int aio_port_set_clk(struct uniphier_aio_sub *sub)
515516
struct uniphier_aio_chip *chip = sub->aio->chip;
516517
struct device *dev = &sub->aio->chip->pdev->dev;
517518
struct regmap *r = sub->aio->chip->regmap;
518-
u32 v_pll[] = {
519+
static const u32 v_pll[] = {
519520
OPORTMXCTR2_ACLKSEL_A1, OPORTMXCTR2_ACLKSEL_F1,
520521
OPORTMXCTR2_ACLKSEL_A2, OPORTMXCTR2_ACLKSEL_F2,
521522
OPORTMXCTR2_ACLKSEL_A2PLL,
522523
OPORTMXCTR2_ACLKSEL_RX1,
523524
};
524-
u32 v_div[] = {
525+
static const u32 v_div[] = {
525526
OPORTMXCTR2_DACCKSEL_1_2, OPORTMXCTR2_DACCKSEL_1_3,
526527
OPORTMXCTR2_DACCKSEL_1_1, OPORTMXCTR2_DACCKSEL_2_3,
527528
};

0 commit comments

Comments
 (0)