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 changed, 23 insertions(+)
diff --git a/include/linux/scatterlist.h b/include/linux/scatterlist.h
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 changed, 23 insertions(+)
diff --git a/include/linux/scatterlist.h b/include/linux/scatterlist.h
(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
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
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 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 :-(
>> +{
>> +
6 matches
Mail list logo