diff mbox

ARM: dma-mapping: Mark atomic_pool as __ro_after_init

Message ID 1502700619-44809-2-git-send-email-vladimir.murzin@arm.com (mailing list archive)
State New, archived
Headers show

Commit Message

Vladimir Murzin Aug. 14, 2017, 8:50 a.m. UTC
atomic_pool is setup once while init stage and never changed after
that, so it is good candidate for __ro_after_init.

Since we are here mark atomic_pool_size with __init_data.

Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
---
 arch/arm/mm/dma-mapping.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Vladimir Murzin Sept. 4, 2017, 8:20 a.m. UTC | #1
On 14/08/17 09:50, Vladimir Murzin wrote:
> atomic_pool is setup once while init stage and never changed after
> that, so it is good candidate for __ro_after_init.
> 
> Since we are here mark atomic_pool_size with __init_data.
> 
> Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
> ---
>  arch/arm/mm/dma-mapping.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
> index 25a8bce..ada8eb2 100644
> --- a/arch/arm/mm/dma-mapping.c
> +++ b/arch/arm/mm/dma-mapping.c
> @@ -382,9 +382,9 @@ static void __dma_free_remap(void *cpu_addr, size_t size)
>  }
>  
>  #define DEFAULT_DMA_COHERENT_POOL_SIZE	SZ_256K
> -static struct gen_pool *atomic_pool;
> +static struct gen_pool *atomic_pool __ro_after_init;
>  
> -static size_t atomic_pool_size = DEFAULT_DMA_COHERENT_POOL_SIZE;
> +static size_t atomic_pool_size __initdata = DEFAULT_DMA_COHERENT_POOL_SIZE;
>  
>  static int __init early_coherent_pool(char *p)
>  {
> 

Ok for patch tracker?

Vladimir
diff mbox

Patch

diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
index 25a8bce..ada8eb2 100644
--- a/arch/arm/mm/dma-mapping.c
+++ b/arch/arm/mm/dma-mapping.c
@@ -382,9 +382,9 @@  static void __dma_free_remap(void *cpu_addr, size_t size)
 }
 
 #define DEFAULT_DMA_COHERENT_POOL_SIZE	SZ_256K
-static struct gen_pool *atomic_pool;
+static struct gen_pool *atomic_pool __ro_after_init;
 
-static size_t atomic_pool_size = DEFAULT_DMA_COHERENT_POOL_SIZE;
+static size_t atomic_pool_size __initdata = DEFAULT_DMA_COHERENT_POOL_SIZE;
 
 static int __init early_coherent_pool(char *p)
 {