linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] ASoC: mediatek: remove cppcheck warnings
@ 2021-03-11  0:49 Pierre-Louis Bossart
  2021-03-11  0:49 ` [PATCH 1/4] ASoC: mediatek: mtk-btcvsd: remove useless assignment Pierre-Louis Bossart
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Pierre-Louis Bossart @ 2021-03-11  0:49 UTC (permalink / raw)
  To: alsa-devel
  Cc: tiwai, broonie, linux-kernel, Pierre-Louis Bossart,
	Matthias Brugger, moderated list:ARM/Mediatek SoC support,
	moderated list:ARM/Mediatek SoC support

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(-)

-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/4] ASoC: mediatek: mtk-btcvsd: remove useless assignment
  2021-03-11  0:49 [PATCH 0/4] ASoC: mediatek: remove cppcheck warnings Pierre-Louis Bossart
@ 2021-03-11  0:49 ` Pierre-Louis Bossart
  2021-03-11  0:49 ` [PATCH 2/4] ASoC: mediatek: mt2701: align function prototype Pierre-Louis Bossart
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Pierre-Louis Bossart @ 2021-03-11  0:49 UTC (permalink / raw)
  To: alsa-devel
  Cc: tiwai, broonie, linux-kernel, Pierre-Louis Bossart,
	Liam Girdwood, Jaroslav Kysela, Takashi Iwai, Matthias Brugger,
	Lumi Lee, moderated list:ARM/Mediatek SoC support,
	moderated list:ARM/Mediatek SoC support

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;
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/4] ASoC: mediatek: mt2701: align function prototype
  2021-03-11  0:49 [PATCH 0/4] ASoC: mediatek: remove cppcheck warnings Pierre-Louis Bossart
  2021-03-11  0:49 ` [PATCH 1/4] ASoC: mediatek: mtk-btcvsd: remove useless assignment Pierre-Louis Bossart
@ 2021-03-11  0:49 ` Pierre-Louis Bossart
  2021-03-11  0:49 ` [PATCH 3/4] ASoC: mediatek: mt2701: rename shadowed array Pierre-Louis Bossart
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Pierre-Louis Bossart @ 2021-03-11  0:49 UTC (permalink / raw)
  To: alsa-devel
  Cc: tiwai, broonie, linux-kernel, Pierre-Louis Bossart,
	Liam Girdwood, Jaroslav Kysela, Takashi Iwai, Matthias Brugger,
	moderated list:ARM/Mediatek SoC support,
	moderated list:ARM/Mediatek SoC support

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);
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 3/4] ASoC: mediatek: mt2701: rename shadowed array
  2021-03-11  0:49 [PATCH 0/4] ASoC: mediatek: remove cppcheck warnings Pierre-Louis Bossart
  2021-03-11  0:49 ` [PATCH 1/4] ASoC: mediatek: mtk-btcvsd: remove useless assignment Pierre-Louis Bossart
  2021-03-11  0:49 ` [PATCH 2/4] ASoC: mediatek: mt2701: align function prototype Pierre-Louis Bossart
@ 2021-03-11  0:49 ` Pierre-Louis Bossart
  2021-03-11  0:49 ` [PATCH 4/4] ASoC: mediatek: mt8173: rename local irq variable Pierre-Louis Bossart
  2021-03-12 20:23 ` [PATCH 0/4] ASoC: mediatek: remove cppcheck warnings Mark Brown
  4 siblings, 0 replies; 6+ messages in thread
From: Pierre-Louis Bossart @ 2021-03-11  0:49 UTC (permalink / raw)
  To: alsa-devel
  Cc: tiwai, broonie, linux-kernel, Pierre-Louis Bossart,
	Liam Girdwood, Jaroslav Kysela, Takashi Iwai, Matthias Brugger,
	Kuninori Morimoto, moderated list:ARM/Mediatek SoC support,
	moderated list:ARM/Mediatek SoC support

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;
 	}
 
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 4/4] ASoC: mediatek: mt8173: rename local irq variable
  2021-03-11  0:49 [PATCH 0/4] ASoC: mediatek: remove cppcheck warnings Pierre-Louis Bossart
                   ` (2 preceding siblings ...)
  2021-03-11  0:49 ` [PATCH 3/4] ASoC: mediatek: mt2701: rename shadowed array Pierre-Louis Bossart
@ 2021-03-11  0:49 ` Pierre-Louis Bossart
  2021-03-12 20:23 ` [PATCH 0/4] ASoC: mediatek: remove cppcheck warnings Mark Brown
  4 siblings, 0 replies; 6+ messages in thread
From: Pierre-Louis Bossart @ 2021-03-11  0:49 UTC (permalink / raw)
  To: alsa-devel
  Cc: tiwai, broonie, linux-kernel, Pierre-Louis Bossart,
	Liam Girdwood, Jaroslav Kysela, Takashi Iwai, Matthias Brugger,
	Kuninori Morimoto, Ranjani Sridharan,
	moderated list:ARM/Mediatek SoC support,
	moderated list:ARM/Mediatek SoC support

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);
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 0/4] ASoC: mediatek: remove cppcheck warnings
  2021-03-11  0:49 [PATCH 0/4] ASoC: mediatek: remove cppcheck warnings Pierre-Louis Bossart
                   ` (3 preceding siblings ...)
  2021-03-11  0:49 ` [PATCH 4/4] ASoC: mediatek: mt8173: rename local irq variable Pierre-Louis Bossart
@ 2021-03-12 20:23 ` Mark Brown
  4 siblings, 0 replies; 6+ messages in thread
From: Mark Brown @ 2021-03-12 20:23 UTC (permalink / raw)
  To: Pierre-Louis Bossart, alsa-devel
  Cc: moderated list:ARM/Mediatek SoC support,
	moderated list:ARM/Mediatek SoC support, linux-kernel, tiwai,
	Matthias Brugger

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

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-03-12 20:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-11  0:49 [PATCH 0/4] ASoC: mediatek: remove cppcheck warnings Pierre-Louis Bossart
2021-03-11  0:49 ` [PATCH 1/4] ASoC: mediatek: mtk-btcvsd: remove useless assignment Pierre-Louis Bossart
2021-03-11  0:49 ` [PATCH 2/4] ASoC: mediatek: mt2701: align function prototype Pierre-Louis Bossart
2021-03-11  0:49 ` [PATCH 3/4] ASoC: mediatek: mt2701: rename shadowed array Pierre-Louis Bossart
2021-03-11  0:49 ` [PATCH 4/4] ASoC: mediatek: mt8173: rename local irq variable Pierre-Louis Bossart
2021-03-12 20:23 ` [PATCH 0/4] ASoC: mediatek: remove cppcheck warnings Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).