diff mbox series

[21/28] ASoC: ti: omap-mcbsp-st: Remove set, but unused variable 'w'

Message ID 20200707101642.1747944-22-lee.jones@linaro.org
State Superseded
Headers show
Series None | expand

Commit Message

Lee Jones July 7, 2020, 10:16 a.m. UTC
Looks like 'w' has remained unchecked since the driver's inception.

Fixes the following W=1 kernel build warning(s):

 sound/soc/ti/omap-mcbsp-st.c: In function ‘omap_mcbsp_st_chgain’:
 sound/soc/ti/omap-mcbsp-st.c:145:6: warning: variable ‘w’ set but not used [-Wunused-but-set-variable]

Cc: Peter Ujfalusi <peter.ujfalusi@ti.com>
Cc: Jarkko Nikula <jarkko.nikula@bitmer.com>
Cc: Samuel Ortiz <samuel.ortiz@nokia.com>
Cc: linux-omap@vger.kernel.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>

---
 sound/soc/ti/omap-mcbsp-st.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

-- 
2.25.1

Comments

Peter Ujfalusi July 7, 2020, 10:48 a.m. UTC | #1
Hi Lee,

On 07/07/2020 13.16, Lee Jones wrote:
> Looks like 'w' has remained unchecked since the driver's inception.

> 

> Fixes the following W=1 kernel build warning(s):

> 

>  sound/soc/ti/omap-mcbsp-st.c: In function ‘omap_mcbsp_st_chgain’:

>  sound/soc/ti/omap-mcbsp-st.c:145:6: warning: variable ‘w’ set but not used [-Wunused-but-set-variable]

> 

> Cc: Peter Ujfalusi <peter.ujfalusi@ti.com>

> Cc: Jarkko Nikula <jarkko.nikula@bitmer.com>

> Cc: Samuel Ortiz <samuel.ortiz@nokia.com>

> Cc: linux-omap@vger.kernel.org

> Signed-off-by: Lee Jones <lee.jones@linaro.org>

> ---

>  sound/soc/ti/omap-mcbsp-st.c | 3 +--

>  1 file changed, 1 insertion(+), 2 deletions(-)

> 

> diff --git a/sound/soc/ti/omap-mcbsp-st.c b/sound/soc/ti/omap-mcbsp-st.c

> index 5a32b54bbf3bb..643ef7eb68fc8 100644

> --- a/sound/soc/ti/omap-mcbsp-st.c

> +++ b/sound/soc/ti/omap-mcbsp-st.c

> @@ -142,10 +142,9 @@ static void omap_mcbsp_st_fir_write(struct omap_mcbsp *mcbsp, s16 *fir)

>  

>  static void omap_mcbsp_st_chgain(struct omap_mcbsp *mcbsp)

>  {

> -	u16 w;

>  	struct omap_mcbsp_st_data *st_data = mcbsp->st_data;

>  

> -	w = MCBSP_ST_READ(mcbsp, SSELCR);

> +	MCBSP_ST_READ(mcbsp, SSELCR);


The read can be removed at the same time.

>  	MCBSP_ST_WRITE(mcbsp, SGAINCR, ST_CH0GAIN(st_data->ch0gain) |

>  		       ST_CH1GAIN(st_data->ch1gain));

> 


- Péter

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
diff mbox series

Patch

diff --git a/sound/soc/ti/omap-mcbsp-st.c b/sound/soc/ti/omap-mcbsp-st.c
index 5a32b54bbf3bb..643ef7eb68fc8 100644
--- a/sound/soc/ti/omap-mcbsp-st.c
+++ b/sound/soc/ti/omap-mcbsp-st.c
@@ -142,10 +142,9 @@  static void omap_mcbsp_st_fir_write(struct omap_mcbsp *mcbsp, s16 *fir)
 
 static void omap_mcbsp_st_chgain(struct omap_mcbsp *mcbsp)
 {
-	u16 w;
 	struct omap_mcbsp_st_data *st_data = mcbsp->st_data;
 
-	w = MCBSP_ST_READ(mcbsp, SSELCR);
+	MCBSP_ST_READ(mcbsp, SSELCR);
 
 	MCBSP_ST_WRITE(mcbsp, SGAINCR, ST_CH0GAIN(st_data->ch0gain) |
 		       ST_CH1GAIN(st_data->ch1gain));