sound/soc/intel/keembay/kmb_platform.c:180:3: warning: converting the result of '<<' to a boolean always evaluates to true

From: kernel test robot
Date: Thu Jan 14 2021 - 11:47:52 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 65f0d2414b7079556fbbcc070b3d1c9f9587606d
commit: 84569f329f7fcb40b7b1860f273b2909dabf2a2b Merge remote-tracking branch 'asoc/for-5.9' into asoc-next
date: 6 months ago
config: mips-randconfig-r026-20210114 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 68ff52ffead2ba25cca442778ab19286000daad7)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install mips cross compiling tool for clang build
# apt-get install binutils-mips-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=84569f329f7fcb40b7b1860f273b2909dabf2a2b
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 84569f329f7fcb40b7b1860f273b2909dabf2a2b
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=mips

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All warnings (new ones prefixed by >>):

In file included from include/linux/thread_info.h:38:
In file included from arch/mips/include/asm/thread_info.h:16:
In file included from arch/mips/include/asm/processor.h:14:
In file included from include/linux/atomic.h:7:
arch/mips/include/asm/atomic.h:258:1: warning: converting the result of '<<' to a boolean always evaluates to true [-Wtautological-constant-compare]
ATOMIC_SIP_OP(atomic, int, subu, ll, sc)
^
arch/mips/include/asm/atomic.h:252:7: note: expanded from macro 'ATOMIC_SIP_OP'
if (!__SYNC_loongson3_war) \
^
arch/mips/include/asm/sync.h:147:34: note: expanded from macro '__SYNC_loongson3_war'
# define __SYNC_loongson3_war (1 << 31)
^
In file included from sound/soc/intel/keembay/kmb_platform.c:8:
In file included from include/linux/clk.h:14:
In file included from include/linux/notifier.h:14:
In file included from include/linux/mutex.h:14:
In file included from ./arch/mips/include/generated/asm/current.h:1:
In file included from include/asm-generic/current.h:5:
In file included from include/linux/thread_info.h:38:
In file included from arch/mips/include/asm/thread_info.h:16:
In file included from arch/mips/include/asm/processor.h:14:
In file included from include/linux/atomic.h:7:
arch/mips/include/asm/atomic.h:262:1: warning: converting the result of '<<' to a boolean always evaluates to true [-Wtautological-constant-compare]
ATOMIC_SIP_OP(atomic64, s64, dsubu, lld, scd)
^
arch/mips/include/asm/atomic.h:252:7: note: expanded from macro 'ATOMIC_SIP_OP'
if (!__SYNC_loongson3_war) \
^
arch/mips/include/asm/sync.h:147:34: note: expanded from macro '__SYNC_loongson3_war'
# define __SYNC_loongson3_war (1 << 31)
^
In file included from sound/soc/intel/keembay/kmb_platform.c:8:
In file included from include/linux/clk.h:14:
In file included from include/linux/notifier.h:14:
In file included from include/linux/mutex.h:16:
In file included from include/linux/spinlock_types.h:18:
In file included from include/linux/lockdep.h:44:
include/linux/debug_locks.h:17:9: warning: converting the result of '<<' to a boolean always evaluates to true [-Wtautological-constant-compare]
return xchg(&debug_locks, 0);
^
arch/mips/include/asm/cmpxchg.h:102:7: note: expanded from macro 'xchg'
if (!__SYNC_loongson3_war) \
^
arch/mips/include/asm/sync.h:147:34: note: expanded from macro '__SYNC_loongson3_war'
# define __SYNC_loongson3_war (1 << 31)
^
In file included from sound/soc/intel/keembay/kmb_platform.c:8:
In file included from include/linux/clk.h:14:
In file included from include/linux/notifier.h:16:
In file included from include/linux/srcu.h:21:
In file included from include/linux/workqueue.h:9:
In file included from include/linux/timer.h:6:
In file included from include/linux/ktime.h:24:
In file included from include/linux/time.h:74:
In file included from include/linux/time32.h:13:
In file included from include/linux/timex.h:65:
In file included from arch/mips/include/asm/timex.h:19:
In file included from arch/mips/include/asm/cpu-type.h:12:
In file included from include/linux/smp.h:15:
In file included from include/linux/smp_types.h:5:
include/linux/llist.h:222:9: warning: converting the result of '<<' to a boolean always evaluates to true [-Wtautological-constant-compare]
return xchg(&head->first, NULL);
^
arch/mips/include/asm/cmpxchg.h:102:7: note: expanded from macro 'xchg'
if (!__SYNC_loongson3_war) \
^
arch/mips/include/asm/sync.h:147:34: note: expanded from macro '__SYNC_loongson3_war'
# define __SYNC_loongson3_war (1 << 31)
^
In file included from sound/soc/intel/keembay/kmb_platform.c:11:
In file included from include/sound/pcm.h:15:
In file included from include/linux/mm.h:32:
In file included from include/linux/pgtable.h:6:
arch/mips/include/asm/pgtable.h:210:3: warning: converting the result of '<<' to a boolean always evaluates to true [-Wtautological-constant-compare]
cmpxchg64(&buddy->pte, 0, _PAGE_GLOBAL);
^
arch/mips/include/asm/cmpxchg.h:220:2: note: expanded from macro 'cmpxchg64'
cmpxchg((ptr), (o), (n)); \
^
arch/mips/include/asm/cmpxchg.h:194:7: note: expanded from macro 'cmpxchg'
if (!__SYNC_loongson3_war) \
^
arch/mips/include/asm/sync.h:147:34: note: expanded from macro '__SYNC_loongson3_war'
# define __SYNC_loongson3_war (1 << 31)
^
In file included from sound/soc/intel/keembay/kmb_platform.c:11:
In file included from include/sound/pcm.h:15:
In file included from include/linux/mm.h:32:
In file included from include/linux/pgtable.h:6:
arch/mips/include/asm/pgtable.h:210:3: warning: converting the result of '<<' to a boolean always evaluates to true [-Wtautological-constant-compare]
arch/mips/include/asm/cmpxchg.h:220:2: note: expanded from macro 'cmpxchg64'
cmpxchg((ptr), (o), (n)); \
^
arch/mips/include/asm/cmpxchg.h:204:7: note: expanded from macro 'cmpxchg'
if (!__SYNC_loongson3_war) \
^
arch/mips/include/asm/sync.h:147:34: note: expanded from macro '__SYNC_loongson3_war'
# define __SYNC_loongson3_war (1 << 31)
^
>> sound/soc/intel/keembay/kmb_platform.c:180:3: warning: converting the result of '<<' to a boolean always evaluates to true [-Wtautological-constant-compare]
cmpxchg(&kmb_i2s->tx_ptr, ptr, new_ptr);
^
arch/mips/include/asm/cmpxchg.h:194:7: note: expanded from macro 'cmpxchg'
if (!__SYNC_loongson3_war) \
^
arch/mips/include/asm/sync.h:147:34: note: expanded from macro '__SYNC_loongson3_war'
# define __SYNC_loongson3_war (1 << 31)
^
>> sound/soc/intel/keembay/kmb_platform.c:180:3: warning: converting the result of '<<' to a boolean always evaluates to true [-Wtautological-constant-compare]
arch/mips/include/asm/cmpxchg.h:204:7: note: expanded from macro 'cmpxchg'
if (!__SYNC_loongson3_war) \
^
arch/mips/include/asm/sync.h:147:34: note: expanded from macro '__SYNC_loongson3_war'
# define __SYNC_loongson3_war (1 << 31)
^
sound/soc/intel/keembay/kmb_platform.c:185:3: warning: converting the result of '<<' to a boolean always evaluates to true [-Wtautological-constant-compare]
cmpxchg(&kmb_i2s->rx_ptr, ptr, new_ptr);
^
arch/mips/include/asm/cmpxchg.h:194:7: note: expanded from macro 'cmpxchg'
if (!__SYNC_loongson3_war) \
^
arch/mips/include/asm/sync.h:147:34: note: expanded from macro '__SYNC_loongson3_war'
# define __SYNC_loongson3_war (1 << 31)
^
sound/soc/intel/keembay/kmb_platform.c:185:3: warning: converting the result of '<<' to a boolean always evaluates to true [-Wtautological-constant-compare]
arch/mips/include/asm/cmpxchg.h:204:7: note: expanded from macro 'cmpxchg'
if (!__SYNC_loongson3_war) \
^
arch/mips/include/asm/sync.h:147:34: note: expanded from macro '__SYNC_loongson3_war'
# define __SYNC_loongson3_war (1 << 31)
^
16 warnings generated.


