All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: oe-kbuild@lists.linux.dev
Cc: lkp@intel.com
Subject: include/asm-generic/bitops/lock.h:63:15: sparse: sparse: cast from unknown type
Date: Sun, 3 Dec 2023 18:38:57 +0800	[thread overview]
Message-ID: <202312031857.agi3d4au-lkp@intel.com> (raw)

:::::: 
:::::: Manual check reason: "low confidence static check first_new_problem: include/asm-generic/bitops/lock.h:63:15: sparse: sparse: cast from unknown type"
:::::: 

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
CC: linux-kernel@vger.kernel.org
TO: Will Deacon <will@kernel.org>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   968f35f4ab1c0966ceb39af3c89f2e24afedf878
commit: a5460b5e5fb82656807840d40d3deaecad094044 READ_ONCE: Simplify implementations of {READ,WRITE}_ONCE()
date:   3 years, 8 months ago
:::::: branch date: 10 hours ago
:::::: commit date: 3 years, 8 months ago
config: sparc64-randconfig-r112-20231130 (https://download.01.org/0day-ci/archive/20231203/202312031857.agi3d4au-lkp@intel.com/config)
compiler: sparc64-linux-gcc (GCC) 13.2.0
reproduce: (https://download.01.org/0day-ci/archive/20231203/202312031857.agi3d4au-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/r/202312031857.agi3d4au-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
   include/asm-generic/atomic-long.h:997:1: sparse: sparse: Expected ; at the end of type declaration
   include/asm-generic/atomic-long.h:997:1: sparse: sparse: got }
   include/asm-generic/atomic-long.h:1003:1: sparse: sparse: Expected ; at the end of type declaration
   include/asm-generic/atomic-long.h:1003:1: sparse: sparse: got }
   include/asm-generic/atomic-long.h:1009:1: sparse: sparse: Expected ; at the end of type declaration
   include/asm-generic/atomic-long.h:1009:1: sparse: sparse: got }
   arch/sparc/vdso/vdso32/vclock_gettime.c: note: in included file (through arch/sparc/include/asm/bitops_64.h, arch/sparc/include/asm/bitops.h, include/linux/bitops.h, ...):
   include/asm-generic/bitops/lock.h:24:11: sparse: sparse: Expected ; at end of declaration
   include/asm-generic/bitops/lock.h:24:11: sparse: sparse: got +=
   include/asm-generic/bitops/lock.h:25:13: sparse: sparse: Expected ) in function declarator
   include/asm-generic/bitops/lock.h:25:13: sparse: sparse: got (
   include/asm-generic/bitops/lock.h:25:9: sparse: sparse: Trying to use reserved word 'if' as identifier
   include/asm-generic/bitops/lock.h:25:13: sparse: sparse: Trying to use reserved word 'do' as identifier
   include/asm-generic/bitops/lock.h:25:13: sparse: sparse: Expected ; at end of declaration
   include/asm-generic/bitops/lock.h:25:13: sparse: sparse: got {
   include/asm-generic/bitops/lock.h:25:13: sparse: sparse: Expected ; at the end of type declaration
   include/asm-generic/bitops/lock.h:25:13: sparse: sparse: got }
   include/asm-generic/bitops/lock.h:28:66: sparse: sparse: No right hand side of '*'-expression
   include/asm-generic/bitops/lock.h:28:67: sparse: sparse: Expected ) in function call
   include/asm-generic/bitops/lock.h:28:67: sparse: sparse: got p
   include/asm-generic/bitops/lock.h:29:9: sparse: sparse: Trying to use reserved word 'return' as identifier
   include/asm-generic/bitops/lock.h:29:16: sparse: sparse: Expected ; at end of declaration
   include/asm-generic/bitops/lock.h:29:16: sparse: sparse: got !
   include/asm-generic/bitops/lock.h:30:1: sparse: sparse: Expected ; at the end of type declaration
   include/asm-generic/bitops/lock.h:30:1: sparse: sparse: got }
   include/asm-generic/bitops/lock.h:43:42: sparse: sparse: Expected ) in function declarator
   include/asm-generic/bitops/lock.h:43:42: sparse: sparse: got (
   include/asm-generic/bitops/lock.h:44:1: sparse: sparse: Expected ; at the end of type declaration
   include/asm-generic/bitops/lock.h:44:1: sparse: sparse: got }
   include/asm-generic/bitops/lock.h:62:11: sparse: sparse: Expected ; at end of declaration
   include/asm-generic/bitops/lock.h:62:11: sparse: sparse: got +=
   include/asm-generic/bitops/lock.h:64:13: sparse: sparse: Expected ; at end of declaration
   include/asm-generic/bitops/lock.h:64:13: sparse: sparse: got &=
   include/asm-generic/bitops/lock.h:65:33: sparse: sparse: Expected ) in function declarator
   include/asm-generic/bitops/lock.h:65:33: sparse: sparse: got (
   include/asm-generic/bitops/lock.h:66:1: sparse: sparse: Expected ; at the end of type declaration
   include/asm-generic/bitops/lock.h:66:1: sparse: sparse: got }
   include/asm-generic/bitops/lock.h:84:11: sparse: sparse: Expected ; at end of declaration
   include/asm-generic/bitops/lock.h:84:11: sparse: sparse: got +=
   include/asm-generic/bitops/lock.h:85:70: sparse: sparse: No right hand side of '*'-expression
   include/asm-generic/bitops/lock.h:85:71: sparse: sparse: Expected ) in function call
   include/asm-generic/bitops/lock.h:85:71: sparse: sparse: got p
   include/asm-generic/bitops/lock.h:86:9: sparse: sparse: Trying to use reserved word 'return' as identifier
   include/asm-generic/bitops/lock.h:86:16: sparse: sparse: Expected ; at end of declaration
   include/asm-generic/bitops/lock.h:86:16: sparse: sparse: got !
   include/asm-generic/bitops/lock.h:87:1: sparse: sparse: Expected ; at the end of type declaration
   include/asm-generic/bitops/lock.h:87:1: sparse: sparse: got }
   arch/sparc/vdso/vdso32/vclock_gettime.c: note: in included file (through include/linux/atomic.h, include/asm-generic/bitops/lock.h, arch/sparc/include/asm/bitops_64.h, ...):
   include/linux/atomic-fallback.h:2028:13: sparse: sparse: undefined identifier 'v'
   include/linux/atomic-fallback.h:2028:13: sparse: sparse: undefined identifier 'v'
   include/linux/atomic-fallback.h:2028:13: sparse: sparse: undefined identifier 'o'
   include/linux/atomic-fallback.h:2028:13: sparse: sparse: undefined identifier 'v'
   include/linux/atomic-fallback.h:2028:13: sparse: sparse: undefined identifier 'new'
   include/linux/atomic-fallback.h:2028:13: sparse: sparse: undefined identifier 'v'
   include/linux/atomic-fallback.h:2028:13: sparse: sparse: undefined identifier 'v'
   include/linux/atomic-fallback.h:2028:13: sparse: sparse: cast from unknown type
   include/linux/atomic-fallback.h:2041:13: sparse: sparse: undefined identifier 'v'
   include/linux/atomic-fallback.h:2041:13: sparse: sparse: undefined identifier 'v'
   include/linux/atomic-fallback.h:2041:13: sparse: sparse: undefined identifier 'o'
   include/linux/atomic-fallback.h:2041:13: sparse: sparse: undefined identifier 'v'
   include/linux/atomic-fallback.h:2041:13: sparse: sparse: undefined identifier 'new'
   include/linux/atomic-fallback.h:2041:13: sparse: sparse: undefined identifier 'v'
   include/linux/atomic-fallback.h:2041:13: sparse: sparse: undefined identifier 'v'
   include/linux/atomic-fallback.h:2041:13: sparse: sparse: cast from unknown type
   include/linux/atomic-fallback.h:2041:9: sparse: sparse: symbol 'r' has multiple initializers (originally initialized at include/linux/atomic-fallback.h:2028)
   include/linux/atomic-fallback.h:2054:13: sparse: sparse: undefined identifier 'v'
   include/linux/atomic-fallback.h:2054:13: sparse: sparse: undefined identifier 'v'
   include/linux/atomic-fallback.h:2054:13: sparse: sparse: undefined identifier 'o'
   include/linux/atomic-fallback.h:2054:13: sparse: sparse: undefined identifier 'v'
   include/linux/atomic-fallback.h:2054:13: sparse: sparse: undefined identifier 'new'
   include/linux/atomic-fallback.h:2054:13: sparse: sparse: undefined identifier 'v'
   include/linux/atomic-fallback.h:2054:13: sparse: sparse: undefined identifier 'v'
   include/linux/atomic-fallback.h:2054:13: sparse: sparse: cast from unknown type
   include/linux/atomic-fallback.h:2054:9: sparse: sparse: symbol 'r' has multiple initializers (originally initialized at include/linux/atomic-fallback.h:2041)
   include/linux/atomic-fallback.h:2067:13: sparse: sparse: undefined identifier 'v'
   include/linux/atomic-fallback.h:2067:13: sparse: sparse: undefined identifier 'v'
   include/linux/atomic-fallback.h:2067:13: sparse: sparse: undefined identifier 'o'
   include/linux/atomic-fallback.h:2067:13: sparse: sparse: undefined identifier 'v'
   include/linux/atomic-fallback.h:2067:13: sparse: sparse: undefined identifier 'new'
   include/linux/atomic-fallback.h:2067:13: sparse: sparse: undefined identifier 'v'
   include/linux/atomic-fallback.h:2067:13: sparse: sparse: undefined identifier 'v'
   include/linux/atomic-fallback.h:2067:13: sparse: sparse: cast from unknown type
   include/linux/atomic-fallback.h:2067:9: sparse: sparse: symbol 'r' has multiple initializers (originally initialized at include/linux/atomic-fallback.h:2054)
   arch/sparc/vdso/vdso32/vclock_gettime.c: note: in included file (through include/linux/atomic.h, include/asm-generic/bitops/lock.h, arch/sparc/include/asm/bitops_64.h, ...):
   include/asm-generic/atomic-long.h:906:16: sparse: sparse: undefined identifier 'v'
   include/asm-generic/atomic-long.h:906:16: sparse: sparse: undefined identifier 'new'
   include/asm-generic/atomic-long.h:912:16: sparse: sparse: undefined identifier 'v'
   include/asm-generic/atomic-long.h:912:16: sparse: sparse: undefined identifier 'new'
   include/asm-generic/atomic-long.h:912:16: sparse: sparse: symbol '_n_' has multiple initializers (originally initialized at include/asm-generic/atomic-long.h:906)
   include/asm-generic/atomic-long.h:918:16: sparse: sparse: undefined identifier 'v'
   include/asm-generic/atomic-long.h:918:16: sparse: sparse: undefined identifier 'new'
   include/asm-generic/atomic-long.h:918:16: sparse: sparse: symbol '_n_' has multiple initializers (originally initialized at include/asm-generic/atomic-long.h:912)
   include/asm-generic/atomic-long.h:924:16: sparse: sparse: undefined identifier 'v'
   include/asm-generic/atomic-long.h:924:16: sparse: sparse: undefined identifier 'new'
   include/asm-generic/atomic-long.h:924:16: sparse: sparse: symbol '_n_' has multiple initializers (originally initialized at include/asm-generic/atomic-long.h:918)
   arch/sparc/vdso/vdso32/vclock_gettime.c: note: in included file (through arch/sparc/include/asm/bitops_64.h, arch/sparc/include/asm/bitops.h, include/linux/bitops.h, ...):
   include/asm-generic/bitops/lock.h:22:30: sparse: sparse: undefined identifier 'nr'
   include/asm-generic/bitops/lock.h:28:15: sparse: sparse: undefined identifier 'atomic_long_fetch_or_acquire'
   include/asm-generic/bitops/lock.h:63:15: sparse: sparse: cannot dereference this type
   include/asm-generic/bitops/lock.h:63:15: sparse: sparse: cannot dereference this type
