Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mmc: dw_mmc: hi3798cv200: make array degrees static const, makes object smaller

Don't populate the array degrees on the stack but instead make it
static const. Makes the object code smaller by 46 bytes.

Before:
text data bss dec hex filename
5356 1560 0 6916 1b04 dw_mmc-hi3798cv200.o

After:
text data bss dec hex filename
5214 1656 0 6870 1ad6 dw_mmc-hi3798cv200.o

(gcc version 9.2.1, amd64)

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

authored by

Colin Ian King and committed by
Ulf Hansson
3fb2009a 0e62614b

+1 -1
+1 -1
drivers/mmc/host/dw_mmc-hi3798cv200.c
··· 66 66 static int dw_mci_hi3798cv200_execute_tuning(struct dw_mci_slot *slot, 67 67 u32 opcode) 68 68 { 69 - int degrees[] = { 0, 45, 90, 135, 180, 225, 270, 315 }; 69 + static const int degrees[] = { 0, 45, 90, 135, 180, 225, 270, 315 }; 70 70 struct dw_mci *host = slot->host; 71 71 struct hi3798cv200_priv *priv = host->priv; 72 72 int raise_point = -1, fall_point = -1;