lkml.org 
[lkml]   [2022]   [Jun]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v2 4/6] bitops: define const_*() versions of the non-atomics
Date
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Date: Fri, 10 Jun 2022 16:56:28 +0300

> On Fri, Jun 10, 2022 at 01:34:25PM +0200, Alexander Lobakin wrote:
> > 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 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 the code, define it separately disregarding the qualifier.
> > Add them to the compile-time type checks as well just in case.
>
> ...
>
> > /* Check that the bitops prototypes are sane */
> > #define __check_bitop_pr(name) \
> > - static_assert(__same_type(arch_##name, generic_##name) && \
> > + static_assert(__same_type(const_##name, generic_##name) && \
> > + __same_type(arch_##name, generic_##name) && \
> > __same_type(name, generic_##name))
>
> Can't it be a one line change and actually keeping ordering at the same time?

Sure. Wanted to sort them "semantically", but it doesn't really make
any sense in here.

>
> --
> With Best Regards,
> Andy Shevchenko

Thanks,
Olek

\
 
 \ /
  Last update: 2022-06-13 20:26    [W:0.098 / U:0.444 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site