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, Dan Carpenter <error27@gmail.com>
Subject: [melver:cap-analysis/dev 23/35] lib/test_capability-analysis.c:125 test_spinlock_trylock_extra() error: uninitialized symbol 'flags'.
Date: Wed, 24 Sep 2025 11:52:50 +0800	[thread overview]
Message-ID: <202509241125.8lkyg6o7-lkp@intel.com> (raw)

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
TO: elver@google.com

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/melver/linux.git cap-analysis/dev
head:   b57fd8af63116c56536eb40f04dbe4f2206ec4ed
commit: 32b884d94862a5295719faf9e1c3b5eef162cca4 [23/35] compiler-capability-analysis: Remove __cond_lock() function-like helper
:::::: branch date: 6 days ago
:::::: commit date: 6 days ago
config: sparc64-randconfig-r072-20250922 (https://download.01.org/0day-ci/archive/20250924/202509241125.8lkyg6o7-lkp@intel.com/config)
compiler: sparc64-linux-gcc (GCC) 12.5.0

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>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202509241125.8lkyg6o7-lkp@intel.com/

New smatch warnings:
lib/test_capability-analysis.c:125 test_spinlock_trylock_extra() error: uninitialized symbol 'flags'.

Old smatch warnings:
lib/test_capability-analysis.c:101 test_raw_spinlock_trylock_extra() warn: mixing irq and irqsave
include/linux/spinlock.h:542 class_raw_spinlock_try_constructor() warn: passing zero to 'ERR_PTR'
lib/test_capability-analysis.c:125 test_spinlock_trylock_extra() warn: mixing irq and irqsave
include/linux/spinlock.h:581 class_spinlock_try_constructor() warn: passing zero to 'ERR_PTR'
include/linux/mutex.h:230 class_mutex_try_constructor() warn: passing zero to 'ERR_PTR'
include/linux/rwsem.h:262 class_rwsem_read_try_constructor() warn: passing zero to 'ERR_PTR'
include/linux/rwsem.h:270 class_rwsem_write_try_constructor() warn: passing zero to 'ERR_PTR'

vim +/flags +125 lib/test_capability-analysis.c

821a2ecb55c76ae Marco Elver 2025-01-23  107  
821a2ecb55c76ae Marco Elver 2025-01-23  108  TEST_SPINLOCK_COMMON(spinlock,
821a2ecb55c76ae Marco Elver 2025-01-23  109  		     spinlock_t,
821a2ecb55c76ae Marco Elver 2025-01-23  110  		     spin_lock_init,
821a2ecb55c76ae Marco Elver 2025-01-23  111  		     spin_lock,
821a2ecb55c76ae Marco Elver 2025-01-23  112  		     spin_unlock,
821a2ecb55c76ae Marco Elver 2025-01-23  113  		     spin_trylock,
821a2ecb55c76ae Marco Elver 2025-01-23  114  		     TEST_OP_RW);
821a2ecb55c76ae Marco Elver 2025-01-23  115  static void __used test_spinlock_trylock_extra(struct test_spinlock_data *d)
821a2ecb55c76ae Marco Elver 2025-01-23  116  {
821a2ecb55c76ae Marco Elver 2025-01-23  117  	unsigned long flags;
821a2ecb55c76ae Marco Elver 2025-01-23  118  
821a2ecb55c76ae Marco Elver 2025-01-23  119  	if (spin_trylock_irq(&d->lock)) {
821a2ecb55c76ae Marco Elver 2025-01-23  120  		d->counter++;
821a2ecb55c76ae Marco Elver 2025-01-23  121  		spin_unlock_irq(&d->lock);
821a2ecb55c76ae Marco Elver 2025-01-23  122  	}
821a2ecb55c76ae Marco Elver 2025-01-23  123  	if (spin_trylock_irqsave(&d->lock, flags)) {
821a2ecb55c76ae Marco Elver 2025-01-23  124  		d->counter++;
821a2ecb55c76ae Marco Elver 2025-01-23 @125  		spin_unlock_irqrestore(&d->lock, flags);
821a2ecb55c76ae Marco Elver 2025-01-23  126  	}
821a2ecb55c76ae Marco Elver 2025-01-23  127  	scoped_cond_guard(spinlock_try, return, &d->lock) {
821a2ecb55c76ae Marco Elver 2025-01-23  128  		d->counter++;
821a2ecb55c76ae Marco Elver 2025-01-23  129  	}
821a2ecb55c76ae Marco Elver 2025-01-23  130  }
821a2ecb55c76ae Marco Elver 2025-01-23  131  

:::::: The code at line 125 was first introduced by commit
:::::: 821a2ecb55c76aebb2a5fc53c7a49c2bc21a59af locking/rwlock, spinlock: Support Clang's capability analysis

:::::: TO: Marco Elver <elver@google.com>
:::::: CC: Marco Elver <elver@google.com>

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

                 reply	other threads:[~2025-09-24  3:54 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=202509241125.8lkyg6o7-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=error27@gmail.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.