tpmdd-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
* [PATCH] tpm: tpm_tis: constify acpi_device_id.
@ 2017-07-06 17:52 Arvind Yadav
  0 siblings, 0 replies; only message in thread
From: Arvind Yadav @ 2017-07-06 17:52 UTC (permalink / raw)
  To: peterhuewe, tpmdd, jarkko.sakkinen, jgunthorpe; +Cc: tpmdd-devel, linux-kernel

acpi_device_id are not supposed to change at runtime. All functions
working with acpi_device_id provided by <acpi/acpi_bus.h> work with
const acpi_device_id. So mark the non-const structs as const.

File size before:
   text	   data	    bss	    dec	    hex	filename
   2758	   1089	     10	   3857	    f11	drivers/char/tpm/tpm_tis.o

File size After adding 'const':
   text	   data	    bss	    dec	    hex	filename
   2854	    993	     10	   3857	    f11	drivers/char/tpm/tpm_tis.o

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
 drivers/char/tpm/tpm_tis.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c
index c7e1384..a66e03e 100644
--- a/drivers/char/tpm/tpm_tis.c
+++ b/drivers/char/tpm/tpm_tis.c
@@ -297,7 +297,7 @@ static int tpm_tis_acpi_remove(struct acpi_device *dev)
 	return 0;
 }
 
-static struct acpi_device_id tpm_acpi_tbl[] = {
+static const struct acpi_device_id tpm_acpi_tbl[] = {
 	{"MSFT0101", 0},	/* TPM 2.0 */
 	/* Add new here */
 	{"", 0},		/* User Specified */
-- 
2.7.4

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-07-06 17:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-06 17:52 [PATCH] tpm: tpm_tis: constify acpi_device_id Arvind Yadav

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).