lkml.org 
[lkml]   [2011]   [Apr]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/2] genalloc: add support to specify the physical address
> 
> But this documentation is incorrect. @addr is not "the starting
> address of memory".
>
> > +unsigned long gen_pool_virt_to_phys(struct gen_pool *pool, unsigned long addr)
> > +{
> > + struct list_head *_chunk;
> > + struct gen_pool_chunk *chunk;
> > +
> > + read_lock(&pool->lock);
> > + list_for_each(_chunk, &pool->chunks) {
> > + chunk = list_entry(_chunk, struct gen_pool_chunk, next_chunk);
> > +
> > + if (addr >= chunk->start_addr && addr < chunk->end_addr)
> > + return chunk->phys_addr + addr - chunk->start_addr;
>
> It is in fact "some address within one of the chunks".
yes
do you want a v2 or you fix it in your patch?
>
>
> > + }
> > + read_unlock(&pool->lock);
> > +
> > + return ~0UL;
> > +}
> > +EXPORT_SYMBOL(gen_pool_virt_to_phys);
>
> Was that intentional? If so, what is the reasoning?
yes as 0 can be a valid physical address
and the export as the drivers can be compiled as module
>
>
> Please review...
>
> Subject: lib/genpool.c: document return values, fix gen_pool_add_virt() return value
> From: Andrew Morton <akpm@linux-foundation.org>
>
> Cc: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> Cc: Jes Sorensen <jes@wildopensource.com>
> Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
> Cc: Patrice VILCHEZ <patrice.vilchez@atmel.com>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> ---
>
> include/linux/genalloc.h | 2 ++
> lib/genalloc.c | 6 +++++-
> 2 files changed, 7 insertions(+), 1 deletion(-)
>
Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

Best Regards,
J.


\
 
 \ /
  Last update: 2011-04-13 17:31    [W:0.058 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site