cma: use macro PFN_DOWN when converting size to pages
Subsystems (2)
PATCH 1/2 cma: use macro PFN_DOWN when converting size to pages
Use "PFN_DOWN(r->size)" instead of "r->size >> PAGE_SHIFT".
--- drivers/base/dma-contiguous.c | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-)
drivers/base/dma-contiguous.c +2 -3
@@ -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); }
Signature · 8 lines
1.7.1 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Greg Kroah-Hartman
maintainerQuoted 12 lines · Xishi Qiu
Use "
PFN_DOWN(r->size)" instead of "r->size>>PAGE_SHIFT".Signed-off-by Xishi Qiu <[email protected]>--- drivers/base/dma-contiguous.c | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-)drivers/base/dma-contiguous.c +0
-0
drivers/base/dma-contiguous.c static int __init cma_init_reserved_areas(void) · line 204
Quoted 4 lines
drivers/base/dma-contiguous.c +1
-0@@ -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?
drivers/base/dma-contiguous.c static int __init cma_init_reserved_areas(void) · line 209
Quoted 8 lines
drivers/base/dma-contiguous.c +1
-3pr_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 [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 23 lines · Greg Kroah-Hartman
Quoted 12 lines · Xishi Qiu
Use "
PFN_DOWN(r->size)" instead of "r->size>>PAGE_SHIFT".Signed-off-by Xishi Qiu <[email protected]>--- drivers/base/dma-contiguous.c | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-)drivers/base/dma-contiguous.c +0
-0drivers/base/dma-contiguous.c static int __init cma_init_reserved_areas(void) · line 204
Quoted 4 lines
drivers/base/dma-contiguous.c +1
-0@@ -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?
Quoted 3 lines
drivers/base/dma-contiguous.c +0
-0pr_debug ("%s()\n" , __func__);
Quoted 9 lines
drivers/base/dma-contiguous.c static int __init cma_init_reserved_areas(void) · line 209
Quoted 5 lines
drivers/base/dma-contiguous.c +1
-3for (; 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
Quoted 4 lines
thanks,
greg k-h