On Thu, Oct 11, 2012 at 12:27 PM, Geert Uytterhoeven
wrote:
> On Wed, Sep 26, 2012 at 11:49 AM, Maxim Levitsky
> wrote:
>> +int sg_nents(struct scatterlist *sg)
>
> unsigned int?
and "const struct scatterlist *sg"? Ah no, that won't work as
sg_next() treats non-const pointers :-(
>> +{
>> +
On Wed, Sep 26, 2012 at 11:49 AM, Maxim Levitsky
wrote:
> +int sg_nents(struct scatterlist *sg)
unsigned int?
> +{
> + int nents = 0;
> + while (sg) {
> + nents++;
> + sg = sg_next(sg);
> + }
> +
> + return nents;
> +}
Gr{oetje,eeting}s,
On 09/26/2012 06:38 PM, Tejun Heo wrote:
> (cc'ing Jens)
>
> On Wed, Sep 26, 2012 at 11:49:00AM +0200, Maxim Levitsky wrote:
>> Useful helper to know the number of entries in scatterlist.
>>
>> Signed-off-by: Maxim Levitsky
>> ---
>> include/linux/scatterlist.h |1 +
>> lib/scatterlist.c
(cc'ing Jens)
On Wed, Sep 26, 2012 at 11:49:00AM +0200, Maxim Levitsky wrote:
> Useful helper to know the number of entries in scatterlist.
>
> Signed-off-by: Maxim Levitsky
> ---
> include/linux/scatterlist.h |1 +
> lib/scatterlist.c | 22 ++
> 2 files chan
4 matches
Mail list logo