diff mbox series

scsi: ufs: ufs-exynos: make a const array static, makes object smaller

Message ID 20210505190104.70112-1-colin.king@canonical.com
State New
Headers show
Series scsi: ufs: ufs-exynos: make a const array static, makes object smaller | expand

Commit Message

Colin King May 5, 2021, 7:01 p.m. UTC
From: Colin Ian King <colin.king@canonical.com>

Don't populate the const array granularity_tbl on the stack but instead it
static. Makes the object code smaller by 190 bytes:

Before:
   text    data     bss     dec     hex filename
  25563    6908       0   32471    7ed7 ./drivers/scsi/ufs/ufs-exynos.o

After:
   text    data     bss     dec     hex filename
  25213    7068       0   32281    7e19 ./drivers/scsi/ufs/ufs-exynos.o

(gcc version 10.3.0)

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/scsi/ufs/ufs-exynos.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Martin K. Petersen May 22, 2021, 2:50 a.m. UTC | #1
Colin,

> Don't populate the const array granularity_tbl on the stack but instead it

> static. Makes the object code smaller by 190 bytes:


Applied to 5.14/scsi-staging, thanks!

-- 
Martin K. Petersen	Oracle Linux Engineering
Martin K. Petersen May 26, 2021, 4:07 a.m. UTC | #2
On Wed, 5 May 2021 20:01:04 +0100, Colin King wrote:

> Don't populate the const array granularity_tbl on the stack but instead it

> static. Makes the object code smaller by 190 bytes:

> 

> Before:

>    text    data     bss     dec     hex filename

>   25563    6908       0   32471    7ed7 ./drivers/scsi/ufs/ufs-exynos.o

> 

> [...]


Applied to 5.14/scsi-queue, thanks!

[1/1] scsi: ufs: ufs-exynos: make a const array static, makes object smaller
      https://git.kernel.org/mkp/scsi/c/5ac3c649f11c

-- 
Martin K. Petersen	Oracle Linux Engineering
diff mbox series

Patch

diff --git a/drivers/scsi/ufs/ufs-exynos.c b/drivers/scsi/ufs/ufs-exynos.c
index 70647eacf195..f2f342d496c7 100644
--- a/drivers/scsi/ufs/ufs-exynos.c
+++ b/drivers/scsi/ufs/ufs-exynos.c
@@ -1048,7 +1048,7 @@  static void exynos_ufs_pre_hibern8(struct ufs_hba *hba, u8 enter)
 		exynos_ufs_ungate_clks(ufs);
 
 		if (ufs->opts & EXYNOS_UFS_OPT_USE_SW_HIBERN8_TIMER) {
-			const unsigned int granularity_tbl[] = {
+			static const unsigned int granularity_tbl[] = {
 				1, 4, 8, 16, 32, 100
 			};
 			int h8_time = attr->pa_hibern8time *