Commit 9e40ff1f authored by Alan Cox's avatar Alan Cox Committed by Greg Kroah-Hartman

atomisp: kill another define

We don't need an ifdef for the sake of 8-12 bytes. Avoid the ifdef added by
fde46970. Instead turn it into a single const
string array at a fixed location thereby saving even more memory.
Signed-off-by: default avatarAlan Cox <alan@linux.intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 1600f7ae
/* /*
* Support for Medifield PNW Camera Imaging ISP subsystem. * Support for Medifield PNW Camera Imaging ISP subsystem.
* *
* Copyright (c) 2010 Intel Corporation. All Rights Reserved. * Copyright (c) 2010-2017 Intel Corporation. All Rights Reserved.
* *
* Copyright (c) 2010 Silicon Hive www.siliconhive.com. * Copyright (c) 2010 Silicon Hive www.siliconhive.com.
* *
...@@ -45,12 +45,11 @@ struct hmm_pool reserved_pool; ...@@ -45,12 +45,11 @@ struct hmm_pool reserved_pool;
static ia_css_ptr dummy_ptr; static ia_css_ptr dummy_ptr;
struct _hmm_mem_stat hmm_mem_stat; struct _hmm_mem_stat hmm_mem_stat;
const char *hmm_bo_type_strings[HMM_BO_LAST] = { /* p: private
"p", /* private */ s: shared
"s", /* shared */ u: user
"u", /* user */ i: ion */
"i", /* ion */ static const char hmm_bo_type_string[] = "psui";
};
static ssize_t bo_show(struct device *dev, struct device_attribute *attr, static ssize_t bo_show(struct device *dev, struct device_attribute *attr,
char *buf, struct list_head *bo_list, bool active) char *buf, struct list_head *bo_list, bool active)
...@@ -75,8 +74,8 @@ static ssize_t bo_show(struct device *dev, struct device_attribute *attr, ...@@ -75,8 +74,8 @@ static ssize_t bo_show(struct device *dev, struct device_attribute *attr,
if ((active && (bo->status & HMM_BO_ALLOCED)) || if ((active && (bo->status & HMM_BO_ALLOCED)) ||
(!active && !(bo->status & HMM_BO_ALLOCED))) { (!active && !(bo->status & HMM_BO_ALLOCED))) {
ret = scnprintf(buf + index1, PAGE_SIZE - index1, ret = scnprintf(buf + index1, PAGE_SIZE - index1,
"%s %d\n", "%c %d\n",
hmm_bo_type_strings[bo->type], bo->pgnr); hmm_bo_type_string[bo->type], bo->pgnr);
total[bo->type] += bo->pgnr; total[bo->type] += bo->pgnr;
count[bo->type]++; count[bo->type]++;
...@@ -90,8 +89,8 @@ static ssize_t bo_show(struct device *dev, struct device_attribute *attr, ...@@ -90,8 +89,8 @@ static ssize_t bo_show(struct device *dev, struct device_attribute *attr,
if (count[i]) { if (count[i]) {
ret = scnprintf(buf + index1 + index2, ret = scnprintf(buf + index1 + index2,
PAGE_SIZE - index1 - index2, PAGE_SIZE - index1 - index2,
"%ld %s buffer objects: %ld KB\n", "%ld %c buffer objects: %ld KB\n",
count[i], hmm_bo_type_strings[i], total[i] * 4); count[i], hmm_bo_type_string[i], total[i] * 4);
if (ret > 0) if (ret > 0)
index2 += ret; index2 += ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment