linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>,
	Patrice VILCHEZ <patrice.vilchez@atmel.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] genalloc: add support to specify the physical address
Date: Wed, 13 Apr 2011 17:18:51 +0200	[thread overview]
Message-ID: <20110413151851.GF4709@game.jcrosoft.org> (raw)
In-Reply-To: <20110412153758.c570b09a.akpm@linux-foundation.org>

> 
> 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.

      reply	other threads:[~2011-04-13 15:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-07 16:03 [PATCH 1/2] genalloc: fix header multiple including support Jean-Christophe PLAGNIOL-VILLARD
2011-04-07 16:03 ` [PATCH 2/2] genalloc: add support to specify the physical address Jean-Christophe PLAGNIOL-VILLARD
2011-04-12 22:37   ` Andrew Morton
2011-04-13 15:18     ` Jean-Christophe PLAGNIOL-VILLARD [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110413151851.GF4709@game.jcrosoft.org \
    --to=plagnioj@jcrosoft.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nicolas.ferre@atmel.com \
    --cc=patrice.vilchez@atmel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).