linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 14/17] ASoC: ti: omap-abe-twl6040: remove useless assignment
       [not found] <20210326215927.936377-1-pierre-louis.bossart@linux.intel.com>
@ 2021-03-26 21:59 ` Pierre-Louis Bossart
  2021-03-29  5:52   ` Péter Ujfalusi
  2021-03-26 21:59 ` [PATCH 15/17] ASoC: ti: omap-mcsp: remove duplicate test Pierre-Louis Bossart
  1 sibling, 1 reply; 4+ messages in thread
From: Pierre-Louis Bossart @ 2021-03-26 21:59 UTC (permalink / raw)
  To: alsa-devel
  Cc: tiwai, broonie, linux-kernel, Pierre-Louis Bossart,
	Peter Ujfalusi, Jarkko Nikula, Liam Girdwood, Jaroslav Kysela,
	Takashi Iwai, open list:OMAP AUDIO SUPPORT

cppcheck warning:

sound/soc/ti/omap-abe-twl6040.c:173:10: style: Variable 'ret' is
assigned a value that is never used. [unreadVariable]
 int ret = 0;
         ^

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
---
 sound/soc/ti/omap-abe-twl6040.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/ti/omap-abe-twl6040.c b/sound/soc/ti/omap-abe-twl6040.c
index 16ea039ff865..91cc9a4f44d7 100644
--- a/sound/soc/ti/omap-abe-twl6040.c
+++ b/sound/soc/ti/omap-abe-twl6040.c
@@ -170,7 +170,7 @@ static int omap_abe_twl6040_init(struct snd_soc_pcm_runtime *rtd)
 	struct snd_soc_card *card = rtd->card;
 	struct abe_twl6040 *priv = snd_soc_card_get_drvdata(card);
 	int hs_trim;
-	int ret = 0;
+	int ret;
 
 	/*
 	 * Configure McPDM offset cancellation based on the HSOTRIM value from
-- 
2.25.1


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

* [PATCH 15/17] ASoC: ti: omap-mcsp: remove duplicate test
       [not found] <20210326215927.936377-1-pierre-louis.bossart@linux.intel.com>
  2021-03-26 21:59 ` [PATCH 14/17] ASoC: ti: omap-abe-twl6040: remove useless assignment Pierre-Louis Bossart
@ 2021-03-26 21:59 ` Pierre-Louis Bossart
  2021-03-29  5:56   ` Péter Ujfalusi
  1 sibling, 1 reply; 4+ messages in thread
From: Pierre-Louis Bossart @ 2021-03-26 21:59 UTC (permalink / raw)
  To: alsa-devel
  Cc: tiwai, broonie, linux-kernel, Pierre-Louis Bossart,
	Peter Ujfalusi, Jarkko Nikula, Liam Girdwood, Jaroslav Kysela,
	Takashi Iwai, open list:OMAP AUDIO SUPPORT

cppcheck warning:

