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: [tip:locking/core 11/43] lib/test_context-analysis.c:90 test_raw_spinlock_trylock_extra() warn: mixing irq and irqsave
Date: Fri, 12 Jun 2026 10:46:12 +0800	[thread overview]
Message-ID: <202606121053.UIaYGcgP-lkp@intel.com> (raw)

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
CC: linux-kernel@vger.kernel.org
CC: x86@kernel.org
TO: Marco Elver <elver@google.com>
CC: Peter Zijlstra <peterz@infradead.org>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git locking/core
head:   a837dd95e841586c3a6bbe41c41843b392a1b725
commit: f16a802d402d735a55731f8c94952b3bbb5ddfe8 [11/43] locking/rwlock, spinlock: Support Clang's context analysis
:::::: branch date: 3 days ago
:::::: commit date: 5 months ago
config: csky-randconfig-r072-20260611 (https://download.01.org/0day-ci/archive/20260612/202606121053.UIaYGcgP-lkp@intel.com/config)
compiler: csky-linux-gcc (GCC) 14.3.0
smatch: v0.5.0-9185-gbcc58b9c

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/202606121053.UIaYGcgP-lkp@intel.com/

New smatch warnings:
lib/test_context-analysis.c:90 test_raw_spinlock_trylock_extra() warn: mixing irq and irqsave
include/linux/spinlock.h:604 class_spinlock_try_constructor() warn: passing zero to 'ERR_PTR'

Old smatch warnings:
include/linux/spinlock.h:556 class_raw_spinlock_try_constructor() warn: passing zero to 'ERR_PTR'
lib/test_context-analysis.c:114 test_spinlock_trylock_extra() warn: mixing irq and irqsave

vim +90 lib/test_context-analysis.c

f16a802d402d73 Marco Elver 2025-12-19  74  
f16a802d402d73 Marco Elver 2025-12-19  75  TEST_SPINLOCK_COMMON(raw_spinlock,
f16a802d402d73 Marco Elver 2025-12-19  76  		     raw_spinlock_t,
f16a802d402d73 Marco Elver 2025-12-19  77  		     raw_spin_lock_init,
f16a802d402d73 Marco Elver 2025-12-19  78  		     raw_spin_lock,
f16a802d402d73 Marco Elver 2025-12-19  79  		     raw_spin_unlock,
f16a802d402d73 Marco Elver 2025-12-19  80  		     raw_spin_trylock,
f16a802d402d73 Marco Elver 2025-12-19  81  		     TEST_OP_RW);
f16a802d402d73 Marco Elver 2025-12-19  82  static void __used test_raw_spinlock_trylock_extra(struct test_raw_spinlock_data *d)
f16a802d402d73 Marco Elver 2025-12-19  83  {
f16a802d402d73 Marco Elver 2025-12-19  84  	unsigned long flags;
f16a802d402d73 Marco Elver 2025-12-19  85  
f16a802d402d73 Marco Elver 2025-12-19  86  	if (raw_spin_trylock_irq(&d->lock)) {
f16a802d402d73 Marco Elver 2025-12-19  87  		d->counter++;
f16a802d402d73 Marco Elver 2025-12-19  88  		raw_spin_unlock_irq(&d->lock);
f16a802d402d73 Marco Elver 2025-12-19  89  	}
f16a802d402d73 Marco Elver 2025-12-19 @90  	if (raw_spin_trylock_irqsave(&d->lock, flags)) {
f16a802d402d73 Marco Elver 2025-12-19  91  		d->counter++;
f16a802d402d73 Marco Elver 2025-12-19  92  		raw_spin_unlock_irqrestore(&d->lock, flags);
f16a802d402d73 Marco Elver 2025-12-19  93  	}
f16a802d402d73 Marco Elver 2025-12-19  94  	scoped_cond_guard(raw_spinlock_try, return, &d->lock) {
f16a802d402d73 Marco Elver 2025-12-19  95  		d->counter++;
f16a802d402d73 Marco Elver 2025-12-19  96  	}
f16a802d402d73 Marco Elver 2025-12-19  97  }
f16a802d402d73 Marco Elver 2025-12-19  98  

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

                 reply	other threads:[~2026-06-12  2: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=202606121053.UIaYGcgP-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.