Re: [PATCH v2 1/3] lib: bitmap: introduce bitmap_print_to_buf
From: Andy Shevchenko
Date: Wed Jun 02 2021 - 11:48:26 EST
On Wed, Jun 02, 2021 at 09:48:52PM +0800, Tian Tao wrote:
> New API bitmap_print_to_buf() with bin_attribute to avoid maskp
> exceeding PAGE_SIZE. bitmap_print_to_pagebuf() is a special case
> of bitmap_print_to_buf(), so in bitmap_print_to_pagebuf() call
> bitmap_print_to_buf().
...
> + * The role of cpumap_print_to_buf and cpumap_print_to_pagebuf is
* The role of cpumap_print_to_buf() and cpumap_print_to_pagebuf() is
...
> + * The role of bitmap_print_to_buf and bitmap_print_to_pagebuf() is
* The role of bitmap_print_to_buf() and bitmap_print_to_pagebuf() is
...
> + int size;
Strictly speaking it should be ssize_t.
> + void *data;
> + const char *fmt = list ? "%*pbl\n" : "%*pb\n";
Can you use reversed xmas tree order?
...
> + return bitmap_print_to_buf(list, buf, maskp, nmaskbits,
> + LLONG_MAX, len);
It fits one line.
--
With Best Regards,
Andy Shevchenko