Re: [PATCH v1 3/3] tools: add API to work with sevaral bits at once

2020-12-15 Thread Wei Liu
On Tue, Dec 15, 2020 at 05:29:17PM +0100, Olaf Hering wrote: > Am Tue, 15 Dec 2020 16:22:44 + > schrieb Wei Liu : > > > What's wrong with requiring the input addr be const unsigned long *? > > Probably nothing. In the end I just borrowed the prototypes from the other > functions in this file

Re: [PATCH v1 3/3] tools: add API to work with sevaral bits at once

2020-12-15 Thread Olaf Hering
Am Tue, 15 Dec 2020 16:22:44 + schrieb Wei Liu : > What's wrong with requiring the input addr be const unsigned long *? Probably nothing. In the end I just borrowed the prototypes from the other functions in this file. I will resend with this change once I have the consumers ready. Olaf

Re: [PATCH v1 3/3] tools: add API to work with sevaral bits at once

2020-12-15 Thread Wei Liu
On Wed, Dec 09, 2020 at 04:54:51PM +0100, Olaf Hering wrote: > Introduce new API to test if a fixed number of bits is clear or set, > and clear or set them all at once. > > The caller has to make sure the input bitnumber is a multiply of > BITS_PER_LONG. > > This API avoids the loop over each bi

[PATCH v1 3/3] tools: add API to work with sevaral bits at once

2020-12-09 Thread Olaf Hering
Introduce new API to test if a fixed number of bits is clear or set, and clear or set them all at once. The caller has to make sure the input bitnumber is a multiply of BITS_PER_LONG. This API avoids the loop over each bit in a known range just to see if all of them are either clear or set. Sign