public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] arm64: mm: use macro instead of if judgement of ZONE_DMA
@ 2014-10-16  9:19 Yifan Zhang
  2014-10-17 10:51 ` Uwe Kleine-König
  0 siblings, 1 reply; 3+ messages in thread
From: Yifan Zhang @ 2014-10-16  9:19 UTC (permalink / raw)
  To: linux-arm-kernel

if disable CONFIG_ZONE_DMA, ZONE_DMA becomes undefined.



Signed-off-by: Yifan Zhang <zhangyf@marvell.com>

---

 arch/arm64/mm/init.c |   12 +++++++-----

 1 file changed, 7 insertions(+), 5 deletions(-)



diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c index
494297c..887ca5d 100644

--- a/arch/arm64/mm/init.c

+++ b/arch/arm64/mm/init.c

@@ -82,10 +82,10 @@ static void __init zone_sizes_init(unsigned long
min, unsigned long max)

        memset(zone_size, 0, sizeof(zone_size));



        /* 4GB maximum for 32-bit only capable devices */

-        if (IS_ENABLED(CONFIG_ZONE_DMA)) {

-                 max_dma = PFN_DOWN(max_zone_dma_phys());

-                 zone_size[ZONE_DMA] = max_dma - min;

-        }

+#ifdef CONFIG_ZONE_DMA

+       max_dma = PFN_DOWN(max_zone_dma_phys());

+       zone_size[ZONE_DMA] = max_dma - min;

+#endif

        zone_size[ZONE_NORMAL] = max - max_dma;



       memcpy(zhole_size, zone_size, sizeof(zhole_size)); @@ -97,10
+97,12 @@ static void __init zone_sizes_init(unsigned long min,
unsigned long max)

                 if (start >= max)

                           continue;



-                 if (IS_ENABLED(CONFIG_ZONE_DMA) && start < max_dma) {

+#ifdef CONFIG_ZONE_DMA

+                if (start < max_dma) {

                           unsigned long dma_end = min(end, max_dma);

                           zhole_size[ZONE_DMA] -= dma_end - start;

                 }

+#endif



                 if (end > max_dma) {

                           unsigned long normal_end = min(end, max);

--

1.7.9.5

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

end of thread, other threads:[~2014-10-17 11:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-16  9:19 [PATCH] arm64: mm: use macro instead of if judgement of ZONE_DMA Yifan Zhang
2014-10-17 10:51 ` Uwe Kleine-König
2014-10-17 11:23   ` Yifan Zhang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox