Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1730827 > unrolled thread

[PATCH] scsi: ufs: tc-dwc-g210: make arrays static, reduces object code size

Started byColin King <colin.king@canonical.com>
First post2017-09-12 13:40 +0200
Last post2017-09-15 21:50 +0200
Articles 3 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] scsi: ufs: tc-dwc-g210: make arrays static, reduces object code size Colin King <colin.king@canonical.com> - 2017-09-12 13:40 +0200
    Re: [PATCH] scsi: ufs: tc-dwc-g210: make arrays static, reduces  object code size Bart Van Assche <Bart.VanAssche@wdc.com> - 2017-09-12 17:20 +0200
    Re: [PATCH] scsi: ufs: tc-dwc-g210: make arrays static, reduces object code size "Martin K. Petersen" <martin.petersen@oracle.com> - 2017-09-15 21:50 +0200

#1730827 — [PATCH] scsi: ufs: tc-dwc-g210: make arrays static, reduces object code size

FromColin King <colin.king@canonical.com>
Date2017-09-12 13:40 +0200
Subject[PATCH] scsi: ufs: tc-dwc-g210: make arrays static, reduces object code size
Message-ID<uoRHP-Fn-3@gated-at.bofh.it>
From: Colin Ian King <colin.king@canonical.com>

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 <colin.king@canonical.com>
---
 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 },
-- 
2.14.1

[toc] | [next] | [standalone]


#1730902 — Re: [PATCH] scsi: ufs: tc-dwc-g210: make arrays static, reduces object code size

FromBart Van Assche <Bart.VanAssche@wdc.com>
Date2017-09-12 17:20 +0200
SubjectRe: [PATCH] scsi: ufs: tc-dwc-g210: make arrays static, reduces object code size
Message-ID<uoV8L-2X1-17@gated-at.bofh.it>
In reply to#1730827
On Tue, 2017-09-12 at 12:32 +0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> 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 <colin.king@canonical.com>

Please CC the most active contributors of a driver when submitting a driver
patch. Anyway:

Reviewed-by: Bart Van Assche <bart.vanassche@wdc.com>

[toc] | [prev] | [next] | [standalone]


#1733060

From"Martin K. Petersen" <martin.petersen@oracle.com>
Date2017-09-15 21:50 +0200
Message-ID<uq4MG-7rc-17@gated-at.bofh.it>
In reply to#1730827
Colin,

> Don't populate const arrays on the stack, instead make them static.
> Makes the object code smaller by over 740 bytes.

Applied to 4.15/scsi-queue.

-- 
Martin K. Petersen	Oracle Linux Engineering

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web