sound/soc/ti/omap-mcbsp.c:379:11: style: The if condition is the same
as the previous if condition [duplicateCondition]

 if (mcbsp->irq) {
          ^
sound/soc/ti/omap-mcbsp.c:376:11: note: First condition
 if (mcbsp->irq)
          ^
sound/soc/ti/omap-mcbsp.c:379:11: note: Second condition
 if (mcbsp->irq) {
          ^

Keeping two separate tests was probably intentional for clarity, but
since this generates warnings we might as well make cppcheck happy so
that we have fewer warnings.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
---
 sound/soc/ti/omap-mcbsp.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/sound/soc/ti/omap-mcbsp.c b/sound/soc/ti/omap-mcbsp.c
index 6025b30bbe77..db47981768c5 100644
--- a/sound/soc/ti/omap-mcbsp.c
+++ b/sound/soc/ti/omap-mcbsp.c
@@ -373,10 +373,9 @@ static void omap_mcbsp_free(struct omap_mcbsp *mcbsp)
 		MCBSP_WRITE(mcbsp, WAKEUPEN, 0);
 
 	/* Disable interrupt requests */
-	if (mcbsp->irq)
+	if (mcbsp->irq) {
 		MCBSP_WRITE(mcbsp, IRQEN, 0);
 
-	if (mcbsp->irq) {
 		free_irq(mcbsp->irq, (void *)mcbsp);
 	} else {
 		free_irq(mcbsp->rx_irq, (void *)mcbsp);
-- 
2.25.1


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

* Re: [PATCH 14/17] ASoC: ti: omap-abe-twl6040: remove useless assignment
  2021-03-26 21:59 ` [PATCH 14/17] ASoC: ti: omap-abe-twl6040: remove useless assignment Pierre-Louis Bossart
@ 2021-03-29  5:52   ` Péter Ujfalusi
  0 siblings, 0 replies; 4+ messages in thread
From: Péter Ujfalusi @ 2021-03-29  5:52 UTC (permalink / raw)
  To: Pierre-Louis Bossart, alsa-devel
  Cc: tiwai, broonie, linux-kernel, Jarkko Nikula, Liam Girdwood,
	Jaroslav Kysela, Takashi Iwai, open list:OMAP AUDIO SUPPORT



On 3/26/21 11:59 PM, Pierre-Louis Bossart wrote:
> cppcheck warning:
> 
> sound/soc/ti/omap-abe-twl6040.c:173:10: style: Variable 'ret' is
> assigned a value that is never used. [unreadVariable]
>  int ret = 0;
>          ^

Thanks,
Acked-by: Peter Ujfalusi <peter.ujfalusi@gmail.com>

> 
> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
> ---
>  sound/soc/ti/omap-abe-twl6040.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/sound/soc/ti/omap-abe-twl6040.c b/sound/soc/ti/omap-abe-twl6040.c
> index 16ea039ff865..91cc9a4f44d7 100644
> --- a/sound/soc/ti/omap-abe-twl6040.c
> +++ b/sound/soc/ti/omap-abe-twl6040.c
> @@ -170,7 +170,7 @@ static int omap_abe_twl6040_init(struct snd_soc_pcm_runtime *rtd)
>  	struct snd_soc_card *card = rtd->card;
>  	struct abe_twl6040 *priv = snd_soc_card_get_drvdata(card);
>  	int hs_trim;
> -	int ret = 0;
> +	int ret;
>  
>  	/*
>  	 * Configure McPDM offset cancellation based on the HSOTRIM value from
> 

-- 
Péter

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

* Re: [PATCH 15/17] ASoC: ti: omap-mcsp: remove duplicate test
  2021-03-26 21:59 ` [PATCH 15/17] ASoC: ti: omap-mcsp: remove duplicate test Pierre-Louis Bossart
@ 2021-03-29  5:56   ` Péter Ujfalusi
  0 siblings, 0 replies; 4+ messages in thread
From: Péter Ujfalusi @ 2021-03-29  5:56 UTC (permalink / raw)
  To: Pierre-Louis Bossart, alsa-devel
  Cc: tiwai, broonie, linux-kernel, Jarkko Nikula, Liam Girdwood,
	Jaroslav Kysela, Takashi Iwai, open list:OMAP AUDIO SUPPORT

Hi Pierre,

On 3/26/21 11:59 PM, Pierre-Louis Bossart wrote:
> cppcheck warning:
> 
> sound/soc/ti/omap-mcbsp.c:379:11: style: The if condition is the same
> as the previous if condition [duplicateCondition]
> 
>  if (mcbsp->irq) {
>           ^
> sound/soc/ti/omap-mcbsp.c:376:11: note: First condition
>  if (mcbsp->irq)
>           ^
> sound/soc/ti/omap-mcbsp.c:379:11: note: Second condition
>  if (mcbsp->irq) {
>           ^
> 
> Keeping two separate tests was probably intentional for clarity, but
> since this generates warnings we might as well make cppcheck happy so
> that we have fewer warnings.

There might be other historical reasons why it ended up like this but
merging them does not make it less cleaner.

Acked-by: Peter Ujfalusi <peter.ujfalusi@gmail.com>

> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
> ---
>  sound/soc/ti/omap-mcbsp.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/sound/soc/ti/omap-mcbsp.c b/sound/soc/ti/omap-mcbsp.c
> index 6025b30bbe77..db47981768c5 100644
> --- a/sound/soc/ti/omap-mcbsp.c
> +++ b/sound/soc/ti/omap-mcbsp.c
> @@ -373,10 +373,9 @@ static void omap_mcbsp_free(struct omap_mcbsp *mcbsp)
>  		MCBSP_WRITE(mcbsp, WAKEUPEN, 0);
>  
>  	/* Disable interrupt requests */
> -	if (mcbsp->irq)
> +	if (mcbsp->irq) {
>  		MCBSP_WRITE(mcbsp, IRQEN, 0);
>  
> -	if (mcbsp->irq) {
>  		free_irq(mcbsp->irq, (void *)mcbsp);
>  	} else {
>  		free_irq(mcbsp->rx_irq, (void *)mcbsp);
> 

-- 
Péter

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

end of thread, other threads:[~2021-03-29  5:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20210326215927.936377-1-pierre-louis.bossart@linux.intel.com>
2021-03-26 21:59 ` [PATCH 14/17] ASoC: ti: omap-abe-twl6040: remove useless assignment Pierre-Louis Bossart
2021-03-29  5:52   ` Péter Ujfalusi
2021-03-26 21:59 ` [PATCH 15/17] ASoC: ti: omap-mcsp: remove duplicate test Pierre-Louis Bossart
2021-03-29  5:56   ` Péter Ujfalusi

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