From patchwork Mon Mar 20 14:39:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Cox X-Patchwork-Id: 9634367 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 22313601E9 for ; Mon, 20 Mar 2017 14:54:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 12FF227F60 for ; Mon, 20 Mar 2017 14:54:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 07ED328455; Mon, 20 Mar 2017 14:54:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7C4AB27F60 for ; Mon, 20 Mar 2017 14:54:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755242AbdCTOyn (ORCPT ); Mon, 20 Mar 2017 10:54:43 -0400 Received: from mga06.intel.com ([134.134.136.31]:9428 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755299AbdCTOyl (ORCPT ); Mon, 20 Mar 2017 10:54:41 -0400 Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga104.jf.intel.com with ESMTP; 20 Mar 2017 07:39:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,194,1486454400"; d="scan'208";a="836654670" Received: from acox1-desk1.ger.corp.intel.com ([10.252.22.109]) by FMSMGA003.fm.intel.com with ESMTP; 20 Mar 2017 07:39:40 -0700 Subject: [PATCH 06/24] atomisp: kill another define From: Alan Cox To: greg@kroah.com, linux-media@vger.kernel.org Date: Mon, 20 Mar 2017 14:39:38 +0000 Message-ID: <149002076867.17109.6183542354794542722.stgit@acox1-desk1.ger.corp.intel.com> In-Reply-To: <149002068431.17109.1216139691005241038.stgit@acox1-desk1.ger.corp.intel.com> References: <149002068431.17109.1216139691005241038.stgit@acox1-desk1.ger.corp.intel.com> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP We don't need an ifdef for the sake of 8-12 bytes. This undoes 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 --- .../staging/media/atomisp/pci/atomisp2/hmm/hmm.c | 23 +++++++++----------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm.c b/drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm.c index e78f02f..1f07c7a 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,14 +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 */ -#ifdef CONFIG_ION - "i", /* ion */ -#endif -}; +/* 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) @@ -77,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]++; @@ -92,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; }