diff mbox series

[05/23] ASoC: cx2070x: remove useless assignment

Message ID 20210312182246.5153-6-pierre-louis.bossart@linux.intel.com
State Accepted
Commit 4d753b6642ee7304fc56f9fc463bb69ec641a037
Headers show
Series ASoC: codecs: remove cppcheck warnings | expand

Commit Message

Pierre-Louis Bossart March 12, 2021, 6:22 p.m. UTC
Cppcheck warning:

sound/soc/codecs/cx2072x.c:830:26: style: Variable
'reg1.r.rx_data_one_line' is reassigned a value before the old one has
been used. [redundantAssignment]

 reg1.r.rx_data_one_line = 1;
                         ^

sound/soc/codecs/cx2072x.c:782:26: note: reg1.r.rx_data_one_line is
assigned
 reg1.r.rx_data_one_line = 1;
                         ^

sound/soc/codecs/cx2072x.c:830:26: note: reg1.r.rx_data_one_line is
overwritten
 reg1.r.rx_data_one_line = 1;
                         ^

sound/soc/codecs/cx2072x.c:831:26: style: Variable
'reg1.r.tx_data_one_line' is reassigned a value before the old one has
been used. [redundantAssignment]
 reg1.r.tx_data_one_line = 1;
                         ^
sound/soc/codecs/cx2072x.c:783:26: note: reg1.r.tx_data_one_line is
assigned
 reg1.r.tx_data_one_line = 1;
                         ^

sound/soc/codecs/cx2072x.c:831:26: note: reg1.r.tx_data_one_line is
overwritten
 reg1.r.tx_data_one_line = 1;
                         ^

Likely copy/paste.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
---
 sound/soc/codecs/cx2072x.c | 3 ---
 1 file changed, 3 deletions(-)

Comments

Takashi Iwai March 14, 2021, 8:30 a.m. UTC | #1
On Fri, 12 Mar 2021 19:22:28 +0100,
Pierre-Louis Bossart wrote:
> 
> Cppcheck warning:
> 
> sound/soc/codecs/cx2072x.c:830:26: style: Variable
> 'reg1.r.rx_data_one_line' is reassigned a value before the old one has
> been used. [redundantAssignment]
> 
>  reg1.r.rx_data_one_line = 1;
>                          ^
> 
> sound/soc/codecs/cx2072x.c:782:26: note: reg1.r.rx_data_one_line is
> assigned
>  reg1.r.rx_data_one_line = 1;
>                          ^
> 
> sound/soc/codecs/cx2072x.c:830:26: note: reg1.r.rx_data_one_line is
> overwritten
>  reg1.r.rx_data_one_line = 1;
>                          ^
> 
> sound/soc/codecs/cx2072x.c:831:26: style: Variable
> 'reg1.r.tx_data_one_line' is reassigned a value before the old one has
> been used. [redundantAssignment]
>  reg1.r.tx_data_one_line = 1;
>                          ^
> sound/soc/codecs/cx2072x.c:783:26: note: reg1.r.tx_data_one_line is
> assigned
>  reg1.r.tx_data_one_line = 1;
>                          ^
> 
> sound/soc/codecs/cx2072x.c:831:26: note: reg1.r.tx_data_one_line is
> overwritten
>  reg1.r.tx_data_one_line = 1;
>                          ^
> 
> Likely copy/paste.
> 
> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>

Reviewed-by: Takashi Iwai <tiwai@suse.de>


thanks,

Takashi


> ---
>  sound/soc/codecs/cx2072x.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/sound/soc/codecs/cx2072x.c b/sound/soc/codecs/cx2072x.c
> index 8ab22815c2c9..d2d004654c9b 100644
> --- a/sound/soc/codecs/cx2072x.c
> +++ b/sound/soc/codecs/cx2072x.c
> @@ -827,9 +827,6 @@ static int cx2072x_config_i2spcm(struct cx2072x_priv *cx2072x)
>  	}
>  	regdbt2.r.i2s_bclk_invert = is_bclk_inv;
>  
> -	reg1.r.rx_data_one_line = 1;
> -	reg1.r.tx_data_one_line = 1;
> -
>  	/* Configures the BCLK output */
>  	bclk_rate = cx2072x->sample_rate * frame_len;
>  	reg5.r.i2s_pcm_clk_div_chan_en = 0;
> -- 
> 2.25.1
>
Takashi Iwai March 14, 2021, 8:30 a.m. UTC | #2
On Fri, 12 Mar 2021 19:22:28 +0100,
Pierre-Louis Bossart wrote:
> 
> Cppcheck warning:
> 
> sound/soc/codecs/cx2072x.c:830:26: style: Variable
> 'reg1.r.rx_data_one_line' is reassigned a value before the old one has
> been used. [redundantAssignment]
> 
>  reg1.r.rx_data_one_line = 1;
>                          ^
> 
> sound/soc/codecs/cx2072x.c:782:26: note: reg1.r.rx_data_one_line is
> assigned
>  reg1.r.rx_data_one_line = 1;
>                          ^
> 
> sound/soc/codecs/cx2072x.c:830:26: note: reg1.r.rx_data_one_line is
> overwritten
>  reg1.r.rx_data_one_line = 1;
>                          ^
> 
> sound/soc/codecs/cx2072x.c:831:26: style: Variable
> 'reg1.r.tx_data_one_line' is reassigned a value before the old one has
> been used. [redundantAssignment]
>  reg1.r.tx_data_one_line = 1;
>                          ^
> sound/soc/codecs/cx2072x.c:783:26: note: reg1.r.tx_data_one_line is
> assigned
>  reg1.r.tx_data_one_line = 1;
>                          ^
> 
> sound/soc/codecs/cx2072x.c:831:26: note: reg1.r.tx_data_one_line is
> overwritten
>  reg1.r.tx_data_one_line = 1;
>                          ^
> 
> Likely copy/paste.
> 
> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>

Reviewed-by: Takashi Iwai <tiwai@suse.de>


thanks,

Takashi
diff mbox series

Patch

diff --git a/sound/soc/codecs/cx2072x.c b/sound/soc/codecs/cx2072x.c
index 8ab22815c2c9..d2d004654c9b 100644
--- a/sound/soc/codecs/cx2072x.c
+++ b/sound/soc/codecs/cx2072x.c
@@ -827,9 +827,6 @@  static int cx2072x_config_i2spcm(struct cx2072x_priv *cx2072x)
 	}
 	regdbt2.r.i2s_bclk_invert = is_bclk_inv;
 
-	reg1.r.rx_data_one_line = 1;
-	reg1.r.tx_data_one_line = 1;
-
 	/* Configures the BCLK output */
 	bclk_rate = cx2072x->sample_rate * frame_len;
 	reg5.r.i2s_pcm_clk_div_chan_en = 0;