linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] cma: use macro PFN_DOWN when converting size to pages
@ 2013-08-05  8:31 Xishi Qiu
  2013-08-05  8:54 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 3+ messages in thread
From: Xishi Qiu @ 2013-08-05  8:31 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Andrew Morton; +Cc: linux-mm, LKML

Use "PFN_DOWN(r->size)" instead of "r->size >> PAGE_SHIFT".

Signed-off-by: Xishi Qiu <qiuxishi@huawei.com>
---
 drivers/base/dma-contiguous.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/base/dma-contiguous.c b/drivers/base/dma-contiguous.c
index 0ca5442..1bcfaed 100644
--- a/drivers/base/dma-contiguous.c
+++ b/drivers/base/dma-contiguous.c
@@ -201,13 +201,12 @@ static int __init cma_init_reserved_areas(void)
 {
 	struct cma_reserved *r = cma_reserved;
 	unsigned i = cma_reserved_count;
+	struct cma *cma;
 
 	pr_debug("%s()\n", __func__);
 
 	for (; i; --i, ++r) {
-		struct cma *cma;
-		cma = cma_create_area(PFN_DOWN(r->start),
-				      r->size >> PAGE_SHIFT);
+		cma = cma_create_area(PFN_DOWN(r->start), PFN_DOWN(r->size));
 		if (!IS_ERR(cma))
 			dev_set_cma_area(r->dev, cma);
 	}
-- 
1.7.1


--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/2] cma: use macro PFN_DOWN when converting size to pages
  2013-08-05  8:31 [PATCH 1/2] cma: use macro PFN_DOWN when converting size to pages Xishi Qiu
@ 2013-08-05  8:54 ` Greg Kroah-Hartman
  2013-08-05  9:05   ` Xishi Qiu
  0 siblings, 1 reply; 3+ messages in thread
From: Greg Kroah-Hartman @ 2013-08-05  8:54 UTC (permalink / raw)
  To: Xishi Qiu; +Cc: Andrew Morton, linux-mm, LKML

On Mon, Aug 05, 2013 at 04:31:00PM +0800, Xishi Qiu wrote:
> Use "PFN_DOWN(r->size)" instead of "r->size >> PAGE_SHIFT".
> 
> Signed-off-by: Xishi Qiu <qiuxishi@huawei.com>
> ---
>  drivers/base/dma-contiguous.c |    5 ++---
>  1 files changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/base/dma-contiguous.c b/drivers/base/dma-contiguous.c
> index 0ca5442..1bcfaed 100644
> --- a/drivers/base/dma-contiguous.c
> +++ b/drivers/base/dma-contiguous.c
> @@ -201,13 +201,12 @@ static int __init cma_init_reserved_areas(void)
>  {
>  	struct cma_reserved *r = cma_reserved;
>  	unsigned i = cma_reserved_count;
> +	struct cma *cma;

Why change this?

>  
>  	pr_debug("%s()\n", __func__);
>  
>  	for (; i; --i, ++r) {
> -		struct cma *cma;
> -		cma = cma_create_area(PFN_DOWN(r->start),
> -				      r->size >> PAGE_SHIFT);
> +		cma = cma_create_area(PFN_DOWN(r->start), PFN_DOWN(r->size));

That's reasonable to clean up, but nothing major.  Care to resend this
without the cma change?

thanks,

greg k-h

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/2] cma: use macro PFN_DOWN when converting size to pages
  2013-08-05  8:54 ` Greg Kroah-Hartman
@ 2013-08-05  9:05   ` Xishi Qiu
  0 siblings, 0 replies; 3+ messages in thread
From: Xishi Qiu @ 2013-08-05  9:05 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: Andrew Morton, linux-mm, LKML

On 2013/8/5 16:54, Greg Kroah-Hartman wrote:

> On Mon, Aug 05, 2013 at 04:31:00PM +0800, Xishi Qiu wrote:
>> Use "PFN_DOWN(r->size)" instead of "r->size >> PAGE_SHIFT".
>>
>> Signed-off-by: Xishi Qiu <qiuxishi@huawei.com>
>> ---
>>  drivers/base/dma-contiguous.c |    5 ++---
>>  1 files changed, 2 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/base/dma-contiguous.c b/drivers/base/dma-contiguous.c
>> index 0ca5442..1bcfaed 100644
>> --- a/drivers/base/dma-contiguous.c
>> +++ b/drivers/base/dma-contiguous.c
>> @@ -201,13 +201,12 @@ static int __init cma_init_reserved_areas(void)
>>  {
>>  	struct cma_reserved *r = cma_reserved;
>>  	unsigned i = cma_reserved_count;
>> +	struct cma *cma;
> 
> Why change this?
> 
>>  
>>  	pr_debug("%s()\n", __func__);
>>  
>>  	for (; i; --i, ++r) {
>> -		struct cma *cma;
>> -		cma = cma_create_area(PFN_DOWN(r->start),
>> -				      r->size >> PAGE_SHIFT);
>> +		cma = cma_create_area(PFN_DOWN(r->start), PFN_DOWN(r->size));
> 
> That's reasonable to clean up, but nothing major.  Care to resend this
> without the cma change?
> 

Thank you and I will resend it soon.

Thanks,
Xishi Qiu

> thanks,
> 
> greg k-h
> 


--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-08-05  9:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-05  8:31 [PATCH 1/2] cma: use macro PFN_DOWN when converting size to pages Xishi Qiu
2013-08-05  8:54 ` Greg Kroah-Hartman
2013-08-05  9:05   ` Xishi Qiu

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