From patchwork Mon Mar 27 15:14:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Cox X-Patchwork-Id: 40297 Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.84_2) (envelope-from ) id 1csWLz-0005b4-Fw; Mon, 27 Mar 2017 15:14:43 +0000 X-tubIT-Incoming-IP: 209.132.180.67 Received: from vger.kernel.org ([209.132.180.67]) by mail.tu-berlin.de (exim-4.84_2/mailfrontend-8) with esmtp id 1csWLx-0000v3-kF; Mon, 27 Mar 2017 17:14:43 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753178AbdC0POe (ORCPT + 1 other); Mon, 27 Mar 2017 11:14:34 -0400 Received: from mga02.intel.com ([134.134.136.20]:55482 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753470AbdC0PO3 (ORCPT ); Mon, 27 Mar 2017 11:14:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=intel; t=1490627669; x=1522163669; h=subject:from:to:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=o0u4sp291ScNnxSFS2hETNafSqrqAw7wuburi/S1FnE=; b=u3hG4Ra2hnmIzqCnfF12GTkDyvDJywR3XbYKxe0ZBU+Ioy2sJulI9XIv s4bXfOAV7gNTAM1K2jGltv2GZLogtA==; Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Mar 2017 08:14:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,232,1486454400"; d="scan'208";a="65548275" Received: from dclinto1-mobl2.ger.corp.intel.com (HELO rszulisx-mobl.ger.corp.intel.com) ([10.252.25.211]) by orsmga002.jf.intel.com with ESMTP; 27 Mar 2017 08:14:08 -0700 Subject: [PATCH 3/5] atomisp: kill another define From: Alan Cox To: greg@kroah.com, linux-media@vger.kernel.org Date: Mon, 27 Mar 2017 16:14:07 +0100 Message-ID: <149062764305.15399.13881626965784506879.stgit@rszulisx-mobl.ger.corp.intel.com> In-Reply-To: <149062762280.15399.12714375439154128065.stgit@rszulisx-mobl.ger.corp.intel.com> References: <149062762280.15399.12714375439154128065.stgit@rszulisx-mobl.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-PMX-Version: 6.0.0.2142326, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2017.3.27.150617 X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' HTML_00_01 0.05, HTML_00_10 0.05, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_2000_2999 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, DKIM_SIGNATURE 0, IN_REP_TO 0, LEGITIMATE_SIGNS 0, MSG_THREAD 0, NO_URI_HTTPS 0, REFERENCES 0, __ANY_URI 0, __CANPHARM_COPYRIGHT 0, __CT 0, __CTE 0, __CT_TEXT_PLAIN 0, __HAS_FROM 0, __HAS_LIST_ID 0, __HAS_MSGID 0, __HAS_X_MAILING_LIST 0, __IN_REP_TO 0, __MIME_TEXT_ONLY 0, __MIME_TEXT_P 0, __MIME_TEXT_P1 0, __MIME_VERSION 0, __NO_HTML_TAG_RAW 0, __REFERENCES 0, __SANE_MSGID 0, __SUBJ_ALPHA_END 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __URI_NS , __USER_AGENT 0' 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 --- .../staging/media/atomisp/pci/atomisp2/hmm/hmm.c | 21 ++++++++++---------- 1 file 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 a362b49..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,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; }