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: NMarco Elver <elver@google.com> Signed-off-by: NAlexander Lobakin <alexandr.lobakin@intel.com> Reviewed-by: NMarco Elver <elver@google.com> Reviewed-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: NYury Norov <yury.norov@gmail.com>
Showing
想要评论请 注册 或 登录