tpm_tis: make array cmd_getticks static const to shink object code size
PATCH 1/1 tpm_tis: make array cmd_getticks static const to shink object code size
From: Colin Ian King <[email protected]>
Don't populate array cmd_getticks on the stack, instead make it static const. Makes the object code smaller by over 160 bytes:
Before:
text data bss dec hex filename 18813 3152 128 22093 564d drivers/char/tpm/tpm_tis_core.o
After:
text data bss dec hex filename 18554 3248 128 21930 55aa drivers/char/tpm/tpm_tis_core.o
--- drivers/char/tpm/tpm_tis_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/char/tpm/tpm_tis_core.c +1 -1
@@ -445,7 +445,7 @@ static int probe_itpm(struct tpm_chip *chip) {struct tpm_tis_data *priv =dev_get_drvdata (&chip->dev);int rc =0 ; -u8 cmd_getticks[] = { +static const u8 cmd_getticks[] = {0x00 ,0xc1 ,0x00 ,0x00 ,0x00 ,0x0a ,0x00 ,0x00 ,0x00 ,0xf1 };
Signature · 1 line
2.14.1
Quoted 6 lines · Colin King
From: Colin Ian King <[email protected]>
Don't populate array
cmd_gettickson the stack, instead make it static const. Makes the object code smaller by over 160 bytes:Before:
Quoted 8 lines
text data bss dec hex filename 18813 3152 128 22093 564d drivers/char/tpm/tpm_tis_core.oAfter:
text data bss dec hex filename 18554 3248 128 21930 55aa drivers/char/tpm/tpm_tis_core.oSigned-off-by Colin Ian King <[email protected]>
Jason
Jarkko Sakkinen
Reviewed-byQuoted 14 lines · Jason Gunthorpe
Quoted 13 lines · Colin King
From: Colin Ian King <[email protected]>
Don't populate array
cmd_gettickson the stack, instead make it static const. Makes the object code smaller by over 160 bytes:Before:
text data bss dec hex filename 18813 3152 128 22093 564d drivers/char/tpm/tpm_tis_core.oAfter:
text data bss dec hex filename 18554 3248 128 21930 55aa drivers/char/tpm/tpm_tis_core.o
Quoted 5 lines
Quoted 1 line
Signed-off-by Colin Ian King <[email protected]>Reviewed-by Jason Gunthorpe <[email protected]>Jason
/Jarkko
Jarkko Sakkinen
AppliedQuoted 34 lines · Colin King
From: Colin Ian King <[email protected]>
Don't populate array
cmd_gettickson the stack, instead make it static const. Makes the object code smaller by over 160 bytes:Before:
text data bss dec hex filename 18813 3152 128 22093 564d drivers/char/tpm/tpm_tis_core.oAfter:
text data bss dec hex filename 18554 3248 128 21930 55aa drivers/char/tpm/tpm_tis_core.oSigned-off-by Colin Ian King <[email protected]>--- drivers/char/tpm/tpm_tis_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/char/tpm/tpm_tis_core.c +1
-1@@ -445,7 +445,7 @@ static int probe_itpm(struct tpm_chip *chip) {struct tpm_tis_data *priv =dev_get_drvdata (&chip->dev);int rc =0 ; -u8 cmd_getticks[] = { +static const u8 cmd_getticks[] = {0x00 ,0xc1 ,0x00 ,0x00 ,0x00 ,0x0a ,0x00 ,0x00 ,0x00 ,0xf1 };Signature · 1 line
2.14.1
Applied.
/Jarkko