summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Cox <alan@linux.intel.com>2017-03-27 16:14:07 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-03-29 09:04:50 +0200
commit9e40ff1f781667a4f16c459742383002eebe6cea (patch)
tree96d98b119a83871ec6ee86ea7ba5c52f8616779e
parent1600f7ae880cd2b4a535c4fa085f7d17aab75dea (diff)
atomisp: kill another define
We don't need an ifdef for the sake of 8-12 bytes. Avoid the ifdef added by fde469701c7efabebf885e785edf367bfb1a8f3f. Instead turn it into a single const string array at a fixed location thereby saving even more memory. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm.c b/drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm.c
index a362b492ec8e..1f07c7a8c8ef 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm.c
@@ -1,7 +1,7 @@
/*
* 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.
*
@@ -45,12 +45,11 @@ struct hmm_pool reserved_pool;
static ia_css_ptr dummy_ptr;
struct _hmm_mem_stat hmm_mem_stat;
-const char *hmm_bo_type_strings[HMM_BO_LAST] = {
- "p", /* private */
- "s", /* shared */
- "u", /* user */
- "i", /* ion */
-};
+/* p: private
+ s: shared
+ u: user
+ i: ion */
+static const char hmm_bo_type_string[] = "psui";
static ssize_t bo_show(struct device *dev, struct device_attribute *attr,
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,
if ((active && (bo->status & HMM_BO_ALLOCED)) ||
(!active && !(bo->status & HMM_BO_ALLOCED))) {
ret = scnprintf(buf + index1, PAGE_SIZE - index1,
- "%s %d\n",
- hmm_bo_type_strings[bo->type], bo->pgnr);
+ "%c %d\n",
+ hmm_bo_type_string[bo->type], bo->pgnr);
total[bo->type] += bo->pgnr;
count[bo->type]++;
@@ -90,8 +89,8 @@ static ssize_t bo_show(struct device *dev, struct device_attribute *attr,
if (count[i]) {
ret = scnprintf(buf + index1 + index2,
PAGE_SIZE - index1 - index2,
- "%ld %s buffer objects: %ld KB\n",
- count[i], hmm_bo_type_strings[i], total[i] * 4);
+ "%ld %c buffer objects: %ld KB\n",
+ count[i], hmm_bo_type_string[i], total[i] * 4);
if (ret > 0)
index2 += ret;
}