Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1727370
| From | Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] tpm_tis: make array cmd_getticks static const to shink object code size |
| Date | 2017-09-06 13:40 +0200 |
| Message-ID | <umGQx-182-7@gated-at.bofh.it> (permalink) |
| References | <uipXY-6qR-13@gated-at.bofh.it> |
| Organization | Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo |
On Fri, Aug 25, 2017 at 05:45:05PM +0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> 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
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
> drivers/char/tpm/tpm_tis_core.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/char/tpm/tpm_tis_core.c b/drivers/char/tpm/tpm_tis_core.c
> index 63bc6c3b949e..1e957e923d21 100644
> --- a/drivers/char/tpm/tpm_tis_core.c
> +++ b/drivers/char/tpm/tpm_tis_core.c
> @@ -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
> };
> --
> 2.14.1
>
Applied.
/Jarkko
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH] tpm_tis: make array cmd_getticks static const to shink object code size Colin King <colin.king@canonical.com> - 2017-08-25 18:50 +0200
Re: [PATCH] tpm_tis: make array cmd_getticks static const to shink object code size Jason Gunthorpe <jgunthorpe@obsidianresearch.com> - 2017-08-25 19:00 +0200
Re: [PATCH] tpm_tis: make array cmd_getticks static const to shink object code size Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> - 2017-08-25 19:40 +0200
Re: [PATCH] tpm_tis: make array cmd_getticks static const to shink object code size Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> - 2017-09-06 13:40 +0200
csiph-web