Skip to content

Commit 82bf9bd

Browse files
committed
bitmap: align __reg_op() wrappers with modern coding style
Fix comments so that scripts/kernel-doc doesn't warn, and fix for-loop stype in bitmap_find_free_region(). CC: Rasmus Villemoes <linux@rasmusvillemoes.dk> Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Yury Norov <yury.norov@gmail.com>
1 parent aae06fc commit 82bf9bd

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

lib/bitmap.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -722,8 +722,8 @@ void bitmap_fold(unsigned long *dst, const unsigned long *orig,
722722
* some size '1 << order' (a power of two), aligned to that same
723723
* '1 << order' power of two.
724724
*
725-
* Returns 1 if REG_OP_ISFREE succeeds (region is all zero bits).
726-
* Returns 0 in all other cases and reg_ops.
725+
* Return: 1 if REG_OP_ISFREE succeeds (region is all zero bits).
726+
* 0 in all other cases and reg_ops.
727727
*/
728728

729729
enum {
@@ -795,14 +795,14 @@ static int __reg_op(unsigned long *bitmap, unsigned int pos, int order, int reg_
795795
* a power (@order) of two, aligned to that power of two, which
796796
* makes the search algorithm much faster.
797797
*
798-
* Return the bit offset in bitmap of the allocated region,
798+
* Return: the bit offset in bitmap of the allocated region,
799799
* or -errno on failure.
800800
*/
801801
int bitmap_find_free_region(unsigned long *bitmap, unsigned int bits, int order)
802802
{
803803
unsigned int pos, end; /* scans bitmap by regions of size order */
804804

805-
for (pos = 0 ; (end = pos + (1U << order)) <= bits; pos = end) {
805+
for (pos = 0; (end = pos + BIT(order)) <= bits; pos = end) {
806806
if (!__reg_op(bitmap, pos, order, REG_OP_ISFREE))
807807
continue;
808808
__reg_op(bitmap, pos, order, REG_OP_ALLOC);
@@ -820,8 +820,6 @@ EXPORT_SYMBOL(bitmap_find_free_region);
820820
*
821821
* This is the complement to __bitmap_find_free_region() and releases
822822
* the found region (by clearing it in the bitmap).
823-
*
824-
* No return value.
825823
*/
826824
void bitmap_release_region(unsigned long *bitmap, unsigned int pos, int order)
827825
{
@@ -837,7 +835,7 @@ EXPORT_SYMBOL(bitmap_release_region);
837835
*
838836
* Allocate (set bits in) a specified region of a bitmap.
839837
*
840-
* Return 0 on success, or %-EBUSY if specified region wasn't
838+
* Return: 0 on success, or %-EBUSY if specified region wasn't
841839
* free (not all bits were zero).
842840
*/
843841
int bitmap_allocate_region(unsigned long *bitmap, unsigned int pos, int order)

0 commit comments

Comments
 (0)