From patchwork Tue Sep 12 11:32:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin King X-Patchwork-Id: 9949031 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 E98D060360 for ; Tue, 12 Sep 2017 11:32:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DCC2D28F09 for ; Tue, 12 Sep 2017 11:32:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D12E128F34; Tue, 12 Sep 2017 11:32:48 +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=unavailable 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 8B83728F09 for ; Tue, 12 Sep 2017 11:32:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751419AbdILLcf (ORCPT ); Tue, 12 Sep 2017 07:32:35 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:40266 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751326AbdILLce (ORCPT ); Tue, 12 Sep 2017 07:32:34 -0400 Received: from 1.general.cking.uk.vpn ([10.172.193.212] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1drjQb-0006Vf-CU; Tue, 12 Sep 2017 11:32:29 +0000 From: Colin King To: Joao Pinto , Vinayak Holikatti , "James E . J . Bottomley" , "Martin K . Petersen" , linux-scsi@vger.kernel.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] scsi: ufs: tc-dwc-g210: make arrays static, reduces object code size Date: Tue, 12 Sep 2017 12:32:28 +0100 Message-Id: <20170912113228.1389-1-colin.king@canonical.com> X-Mailer: git-send-email 2.14.1 MIME-Version: 1.0 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Colin Ian King Don't populate const arrays on the stack, instead make them static. Makes the object code smaller by over 740 bytes. Before: text data bss dec hex filename 3840 208 0 4048 fd0 drivers/scsi/ufs/tc-dwc-g210.o After: text data bss dec hex filename 2679 624 0 3303 ce7 drivers/scsi/ufs/tc-dwc-g210.o Signed-off-by: Colin Ian King Reviewed-by: Bart Van Assche --- drivers/scsi/ufs/tc-dwc-g210.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/scsi/ufs/tc-dwc-g210.c b/drivers/scsi/ufs/tc-dwc-g210.c index dc03e47f7c58..3a8bc6d9cb5b 100644 --- a/drivers/scsi/ufs/tc-dwc-g210.c +++ b/drivers/scsi/ufs/tc-dwc-g210.c @@ -26,7 +26,7 @@ */ static int tc_dwc_g210_setup_40bit_rmmi(struct ufs_hba *hba) { - const struct ufshcd_dme_attr_val setup_attrs[] = { + static const struct ufshcd_dme_attr_val setup_attrs[] = { { UIC_ARG_MIB(TX_GLOBALHIBERNATE), 0x00, DME_LOCAL }, { UIC_ARG_MIB(REFCLKMODE), 0x01, DME_LOCAL }, { UIC_ARG_MIB(CDIRECTCTRL6), 0x80, DME_LOCAL }, @@ -90,7 +90,7 @@ static int tc_dwc_g210_setup_40bit_rmmi(struct ufs_hba *hba) */ static int tc_dwc_g210_setup_20bit_rmmi_lane0(struct ufs_hba *hba) { - const struct ufshcd_dme_attr_val setup_attrs[] = { + static const struct ufshcd_dme_attr_val setup_attrs[] = { { UIC_ARG_MIB_SEL(TX_REFCLKFREQ, SELIND_LN0_TX), 0x01, DME_LOCAL }, { UIC_ARG_MIB_SEL(TX_CFGCLKFREQVAL, SELIND_LN0_TX), 0x19, @@ -147,7 +147,7 @@ static int tc_dwc_g210_setup_20bit_rmmi_lane1(struct ufs_hba *hba) int connected_tx_lanes = 0; int ret = 0; - const struct ufshcd_dme_attr_val setup_tx_attrs[] = { + static const struct ufshcd_dme_attr_val setup_tx_attrs[] = { { UIC_ARG_MIB_SEL(TX_REFCLKFREQ, SELIND_LN1_TX), 0x0d, DME_LOCAL }, { UIC_ARG_MIB_SEL(TX_CFGCLKFREQVAL, SELIND_LN1_TX), 0x19, @@ -158,7 +158,7 @@ static int tc_dwc_g210_setup_20bit_rmmi_lane1(struct ufs_hba *hba) DME_LOCAL }, }; - const struct ufshcd_dme_attr_val setup_rx_attrs[] = { + static const struct ufshcd_dme_attr_val setup_rx_attrs[] = { { UIC_ARG_MIB_SEL(RX_REFCLKFREQ, SELIND_LN1_RX), 0x01, DME_LOCAL }, { UIC_ARG_MIB_SEL(RX_CFGCLKFREQVAL, SELIND_LN1_RX), 0x19, @@ -222,7 +222,7 @@ static int tc_dwc_g210_setup_20bit_rmmi(struct ufs_hba *hba) { int ret = 0; - const struct ufshcd_dme_attr_val setup_attrs[] = { + static const struct ufshcd_dme_attr_val setup_attrs[] = { { UIC_ARG_MIB(TX_GLOBALHIBERNATE), 0x00, DME_LOCAL }, { UIC_ARG_MIB(REFCLKMODE), 0x01, DME_LOCAL }, { UIC_ARG_MIB(CDIRECTCTRL6), 0xc0, DME_LOCAL },