lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZNX/F45GKXSRDgG/@smile.fi.intel.com>
Date:   Fri, 11 Aug 2023 12:27:51 +0300
From:   Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To:     Yury Norov <yury.norov@...il.com>
Cc:     linux-kernel@...r.kernel.org,
        Rasmus Villemoes <linux@...musvillemoes.dk>
Subject: Re: [PATCH v2 6/6] bitmap: move bitmap_*_region functions to bitmap.h

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


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