>> include/asm-generic/bitops/lock.h:63:15: sparse: sparse: cast from unknown type
   include/asm-generic/bitops/lock.h:63:15: sparse: sparse: cannot dereference this type
   include/asm-generic/bitops/lock.h:63:9: sparse: sparse: symbol 'old' has multiple initializers (originally initialized at include/asm-generic/bitops/lock.h:28)
   include/asm-generic/bitops/lock.h:82:30: sparse: sparse: undefined identifier 'nr'
   include/asm-generic/bitops/lock.h:82:23: sparse: sparse: symbol 'mask' has multiple initializers (originally initialized at include/asm-generic/bitops/lock.h:22)
   include/asm-generic/bitops/lock.h:85:55: sparse: sparse: undefined identifier 'atomic_long_t'
   include/asm-generic/bitops/lock.h:85:9: sparse: sparse: symbol 'old' has multiple initializers (originally initialized at include/asm-generic/bitops/lock.h:63)

vim +63 include/asm-generic/bitops/lock.h

26333576fd0d0b Nick Piggin    2007-10-18  45  
26333576fd0d0b Nick Piggin    2007-10-18  46  /**
26333576fd0d0b Nick Piggin    2007-10-18  47   * __clear_bit_unlock - Clear a bit in memory, for unlock
26333576fd0d0b Nick Piggin    2007-10-18  48   * @nr: the bit to set
26333576fd0d0b Nick Piggin    2007-10-18  49   * @addr: the address to start counting from
26333576fd0d0b Nick Piggin    2007-10-18  50   *
f75d48644c56a3 Peter Zijlstra 2016-03-09  51   * A weaker form of clear_bit_unlock() as used by __bit_lock_unlock(). If all
f75d48644c56a3 Peter Zijlstra 2016-03-09  52   * the bits in the word are protected by this lock some archs can use weaker
f75d48644c56a3 Peter Zijlstra 2016-03-09  53   * ops to safely unlock.
f75d48644c56a3 Peter Zijlstra 2016-03-09  54   *
f75d48644c56a3 Peter Zijlstra 2016-03-09  55   * See for example x86's implementation.
26333576fd0d0b Nick Piggin    2007-10-18  56   */
84c6591103dbea Will Deacon    2018-06-19  57  static inline void __clear_bit_unlock(unsigned int nr,
84c6591103dbea Will Deacon    2018-06-19  58  				      volatile unsigned long *p)
84c6591103dbea Will Deacon    2018-06-19  59  {
84c6591103dbea Will Deacon    2018-06-19  60  	unsigned long old;
26333576fd0d0b Nick Piggin    2007-10-18  61  
84c6591103dbea Will Deacon    2018-06-19  62  	p += BIT_WORD(nr);
84c6591103dbea Will Deacon    2018-06-19 @63  	old = READ_ONCE(*p);
84c6591103dbea Will Deacon    2018-06-19  64  	old &= ~BIT_MASK(nr);
84c6591103dbea Will Deacon    2018-06-19  65  	atomic_long_set_release((atomic_long_t *)p, old);
84c6591103dbea Will Deacon    2018-06-19  66  }
84c6591103dbea Will Deacon    2018-06-19  67  

:::::: The code at line 63 was first introduced by commit
:::::: 84c6591103dbeaf393a092a3fc7b09510825f6b9 locking/atomics, asm-generic/bitops/lock.h: Rewrite using atomic_fetch_*()

:::::: TO: Will Deacon <will.deacon@arm.com>
:::::: CC: Ingo Molnar <mingo@kernel.org>

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

                 reply	other threads:[~2023-12-03 10:39 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=202312031857.agi3d4au-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=oe-kbuild@lists.linux.dev \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.