diff mbox series

[7/8] ASoC: tegra: tegra20_das: remove always-true comparison

Message ID 20200702165901.164100-8-pierre-louis.bossart@linux.intel.com
State Deferred
Headers show
Series None | expand

Commit Message

Pierre-Louis Bossart July 2, 2020, 4:59 p.m. UTC
Fix W=1 warning:

sound/soc//tegra/tegra20_das.c:101:11: warning:
comparison of unsigned expression >= 0 is always true [-Wtype-limits]
  101 |  if ((reg >= TEGRA20_DAS_DAP_CTRL_SEL) &&
      |           ^~

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

Comments

Jon Hunter July 6, 2020, 3:16 p.m. UTC | #1
On 02/07/2020 17:59, Pierre-Louis Bossart wrote:
> Fix W=1 warning:
> 
> sound/soc//tegra/tegra20_das.c:101:11: warning:
> comparison of unsigned expression >= 0 is always true [-Wtype-limits]
>   101 |  if ((reg >= TEGRA20_DAS_DAP_CTRL_SEL) &&
>       |           ^~
> 
> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
> ---
>  sound/soc/tegra/tegra20_das.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/sound/soc/tegra/tegra20_das.c b/sound/soc/tegra/tegra20_das.c
> index 1070b2710d5e..79dba878d854 100644
> --- a/sound/soc/tegra/tegra20_das.c
> +++ b/sound/soc/tegra/tegra20_das.c
> @@ -98,8 +98,7 @@ EXPORT_SYMBOL_GPL(tegra20_das_connect_dac_to_dap);
>  
>  static bool tegra20_das_wr_rd_reg(struct device *dev, unsigned int reg)
>  {
> -	if ((reg >= TEGRA20_DAS_DAP_CTRL_SEL) &&
> -	    (reg <= LAST_REG(DAP_CTRL_SEL)))
> +	if (reg <= LAST_REG(DAP_CTRL_SEL))
>  		return true;
>  	if ((reg >= TEGRA20_DAS_DAC_INPUT_DATA_CLK_SEL) &&
>  	    (reg <= LAST_REG(DAC_INPUT_DATA_CLK_SEL)))
> 

Thanks!

Reviewed-by: Jon Hunter <jonathanh@nvidia.com>

Cheers
Jon
diff mbox series

Patch

diff --git a/sound/soc/tegra/tegra20_das.c b/sound/soc/tegra/tegra20_das.c
index 1070b2710d5e..79dba878d854 100644
--- a/sound/soc/tegra/tegra20_das.c
+++ b/sound/soc/tegra/tegra20_das.c
@@ -98,8 +98,7 @@  EXPORT_SYMBOL_GPL(tegra20_das_connect_dac_to_dap);
 
 static bool tegra20_das_wr_rd_reg(struct device *dev, unsigned int reg)
 {
-	if ((reg >= TEGRA20_DAS_DAP_CTRL_SEL) &&
-	    (reg <= LAST_REG(DAP_CTRL_SEL)))
+	if (reg <= LAST_REG(DAP_CTRL_SEL))
 		return true;
 	if ((reg >= TEGRA20_DAS_DAC_INPUT_DATA_CLK_SEL) &&
 	    (reg <= LAST_REG(DAC_INPUT_DATA_CLK_SEL)))