]> git.baikalelectronics.ru Git - kernel.git/commitdiff
lib/genalloc.c: rename addr_in_gen_pool to gen_pool_has_addr
authorHuang Shijie <sjhuang@iluvatar.ai>
Thu, 5 Dec 2019 00:52:03 +0000 (16:52 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 5 Dec 2019 03:44:13 +0000 (19:44 -0800)
Follow the kernel conventions, rename addr_in_gen_pool to
gen_pool_has_addr.

[sjhuang@iluvatar.ai: fix Documentation/ too]
Link: http://lkml.kernel.org/r/20181229015914.5573-1-sjhuang@iluvatar.ai
Link: http://lkml.kernel.org/r/20181228083950.20398-1-sjhuang@iluvatar.ai
Signed-off-by: Huang Shijie <sjhuang@iluvatar.ai>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: Robin Murphy <robin.murphy@arm.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Documentation/core-api/genalloc.rst
arch/arm/mm/dma-mapping.c
drivers/misc/sram-exec.c
include/linux/genalloc.h
kernel/dma/remap.c
lib/genalloc.c

index 098a46f55798ffe53792eef90650a63dff35318a..a5af2cbf58a5877d26f7e997b2374c1712931cff 100644 (file)
@@ -129,7 +129,7 @@ writing of special-purpose memory allocators in the future.
    :functions: gen_pool_for_each_chunk
 
 .. kernel-doc:: lib/genalloc.c
-   :functions: addr_in_gen_pool
+   :functions: gen_pool_has_addr
 
 .. kernel-doc:: lib/genalloc.c
    :functions: gen_pool_avail
index 1df6eb42f22ea9b07cc6f6f180f6e48fcde02539..e822af0d9219b3afeb6a729a804af599d73732bc 100644 (file)
@@ -529,7 +529,7 @@ static void *__alloc_from_pool(size_t size, struct page **ret_page)
 
 static bool __in_atomic_pool(void *start, size_t size)
 {
-       return addr_in_gen_pool(atomic_pool, (unsigned long)start, size);
+       return gen_pool_has_addr(atomic_pool, (unsigned long)start, size);
 }
 
 static int __free_from_pool(void *start, size_t size)
index 426ad912b4416bd19692254fbd104e4c4c0703ed..d054e2842a5fa6f932528aa45e8205d2e5baa5c5 100644 (file)
@@ -96,7 +96,7 @@ void *sram_exec_copy(struct gen_pool *pool, void *dst, void *src,
        if (!part)
                return NULL;
 
-       if (!addr_in_gen_pool(pool, (unsigned long)dst, size))
+       if (!gen_pool_has_addr(pool, (unsigned long)dst, size))
                return NULL;
 
        base = (unsigned long)part->base;
index 4bd583bd6934ea87e0b178b07f69a5c480d1fa48..5b14a0f381241de51ac575d483847af8fb8b5b3b 100644 (file)
@@ -206,7 +206,7 @@ extern struct gen_pool *devm_gen_pool_create(struct device *dev,
                int min_alloc_order, int nid, const char *name);
 extern struct gen_pool *gen_pool_get(struct device *dev, const char *name);
 
-bool addr_in_gen_pool(struct gen_pool *pool, unsigned long start,
+extern bool gen_pool_has_addr(struct gen_pool *pool, unsigned long start,
                        size_t size);
 
 #ifdef CONFIG_OF
index d47bd40fc0f50b712d76c1a0f6cc446d4c5cabf9..d14cbc83986a3fa76e463d40c1972f9aa82bb2cd 100644 (file)
@@ -178,7 +178,7 @@ bool dma_in_atomic_pool(void *start, size_t size)
        if (unlikely(!atomic_pool))
                return false;
 
-       return addr_in_gen_pool(atomic_pool, (unsigned long)start, size);
+       return gen_pool_has_addr(atomic_pool, (unsigned long)start, size);
 }
 
 void *dma_alloc_from_pool(size_t size, struct page **ret_page, gfp_t flags)
index af9a5742218672f348c87a21d5811ba6065ed174..7f1244b5294a8a73b534e33aca40d993b7bcbfd0 100644 (file)
@@ -540,7 +540,7 @@ void gen_pool_for_each_chunk(struct gen_pool *pool,
 EXPORT_SYMBOL(gen_pool_for_each_chunk);
 
 /**
- * addr_in_gen_pool - checks if an address falls within the range of a pool
+ * gen_pool_has_addr - checks if an address falls within the range of a pool
  * @pool:      the generic memory pool
  * @start:     start address
  * @size:      size of the region
@@ -548,7 +548,7 @@ EXPORT_SYMBOL(gen_pool_for_each_chunk);
  * Check if the range of addresses falls within the specified pool. Returns
  * true if the entire range is contained in the pool and false otherwise.
  */
-bool addr_in_gen_pool(struct gen_pool *pool, unsigned long start,
+bool gen_pool_has_addr(struct gen_pool *pool, unsigned long start,
                        size_t size)
 {
        bool found = false;
@@ -567,7 +567,7 @@ bool addr_in_gen_pool(struct gen_pool *pool, unsigned long start,
        rcu_read_unlock();
        return found;
 }
-EXPORT_SYMBOL(addr_in_gen_pool);
+EXPORT_SYMBOL(gen_pool_has_addr);
 
 /**
  * gen_pool_avail - get available free space of the pool