vim +180 sound/soc/intel/keembay/kmb_platform.c

c5477e966728f8e9 Sia Jee Heng 2020-06-09 160
c5477e966728f8e9 Sia Jee Heng 2020-06-09 161 static void kmb_pcm_operation(struct kmb_i2s_info *kmb_i2s, bool playback)
c5477e966728f8e9 Sia Jee Heng 2020-06-09 162 {
c5477e966728f8e9 Sia Jee Heng 2020-06-09 163 struct snd_pcm_substream *substream;
c5477e966728f8e9 Sia Jee Heng 2020-06-09 164 bool period_elapsed;
c5477e966728f8e9 Sia Jee Heng 2020-06-09 165 unsigned int new_ptr;
c5477e966728f8e9 Sia Jee Heng 2020-06-09 166 unsigned int ptr;
c5477e966728f8e9 Sia Jee Heng 2020-06-09 167
c5477e966728f8e9 Sia Jee Heng 2020-06-09 168 if (playback)
c5477e966728f8e9 Sia Jee Heng 2020-06-09 169 substream = kmb_i2s->tx_substream;
c5477e966728f8e9 Sia Jee Heng 2020-06-09 170 else
c5477e966728f8e9 Sia Jee Heng 2020-06-09 171 substream = kmb_i2s->rx_substream;
c5477e966728f8e9 Sia Jee Heng 2020-06-09 172
c5477e966728f8e9 Sia Jee Heng 2020-06-09 173 if (!substream || !snd_pcm_running(substream))
c5477e966728f8e9 Sia Jee Heng 2020-06-09 174 return;
c5477e966728f8e9 Sia Jee Heng 2020-06-09 175
c5477e966728f8e9 Sia Jee Heng 2020-06-09 176 if (playback) {
c5477e966728f8e9 Sia Jee Heng 2020-06-09 177 ptr = kmb_i2s->tx_ptr;
c5477e966728f8e9 Sia Jee Heng 2020-06-09 178 new_ptr = kmb_pcm_tx_fn(kmb_i2s, substream->runtime,
c5477e966728f8e9 Sia Jee Heng 2020-06-09 179 ptr, &period_elapsed);
c5477e966728f8e9 Sia Jee Heng 2020-06-09 @180 cmpxchg(&kmb_i2s->tx_ptr, ptr, new_ptr);
c5477e966728f8e9 Sia Jee Heng 2020-06-09 181 } else {
c5477e966728f8e9 Sia Jee Heng 2020-06-09 182 ptr = kmb_i2s->rx_ptr;
c5477e966728f8e9 Sia Jee Heng 2020-06-09 183 new_ptr = kmb_pcm_rx_fn(kmb_i2s, substream->runtime,
c5477e966728f8e9 Sia Jee Heng 2020-06-09 184 ptr, &period_elapsed);
c5477e966728f8e9 Sia Jee Heng 2020-06-09 185 cmpxchg(&kmb_i2s->rx_ptr, ptr, new_ptr);
c5477e966728f8e9 Sia Jee Heng 2020-06-09 186 }
c5477e966728f8e9 Sia Jee Heng 2020-06-09 187
c5477e966728f8e9 Sia Jee Heng 2020-06-09 188 if (period_elapsed)
c5477e966728f8e9 Sia Jee Heng 2020-06-09 189 snd_pcm_period_elapsed(substream);
c5477e966728f8e9 Sia Jee Heng 2020-06-09 190 }
c5477e966728f8e9 Sia Jee Heng 2020-06-09 191

:::::: The code at line 180 was first introduced by commit
:::::: c5477e966728f8e9d1434543d4ee677d515e1078 ASoC: Intel: Add KeemBay platform driver

:::::: TO: Sia Jee Heng <jee.heng.sia@xxxxxxxxx>
:::::: CC: Mark Brown <broonie@xxxxxxxxxx>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip