]> git.baikalelectronics.ru Git - kernel.git/commit
bitops: define const_*() versions of the non-atomics
authorAlexander Lobakin <alexandr.lobakin@intel.com>
Fri, 24 Jun 2022 12:13:08 +0000 (14:13 +0200)
committerYury Norov <yury.norov@gmail.com>
Fri, 1 Jul 2022 02:52:41 +0000 (19:52 -0700)
commitf9bfccb45d05bc66192f74d4226ef175a6e0f1b8
tree83565d30d7fb5f3da1a099cb2b3192d9d7a6088f
parentd59311fead6d25ca4499fb6b2333f71d93bbc19d
bitops: define const_*() versions of the non-atomics

Define const_*() variants of the non-atomic bitops to be used when
the input arguments are compile-time constants, so that the compiler
will be always able to resolve those to compile-time constants as
well. Those are mostly direct aliases for generic_*() with one
exception for const_test_bit(): the original one is declared
atomic-safe and thus doesn't discard the `volatile` qualifier, so
in order to let optimize code, define it separately disregarding
the qualifier.
Add them to the compile-time type checks as well just in case.

Suggested-by: Marco Elver <elver@google.com>
Signed-off-by: Alexander Lobakin <alexandr.lobakin@intel.com>
Reviewed-by: Marco Elver <elver@google.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Yury Norov <yury.norov@gmail.com>
include/asm-generic/bitops/generic-non-atomic.h
include/linux/bitops.h