[PATCH 0/4] ASoC: mediatek: remove cppcheck warnings
There should be no functionality change, this patchset only fixes shadowed variables, prototypes and removes a useless assignment.
Pierre-Louis Bossart (4): ASoC: mediatek: mtk-btcvsd: remove useless assignment ASoC: mediatek: mt2701: align function prototype ASoC: mediatek: mt2701: rename shadowed array ASoC: mediatek: mt8173: rename local irq variable
sound/soc/mediatek/common/mtk-btcvsd.c | 2 +- sound/soc/mediatek/mt2701/mt2701-afe-clock-ctrl.h | 4 ++-- sound/soc/mediatek/mt2701/mt2701-afe-pcm.c | 4 ++-- sound/soc/mediatek/mt8173/mt8173-afe-pcm.c | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-)
cppcheck warning:
sound/soc/mediatek/common/mtk-btcvsd.c:783:34: style: Variable 'avail' is assigned a value that is never used. [unreadVariable] int written_size = count, avail = 0, cur_write_idx, write_size, cont; ^
Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com --- sound/soc/mediatek/common/mtk-btcvsd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/mediatek/common/mtk-btcvsd.c b/sound/soc/mediatek/common/mtk-btcvsd.c index a554c57b6460..f85b5ea180ec 100644 --- a/sound/soc/mediatek/common/mtk-btcvsd.c +++ b/sound/soc/mediatek/common/mtk-btcvsd.c @@ -780,7 +780,7 @@ static ssize_t mtk_btcvsd_snd_write(struct mtk_btcvsd_snd *bt, char __user *buf, size_t count) { - int written_size = count, avail = 0, cur_write_idx, write_size, cont; + int written_size = count, avail, cur_write_idx, write_size, cont; unsigned int cur_buf_ofs = 0; unsigned long flags; unsigned int packet_size = bt->tx->packet_size;
cppcheck warnings:
sound/soc/mediatek/mt2701/mt2701-afe-clock-ctrl.c:102:30: style:inconclusive: Function 'mt2701_afe_enable_i2s' argument 2 names different: declaration 'path' definition 'i2s_path'. [funcArgNamesDifferent] struct mt2701_i2s_path *i2s_path, ^ sound/soc/mediatek/mt2701/mt2701-afe-clock-ctrl.h:21:30: note: Function 'mt2701_afe_enable_i2s' argument 2 names different: declaration 'path' definition 'i2s_path'. struct mt2701_i2s_path *path, ^ sound/soc/mediatek/mt2701/mt2701-afe-clock-ctrl.c:102:30: note: Function 'mt2701_afe_enable_i2s' argument 2 names different: declaration 'path' definition 'i2s_path'.
struct mt2701_i2s_path *i2s_path, ^ sound/soc/mediatek/mt2701/mt2701-afe-clock-ctrl.c:128:32: style:inconclusive: Function 'mt2701_afe_disable_i2s' argument 2 names different: declaration 'path' definition 'i2s_path'. [funcArgNamesDifferent] struct mt2701_i2s_path *i2s_path, ^ sound/soc/mediatek/mt2701/mt2701-afe-clock-ctrl.h:24:32: note: Function 'mt2701_afe_disable_i2s' argument 2 names different: declaration 'path' definition 'i2s_path'. struct mt2701_i2s_path *path, ^ sound/soc/mediatek/mt2701/mt2701-afe-clock-ctrl.c:128:32: note: Function 'mt2701_afe_disable_i2s' argument 2 names different: declaration 'path' definition 'i2s_path'. struct mt2701_i2s_path *i2s_path, ^
Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com --- sound/soc/mediatek/mt2701/mt2701-afe-clock-ctrl.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/soc/mediatek/mt2701/mt2701-afe-clock-ctrl.h b/sound/soc/mediatek/mt2701/mt2701-afe-clock-ctrl.h index 580fead2ab05..0bd82fbda176 100644 --- a/sound/soc/mediatek/mt2701/mt2701-afe-clock-ctrl.h +++ b/sound/soc/mediatek/mt2701/mt2701-afe-clock-ctrl.h @@ -18,10 +18,10 @@ int mt2701_afe_enable_clock(struct mtk_base_afe *afe); int mt2701_afe_disable_clock(struct mtk_base_afe *afe);
int mt2701_afe_enable_i2s(struct mtk_base_afe *afe, - struct mt2701_i2s_path *path, + struct mt2701_i2s_path *i2s_path, int dir); void mt2701_afe_disable_i2s(struct mtk_base_afe *afe, - struct mt2701_i2s_path *path, + struct mt2701_i2s_path *i2s_path, int dir); int mt2701_afe_enable_mclk(struct mtk_base_afe *afe, int id); void mt2701_afe_disable_mclk(struct mtk_base_afe *afe, int id);
cppcheck warning:
sound/soc/mediatek/mt2701/mt2701-afe-pcm.c:406:36: style: Local variable 'memif_data' shadows outer variable [shadowVariable] const struct mtk_base_memif_data *memif_data; ^ sound/soc/mediatek/mt2701/mt2701-afe-pcm.c:977:41: note: Shadowed declaration static const struct mtk_base_memif_data memif_data[MT2701_MEMIF_NUM] = { ^ sound/soc/mediatek/mt2701/mt2701-afe-pcm.c:406:36: note: Shadow variable const struct mtk_base_memif_data *memif_data; ^ sound/soc/mediatek/mt2701/mt2701-afe-pcm.c:431:36: style: Local variable 'memif_data' shadows outer variable [shadowVariable] const struct mtk_base_memif_data *memif_data; ^ sound/soc/mediatek/mt2701/mt2701-afe-pcm.c:977:41: note: Shadowed declaration static const struct mtk_base_memif_data memif_data[MT2701_MEMIF_NUM] = { ^ sound/soc/mediatek/mt2701/mt2701-afe-pcm.c:431:36: note: Shadow variable const struct mtk_base_memif_data *memif_data; ^
Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com --- sound/soc/mediatek/mt2701/mt2701-afe-pcm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/soc/mediatek/mt2701/mt2701-afe-pcm.c b/sound/soc/mediatek/mt2701/mt2701-afe-pcm.c index d5cffe7a7e15..bc3d0466472b 100644 --- a/sound/soc/mediatek/mt2701/mt2701-afe-pcm.c +++ b/sound/soc/mediatek/mt2701/mt2701-afe-pcm.c @@ -974,7 +974,7 @@ static const struct snd_soc_component_driver mt2701_afe_pcm_dai_component = { .resume = mtk_afe_resume, };
-static const struct mtk_base_memif_data memif_data[MT2701_MEMIF_NUM] = { +static const struct mtk_base_memif_data memif_data_array[MT2701_MEMIF_NUM] = { { .name = "DL1", .id = MT2701_MEMIF_DL1, @@ -1366,7 +1366,7 @@ static int mt2701_afe_pcm_dev_probe(struct platform_device *pdev) return -ENOMEM;
for (i = 0; i < afe->memif_size; i++) { - afe->memif[i].data = &memif_data[i]; + afe->memif[i].data = &memif_data_array[i]; afe->memif[i].irq_usage = -1; }
cppcheck warning:
sound/soc/mediatek/mt8173/mt8173-afe-pcm.c:929:28: style: Local variable 'irq' shadows outer argument [shadowArgument] struct mtk_base_afe_irq *irq; ^ sound/soc/mediatek/mt8173/mt8173-afe-pcm.c:914:47: note: Shadowed declaration static irqreturn_t mt8173_afe_irq_handler(int irq, void *dev_id) ^ sound/soc/mediatek/mt8173/mt8173-afe-pcm.c:929:28: note: Shadow variable struct mtk_base_afe_irq *irq; ^
Not a great idea to have two 'irq' variables in the same function...
Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com --- sound/soc/mediatek/mt8173/mt8173-afe-pcm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/sound/soc/mediatek/mt8173/mt8173-afe-pcm.c b/sound/soc/mediatek/mt8173/mt8173-afe-pcm.c index 685f4074b4e0..6350390414d4 100644 --- a/sound/soc/mediatek/mt8173/mt8173-afe-pcm.c +++ b/sound/soc/mediatek/mt8173/mt8173-afe-pcm.c @@ -926,14 +926,14 @@ static irqreturn_t mt8173_afe_irq_handler(int irq, void *dev_id)
for (i = 0; i < MT8173_AFE_MEMIF_NUM; i++) { struct mtk_base_afe_memif *memif = &afe->memif[i]; - struct mtk_base_afe_irq *irq; + struct mtk_base_afe_irq *irq_p;
if (memif->irq_usage < 0) continue;
- irq = &afe->irqs[memif->irq_usage]; + irq_p = &afe->irqs[memif->irq_usage];
- if (!(reg_value & (1 << irq->irq_data->irq_clr_shift))) + if (!(reg_value & (1 << irq_p->irq_data->irq_clr_shift))) continue;
snd_pcm_period_elapsed(memif->substream);
On Wed, 10 Mar 2021 18:49:00 -0600, Pierre-Louis Bossart wrote:
There should be no functionality change, this patchset only fixes shadowed variables, prototypes and removes a useless assignment.
Pierre-Louis Bossart (4): ASoC: mediatek: mtk-btcvsd: remove useless assignment ASoC: mediatek: mt2701: align function prototype ASoC: mediatek: mt2701: rename shadowed array ASoC: mediatek: mt8173: rename local irq variable
[...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/4] ASoC: mediatek: mtk-btcvsd: remove useless assignment commit: 2e5e57f085a3243aae7e4af88dc2c40e5ff4d3be [2/4] ASoC: mediatek: mt2701: align function prototype commit: 57f1379e77a7432759e2f35b720c71863e2d83bc [3/4] ASoC: mediatek: mt2701: rename shadowed array commit: d9cdc1335622866c52a463325b3aaea9844cff1b [4/4] ASoC: mediatek: mt8173: rename local irq variable commit: 14667403a5631ce2fd2935d90c6d36f7975f61f3
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks, Mark
participants (2)
-
Mark Brown
-
Pierre-Louis Bossart