qe: Make cpm_muram_alloc_common static
authorSaurabh Sengar <saurabh.truth@gmail.com>
Tue, 26 Jan 2016 08:52:01 +0000 (14:22 +0530)
committerScott Wood <oss@buserror.net>
Wed, 9 Mar 2016 16:44:12 +0000 (10:44 -0600)
as cpm_muram_alloc_common is used only in this file,
making it static

Signed-off-by: Saurabh Sengar <saurabh.truth@gmail.com>
Signed-off-by: Scott Wood <oss@buserror.net>
drivers/soc/fsl/qe/qe_common.c
include/soc/fsl/qe/qe.h

index 419fa5b7be4d6c399a5429d5f8cf47362134d7f5..e18159acfe454566221aeaa377b84930c082f120 100644 (file)
@@ -102,6 +102,39 @@ out_muram:
        return ret;
 }
 
+/*
+ * cpm_muram_alloc_common - cpm_muram_alloc common code
+ * @size: number of bytes to allocate
+ * @algo: algorithm for alloc.
+ * @data: data for genalloc's algorithm.
+ *
+ * This function returns an offset into the muram area.
+ */
+static unsigned long cpm_muram_alloc_common(unsigned long size,
+               genpool_algo_t algo, void *data)
+{
+       struct muram_block *entry;
+       unsigned long start;
+
+       start = gen_pool_alloc_algo(muram_pool, size, algo, data);
+       if (!start)
+               goto out2;
+       start = start - GENPOOL_OFFSET;
+       memset_io(cpm_muram_addr(start), 0, size);
+       entry = kmalloc(sizeof(*entry), GFP_KERNEL);
+       if (!entry)
+               goto out1;
+       entry->start = start;
+       entry->size = size;
+       list_add(&entry->head, &muram_block_list);
+
+       return start;
+out1:
+       gen_pool_free(muram_pool, start, size);
+out2:
+       return (unsigned long)-ENOMEM;
+}
+
 /*
  * cpm_muram_alloc - allocate the requested size worth of multi-user ram
  * @size: number of bytes to allocate
@@ -175,39 +208,6 @@ unsigned long cpm_muram_alloc_fixed(unsigned long offset, unsigned long size)
 }
 EXPORT_SYMBOL(cpm_muram_alloc_fixed);
 
-/*
- * cpm_muram_alloc_common - cpm_muram_alloc common code
- * @size: number of bytes to allocate
- * @algo: algorithm for alloc.
- * @data: data for genalloc's algorithm.
- *
- * This function returns an offset into the muram area.
- */
-unsigned long cpm_muram_alloc_common(unsigned long size, genpool_algo_t algo,
-                                    void *data)
-{
-       struct muram_block *entry;
-       unsigned long start;
-
-       start = gen_pool_alloc_algo(muram_pool, size, algo, data);
-       if (!start)
-               goto out2;
-       start = start - GENPOOL_OFFSET;
-       memset_io(cpm_muram_addr(start), 0, size);
-       entry = kmalloc(sizeof(*entry), GFP_KERNEL);
-       if (!entry)
-               goto out1;
-       entry->start = start;
-       entry->size = size;
-       list_add(&entry->head, &muram_block_list);
-
-       return start;
-out1:
-       gen_pool_free(muram_pool, start, size);
-out2:
-       return (unsigned long)-ENOMEM;
-}
-
 /**
  * cpm_muram_addr - turn a muram offset into a virtual address
  * @offset: muram offset to convert
index c7fa36c335c9746446593f35f5051a974703ee35..33b29ead3d55acd48a4419ee8d7f0c618b6264b1 100644 (file)
@@ -103,8 +103,6 @@ int cpm_muram_init(void);
 unsigned long cpm_muram_alloc(unsigned long size, unsigned long align);
 int cpm_muram_free(unsigned long offset);
 unsigned long cpm_muram_alloc_fixed(unsigned long offset, unsigned long size);
-unsigned long cpm_muram_alloc_common(unsigned long size, genpool_algo_t algo,
-                                    void *data);
 void __iomem *cpm_muram_addr(unsigned long offset);
 unsigned long cpm_muram_offset(void __iomem *addr);
 dma_addr_t cpm_muram_dma(void __iomem *addr);