Messages in this thread | | | Date | Wed, 13 Apr 2011 17:18:51 +0200 | From | Jean-Christophe PLAGNIOL-VILLARD <> | Subject | Re: [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.
| |