From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Yury Norov <yury.norov@gmail.com>
Cc: linux-kernel@vger.kernel.org,
Rasmus Villemoes <linux@rasmusvillemoes.dk>
Subject: Re: [PATCH v2 6/6] bitmap: move bitmap_*_region functions to bitmap.h
Date: Fri, 11 Aug 2023 12:27:51 +0300 [thread overview]
Message-ID: <ZNX/F45GKXSRDgG/@smile.fi.intel.com> (raw)
In-Reply-To: <20230811005732.107718-7-yury.norov@gmail.com>
On Thu, Aug 10, 2023 at 05:57:32PM -0700, Yury Norov wrote:
> Now that bitmap_*_region() functions are implemented as thin wrappers
> around others, it's worth to move them to the header, as it opens room
> for compile-time optimizations.
...
> + * Return 0 on success, or %-EBUSY if specified region wasn't
> + * free (not all bits were zero).
Run
scripts/kernel-doc -v -none -Wall
against this
...
> + * Return the bit offset in bitmap of the allocated region,
> + * or -errno on failure.
Ditto.
...
> +static inline int bitmap_find_free_region(unsigned long *bitmap, unsigned int bits, int order)
> +{
> + unsigned int pos, end; /* scans bitmap by regions of size order */
> +
> + for (pos = 0 ; (end = pos + BIT(order)) <= bits; pos = end)
Extra space.
> + if (!bitmap_allocate_region(bitmap, pos, order))
> + return pos;
> +
> + return -ENOMEM;
> +}
...
> +/**
> + * bitmap_release_region - release allocated bitmap region
> + * @bitmap: array of unsigned longs corresponding to the bitmap
> + * @pos: beginning of bit region to release
> + * @order: region size (log base 2 of number of bits) to release
> + *
> + * This is the complement to __bitmap_find_free_region() and releases
> + * the found region (by clearing it in the bitmap).
> + * No return value.
Useless line.
> + */
...
Seems like the original code has all these, perhaps update in a separate patch?
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2023-08-11 9:28 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-11 0:57 [PATCH v2 0/6] bitmap: cleanup bitmap_*_region() implementation Yury Norov
2023-08-11 0:57 ` [PATCH v2 1/6] bitmap: fix opencoded bitmap_allocate_region() Yury Norov
2023-08-11 0:57 ` [PATCH v2 2/6] bitmap: replace _reg_op(REG_OP_ALLOC) with bitmap_set() Yury Norov
2023-08-11 6:21 ` Rasmus Villemoes
2023-08-11 12:56 ` Yury Norov
2023-08-11 13:31 ` Rasmus Villemoes
2023-08-14 0:39 ` Yury Norov
2023-08-11 9:25 ` Andy Shevchenko
2023-08-11 13:01 ` Yury Norov
2023-08-11 0:57 ` [PATCH v2 3/6] bitmap: replace _reg_op(REG_OP_RELEASE) with bitmap_clear() Yury Norov
2023-08-11 0:57 ` [PATCH v2 4/6] bitmap: replace _reg_op(REG_OP_ISFREE) with find_next_bit() Yury Norov
2023-08-11 0:57 ` [PATCH v2 5/6] bitmap: drop _reg_op() function Yury Norov
2023-08-11 0:57 ` [PATCH v2 6/6] bitmap: move bitmap_*_region functions to bitmap.h Yury Norov
2023-08-11 9:27 ` Andy Shevchenko [this message]
2023-08-11 13:05 ` Yury Norov
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=ZNX/F45GKXSRDgG/@smile.fi.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@rasmusvillemoes.dk \
--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