Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Documentation: kernel-api: add bitmap operations from linux/bitmap.h

Add <linux/bitmap.h> to kernel-api Bitmap Operations section.
Fix kernel-doc nitpicks in <linux/bitmap.h>.

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Acked-by: Yury Norov <ynorov@caviumnetworks.com>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>

authored by

Randy Dunlap and committed by
Jonathan Corbet
404376af 416c7517

+8 -4
+3
Documentation/core-api/kernel-api.rst
··· 59 59 .. kernel-doc:: lib/bitmap.c 60 60 :internal: 61 61 62 + .. kernel-doc:: include/linux/bitmap.h 63 + :internal: 64 + 62 65 Command-line Parsing 63 66 -------------------- 64 67
+5 -4
include/linux/bitmap.h
··· 360 360 return __bitmap_parse(buf, buflen, 0, maskp, nmaskbits); 361 361 } 362 362 363 - /* 363 + /** 364 364 * BITMAP_FROM_U64() - Represent u64 value in the format suitable for bitmap. 365 + * @n: u64 value 365 366 * 366 367 * Linux bitmaps are internally arrays of unsigned longs, i.e. 32-bit 367 368 * integers in 32-bit environment, and 64-bit integers in 64-bit one. ··· 393 392 ((unsigned long) ((u64)(n) >> 32)) 394 393 #endif 395 394 396 - /* 395 + /** 397 396 * bitmap_from_u64 - Check and swap words within u64. 398 397 * @mask: source bitmap 399 398 * @dst: destination bitmap 400 399 * 401 - * In 32-bit Big Endian kernel, when using (u32 *)(&val)[*] 400 + * In 32-bit Big Endian kernel, when using ``(u32 *)(&val)[*]`` 402 401 * to read u64 mask, we will get the wrong word. 403 - * That is "(u32 *)(&val)[0]" gets the upper 32 bits, 402 + * That is ``(u32 *)(&val)[0]`` gets the upper 32 bits, 404 403 * but we expect the lower 32-bits of u64. 405 404 */ 406 405 static inline void bitmap_from_u64(unsigned long *dst, u64 mask)