locking/qspinlock: Fix 'wait_early' set but not used warning
authorWaiman Long <longman@redhat.com>
Thu, 22 Feb 2024 15:05:37 +0000 (10:05 -0500)
committerIngo Molnar <mingo@kernel.org>
Wed, 28 Feb 2024 12:08:37 +0000 (13:08 +0100)
commitca4bc2e07b716509fd279d2b449bb42f4263a9c8
tree63123ffe5039b9a0800bd965ba040a9e0775dafc
parent6dfee110c6cc7a6c3c1f45a07428c15820b87c1d
locking/qspinlock: Fix 'wait_early' set but not used warning

When CONFIG_LOCK_EVENT_COUNTS is off, the wait_early variable will be
set but not used. This is expected. Recent compilers will not generate
wait_early code in this case.

Add the __maybe_unused attribute to wait_early for suppressing this
W=1 warning.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Waiman Long <longman@redhat.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Reviewed-by: Boqun Feng <boqun.feng@gmail.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: https://lore.kernel.org/r/20240222150540.79981-2-longman@redhat.com
Closes: https://lore.kernel.org/oe-kbuild-all/202312260422.f4pK3f9m-lkp@intel.com/
kernel/locking/qspinlock_paravirt.h