linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: Yury Norov <yury.norov@gmail.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Guenter Roeck <linux@roeck-us.net>,
	Dennis Zhou <dennis@kernel.org>,
	Russell King <linux@armlinux.org.uk>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Rasmus Villemoes <linux@rasmusvillemoes.dk>,
	Alexey Klimov <aklimov@redhat.com>,
	Kees Cook <keescook@chromium.org>,
	Andy Whitcroft <apw@canonical.com>
Subject: Re: [PATCH v2 2/3] lib/find_bit: create find_first_zero_bit_le()
Date: Wed, 24 Aug 2022 20:50:04 +0300	[thread overview]
Message-ID: <CAHp75VccfouBXXNNdehB-G_N6P-Ah8VyogcY4c7kSyW2f3VAKg@mail.gmail.com> (raw)
In-Reply-To: <YwYpqRZxCe9NLZyk@yury-laptop>

On Wed, Aug 24, 2022 at 4:37 PM Yury Norov <yury.norov@gmail.com> wrote:
> On Wed, Aug 24, 2022 at 12:22:33PM +0300, Andy Shevchenko wrote:
> > On Wed, Aug 24, 2022 at 5:17 AM Yury Norov <yury.norov@gmail.com> wrote:

...

> > > Like other find_*_le() functions, the new one takes void *addr, instead
> > > of unsigned long *. This should be fixed for all in a separate series.
> >
> > From this comment it is unclear to me why we can't fix them first and
> > then apply this with the correct type?
>
> Because there is a codebase that relies on existing types, mostly in
> filesystem code. And those fs fixes would require 5 or 6 patches.
>
> This would triple the length of this series, and is completely
> unrelated. That's why I think that:
>         > > This should be fixed for all in a separate series.

So comment update then, if a new version is required?

...

> > > +#define word_op swab
> > > +#include "find_bit.h"
> >
> > Looking at this, I would rather always require to define __ffs_word_op
> > (or whatever name) in the user and replace #ifndef in the find_bit.h
> > with
> > #error "The __ffs_word_op must be defined before including find_bit.h!"
>
> This is a local header which is not intended to be included anywhere
> except lib/find_bit{,_be}.c. I don't expect someone else would want to
> include it, even in lib. So what you suggest is a bit overthinking to
> me. But if you insist, I can do that.

Basically by the above you assured me that #error is the right
approach, please do it that way and we will definitely catch the
incorrect users (even by `git grep -lw __ffs_word_op` if they slip
into the kernel somehow).

-- 
With Best Regards,
Andy Shevchenko

  reply	other threads:[~2022-08-24 17:50 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-24  1:26 [PATCH v2 0/4] lib: optimize find_bit() functions Yury Norov
2022-08-24  1:26 ` [PATCH v2 1/3] lib/find_bit: introduce FIND_FIRST_BIT() macro Yury Norov
2022-08-24  9:10   ` Andy Shevchenko
2022-08-24 13:19     ` Yury Norov
2022-08-24 14:18       ` David Laight
2022-08-24 17:45       ` Andy Shevchenko
2022-08-24 17:59   ` Linus Torvalds
2022-08-24  1:26 ` [PATCH v2 2/3] lib/find_bit: create find_first_zero_bit_le() Yury Norov
2022-08-24  9:22   ` Andy Shevchenko
2022-08-24  9:24     ` Andy Shevchenko
2022-08-24 13:37     ` Yury Norov
2022-08-24 17:50       ` Andy Shevchenko [this message]
2022-08-24 17:58       ` Russell King (Oracle)
2022-08-24 20:03         ` Yury Norov
2022-08-24 18:11   ` Linus Torvalds
2022-08-24 22:09     ` Yury Norov
2022-08-24  1:26 ` [PATCH v2 3/3] lib/find_bit: optimize find_next_bit() functions Yury Norov
2022-08-24  9:19   ` Andy Shevchenko
2022-08-24 13:53     ` Yury Norov
2022-08-24 17:54       ` Andy Shevchenko
2022-08-24 17:56         ` Andy Shevchenko
2022-08-24 21:27           ` Yury Norov
2022-08-24  9:00 ` [PATCH v2 0/4] lib: optimize find_bit() functions Andy Shevchenko

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=CAHp75VccfouBXXNNdehB-G_N6P-Ah8VyogcY4c7kSyW2f3VAKg@mail.gmail.com \
    --to=andy.shevchenko@gmail.com \
    --cc=aklimov@redhat.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=apw@canonical.com \
    --cc=catalin.marinas@arm.com \
    --cc=dennis@kernel.org \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=linux@rasmusvillemoes.dk \
    --cc=linux@roeck-us.net \
    --cc=torvalds@linux-foundation.org \
    --cc=yury.norov@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).