mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Mark Brown <broonie@kernel.org>
Cc: kbuild-all@lists.01.org, clang-built-linux@googlegroups.com,
	linux-kernel@vger.kernel.org
Subject: sound/soc/intel/keembay/kmb_platform.c:180:3: warning: converting the result of '<<' to a boolean always evaluates to true
Date: Fri, 15 Jan 2021 00:46:33 +0800	[thread overview]
Message-ID: <202101150028.EvFmPpYL-lkp@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 12164 bytes --]

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@intel.com>

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@intel.com>
:::::: CC: Mark Brown <broonie@kernel.org>

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

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 36389 bytes --]

                 reply	other threads:[~2021-01-14 16:47 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202101150028.EvFmPpYL-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=broonie@kernel.org \
    --cc=clang-built-linux@googlegroups.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®