From patchwork Fri Sep 6 17:01:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin King X-Patchwork-Id: 11135739 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A4D751398 for ; Fri, 6 Sep 2019 17:01:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9042F20693 for ; Fri, 6 Sep 2019 17:01:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2395115AbfIFRBN (ORCPT ); Fri, 6 Sep 2019 13:01:13 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:53697 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727816AbfIFRBN (ORCPT ); Fri, 6 Sep 2019 13:01:13 -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 1i6Hbc-0002Xh-UF; Fri, 06 Sep 2019 17:01:05 +0000 From: Colin King To: Pedro Sousa , Alim Akhtar , Avri Altman , "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: make array setup_attrs static const, makes object smaller Date: Fri, 6 Sep 2019 18:01:04 +0100 Message-Id: <20190906170104.10450-1-colin.king@canonical.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org From: Colin Ian King Don't populate the array setup_attrs on the stack but instead make it static const. Makes the object code smaller by 180 bytes. Before: text data bss dec hex filename 2140 224 0 2364 93c drivers/scsi/ufs/ufshcd-dwc.o After: text data bss dec hex filename 1863 320 0 2183 887 drivers/scsi/ufs/ufshcd-dwc.o (gcc version 9.2.1, amd64) Signed-off-by: Colin Ian King --- drivers/scsi/ufs/ufshcd-dwc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/ufs/ufshcd-dwc.c b/drivers/scsi/ufs/ufshcd-dwc.c index fb9e2ff4f8d2..6a901da2d15a 100644 --- a/drivers/scsi/ufs/ufshcd-dwc.c +++ b/drivers/scsi/ufs/ufshcd-dwc.c @@ -80,7 +80,7 @@ static int ufshcd_dwc_link_is_up(struct ufs_hba *hba) */ static int ufshcd_dwc_connection_setup(struct ufs_hba *hba) { - const struct ufshcd_dme_attr_val setup_attrs[] = { + static const struct ufshcd_dme_attr_val setup_attrs[] = { { UIC_ARG_MIB(T_CONNECTIONSTATE), 0, DME_LOCAL }, { UIC_ARG_MIB(N_DEVICEID), 0, DME_LOCAL }, { UIC_ARG_MIB(N_DEVICEID_VALID), 0, DME_LOCAL },