Commit 6add6b02 authored by Pierre-Louis Bossart's avatar Pierre-Louis Bossart Committed by Takashi Iwai

ALSA: pci/oxygen/xonar_wm87x6: remove always true condition

Fix W=1 warnings:

sound/pci/oxygen/xonar_wm87x6.c: In function ‘wm8776_write’:
sound/pci/oxygen/xonar_wm87x6.c:119:11: warning: comparison of
unsigned expression >= 0 is always true [-Wtype-limits]
  119 |   if (reg >= WM8776_HPLVOL && reg <= WM8776_DACMASTER)
      |           ^~
sound/pci/oxygen/xonar_wm87x6.c: In function ‘wm8766_write’:
sound/pci/oxygen/xonar_wm87x6.c:147:12: warning: comparison of
unsigned expression >= 0 is always true [-Wtype-limits]
  147 |   if ((reg >= WM8766_LDA1 && reg <= WM8766_RDA1) ||
      |            ^~
Signed-off-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200702193604.169059-17-pierre-louis.bossart@linux.intel.comSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent ab3ee092
...@@ -116,7 +116,8 @@ static void wm8776_write(struct oxygen *chip, ...@@ -116,7 +116,8 @@ static void wm8776_write(struct oxygen *chip,
else else
wm8776_write_i2c(chip, reg, value); wm8776_write_i2c(chip, reg, value);
if (reg < ARRAY_SIZE(data->wm8776_regs)) { if (reg < ARRAY_SIZE(data->wm8776_regs)) {
if (reg >= WM8776_HPLVOL && reg <= WM8776_DACMASTER) /* reg >= WM8776_HPLVOL is always true */
if (reg <= WM8776_DACMASTER)
value &= ~WM8776_UPDATE; value &= ~WM8776_UPDATE;
data->wm8776_regs[reg] = value; data->wm8776_regs[reg] = value;
} }
...@@ -144,7 +145,8 @@ static void wm8766_write(struct oxygen *chip, ...@@ -144,7 +145,8 @@ static void wm8766_write(struct oxygen *chip,
OXYGEN_SPI_CEN_LATCH_CLOCK_LO, OXYGEN_SPI_CEN_LATCH_CLOCK_LO,
(reg << 9) | value); (reg << 9) | value);
if (reg < ARRAY_SIZE(data->wm8766_regs)) { if (reg < ARRAY_SIZE(data->wm8766_regs)) {
if ((reg >= WM8766_LDA1 && reg <= WM8766_RDA1) || /* reg >= WM8766_LDA1 is always true */
if (reg <= WM8766_RDA1 ||
(reg >= WM8766_LDA2 && reg <= WM8766_MASTDA)) (reg >= WM8766_LDA2 && reg <= WM8766_MASTDA))
value &= ~WM8766_UPDATE; value &= ~WM8766_UPDATE;
data->wm8766_regs[reg] = value; data->wm8766_regs[reg] = value;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment