Skip to content

Commit

Permalink
sound: soc: phytium: Avoid unneeded-internal-declaration warning by c…
Browse files Browse the repository at this point in the history
…lang

Fix follow errors with clang-19:

sound/soc/phytium/phytium_i2s.c:979:18: error: variable 'bus_widths' is not needed and will not be emitted [-Werror,-Wunneeded-internal-declaration]
  979 | static const u32 bus_widths[COMP_MAX_DATA_WIDTH] = {
      |                  ^~~~~~~~~~
sound/soc/phytium/phytium_i2s.c:987:18: error: variable 'formats' is not needed and will not be emitted [-Werror,-Wunneeded-internal-declaration]
  987 | static const u32 formats[COMP_MAX_WORDSIZE] = {
      |                  ^~~~~~~
2 errors generated.

Signed-off-by: WangYuli <[email protected]>
  • Loading branch information
Avenger-285714 committed Nov 25, 2024
1 parent 58100b2 commit a5f1401
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions sound/soc/phytium/phytium_i2s.c
Original file line number Diff line number Diff line change
Expand Up @@ -975,33 +975,25 @@ static const u32 fifo_width[COMP_MAX_WORDSIZE] = {
12, 16, 20, 24, 32, 0, 0, 0
};

/* Width of (DMA) bus */
static const u32 bus_widths[COMP_MAX_DATA_WIDTH] = {
DMA_SLAVE_BUSWIDTH_1_BYTE,
DMA_SLAVE_BUSWIDTH_2_BYTES,
DMA_SLAVE_BUSWIDTH_4_BYTES,
DMA_SLAVE_BUSWIDTH_UNDEFINED
};

/* PCM format to support channel resolution */
static const u32 formats[COMP_MAX_WORDSIZE] = {
SNDRV_PCM_FMTBIT_S16_LE,
SNDRV_PCM_FMTBIT_S16_LE,
SNDRV_PCM_FMTBIT_S24_LE,
SNDRV_PCM_FMTBIT_S24_LE,
SNDRV_PCM_FMTBIT_S32_LE,
0,
0,
0
};

static int phytium_configure_dai(struct i2s_phytium *dev)
{
u32 comp1 = i2s_read_reg(dev->regs, dev->i2s_reg_comp1);
u32 comp2 = i2s_read_reg(dev->regs, dev->i2s_reg_comp2);
u32 fifo_depth = 1 << (1 + COMP1_FIFO_DEPTH_GLOBAL(comp1));
u32 idx;

/* PCM format to support channel resolution */
static const u32 formats[COMP_MAX_WORDSIZE] = {
SNDRV_PCM_FMTBIT_S16_LE,
SNDRV_PCM_FMTBIT_S16_LE,
SNDRV_PCM_FMTBIT_S24_LE,
SNDRV_PCM_FMTBIT_S24_LE,
SNDRV_PCM_FMTBIT_S32_LE,
0,
0,
0
};

if (COMP1_TX_ENABLED(comp1)) {
dev_dbg(dev->dev, " phytium: play supported\n");
idx = COMP1_TX_WORDSIZE_0(comp1);
Expand Down Expand Up @@ -1038,6 +1030,14 @@ static int phytium_configure_dai_by_dt(struct i2s_phytium *dev)
u32 idx2;
int ret;

/* Width of (DMA) bus */
static const u32 bus_widths[COMP_MAX_DATA_WIDTH] = {
DMA_SLAVE_BUSWIDTH_1_BYTE,
DMA_SLAVE_BUSWIDTH_2_BYTES,
DMA_SLAVE_BUSWIDTH_4_BYTES,
DMA_SLAVE_BUSWIDTH_UNDEFINED
};

if (WARN_ON(idx >= ARRAY_SIZE(bus_widths)))
return -EINVAL;

Expand Down

0 comments on commit a5f1401

Please sign in to comment.