Re: [PATCH v3 1/3] lib: bitmap: introduce bitmap_print_to_buf

From: Andy Shevchenko
Date: Thu Jun 03 2021 - 07:11:25 EST


On Thu, Jun 03, 2021 at 06:33:25PM +0800, tiantao (H) wrote:
> 在 2021/6/3 17:50, Andy Shevchenko 写道:
> > On Thu, Jun 03, 2021 at 05:22:40PM +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().

...

> > > + * @count: the maximum number of bytes to print

> > > + size = memory_read_from_buffer(buf, count, &off, data, strlen(data) + 1);
> > Are you sure you have put parameters in the correct order?
>
> yes, I already test it.
>
> ssize_t memory_read_from_buffer(void *to, size_t count, loff_t *ppos,
>                                 const void *from, size_t available)

Have you read the meaning of count and available?
Please, double check that they are filled with correct values.

> > I guess you have to provide the test case(s).

--
With Best Regards,
Andy Shevchenko