summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Nelson <sam.nelson@ti.com>2016-11-11 16:47:14 -0500
committerSam Nelson <sam.nelson@ti.com>2016-11-15 11:00:30 -0500
commitbd7de601af7b2c2aa6cfa319d398403043804406 (patch)
tree78e1f49fd620f30b52e0b09b9d92ff16ceaeee69
parentbd9c31cae31bd039deb496165b2749a1f66cd016 (diff)
downloadlinuxutils-bd7de601af7b2c2aa6cfa319d398403043804406.tar.gz
cmem: Fix duplication of block_struct
Cleanup: The block_struct was duplicated in both cmem.c and cmemk.c Removing it and add it in the common cmem.h file Signed-off-by: Sam Nelson <sam.nelson@ti.com>
-rw-r--r--include/ti/cmem.h5
-rw-r--r--src/cmem/api/cmem.c11
-rw-r--r--src/cmem/module/cmemk.c6
3 files changed, 9 insertions, 13 deletions
diff --git a/include/ti/cmem.h b/include/ti/cmem.h
index cdbaff8..e78aa23 100644
--- a/include/ti/cmem.h
+++ b/include/ti/cmem.h
@@ -382,6 +382,11 @@ typedef struct CMEM_AllocParams {
*/
} CMEM_AllocParams;
+struct CMEM_block_struct {
+ void *addr;
+ size_t size;
+};
+
extern CMEM_AllocParams CMEM_DEFAULTPARAMS;
typedef struct CMEM_BlockAttrs {
diff --git a/src/cmem/api/cmem.c b/src/cmem/api/cmem.c
index f57b9ae..614671d 100644
--- a/src/cmem/api/cmem.c
+++ b/src/cmem/api/cmem.c
@@ -58,11 +58,6 @@ CMEM_AllocParams CMEM_DEFAULTPARAMS = {
#define __E(fmt, args...) fprintf(stderr, "CMEM Error: " fmt, ## args)
-struct block_struct {
- void *addr;
- size_t size;
-};
-
/* set cmem_fd to -2 to distinguish from failed open (-1) */
static int cmem_fd = -2;
static int ref_count = 0;
@@ -858,7 +853,7 @@ int CMEM_cacheWbInvAll(void)
int CMEM_cacheWb(void *ptr, size_t size)
{
- struct block_struct block;
+ struct CMEM_block_struct block;
__D("cacheWb: entered w/ addr %p, size %#x\n", ptr, size);
@@ -881,7 +876,7 @@ int CMEM_cacheWb(void *ptr, size_t size)
int CMEM_cacheWbInv(void *ptr, size_t size)
{
- struct block_struct block;
+ struct CMEM_block_struct block;
__D("cacheWbInv: entered w/ addr %p, size %#x\n", ptr, size);
@@ -905,7 +900,7 @@ int CMEM_cacheWbInv(void *ptr, size_t size)
int CMEM_cacheInv(void *ptr, size_t size)
{
- struct block_struct block;
+ struct CMEM_block_struct block;
__D("cacheInv: entered w/ addr %p, size %#x\n", ptr, size);
diff --git a/src/cmem/module/cmemk.c b/src/cmem/module/cmemk.c
index 014944c..f269bb1 100644
--- a/src/cmem/module/cmemk.c
+++ b/src/cmem/module/cmemk.c
@@ -1099,10 +1099,6 @@ static int alloc_pool(int bi, int idx, int num, unsigned long long reqsize, phys
return 0;
}
-struct block_struct {
- void *addr;
- size_t size;
-};
static long ioctl(struct file *filp, unsigned int cmd, unsigned long args)
{
@@ -1131,7 +1127,7 @@ static long ioctl(struct file *filp, unsigned int cmd, unsigned long args)
int bi;
int id;
int pool_alloc;
- struct block_struct block;
+ struct CMEM_block_struct block;
union CMEM_AllocUnion allocDesc;
struct device *dev = NULL;