Skip to contentSkip to conversation

tpm: vtpm: constify vio_device_id

PATCH Applied Arvind Yadav 4 participants 6 messages Aug 17, 2017 – Aug 23, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tpm: vtpm: constify vio_device_id

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

---
 drivers/char/tpm/tpm_ibmvtpm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/char/tpm/tpm_ibmvtpm.c +1 -1
index f01d083..d2ce46b 100644
@@ -32,7 +32,7 @@
 
 static const char tpm_ibmvtpm_driver_name[] = "tpm_ibmvtpm";
 
-static struct vio_device_id tpm_ibmvtpm_device_table[] = {
+static const struct vio_device_id tpm_ibmvtpm_device_table[] = {
 	{ "IBM,vtpm", "IBM,vtpm"},
 	{ "", "" }
 };
Signature · 1 line
2.7.4
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Arvind Yadav

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

Quoted 15 lines
 drivers/char/tpm/tpm_ibmvtpm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/char/tpm/tpm_ibmvtpm.c +2 -1
index f01d083..d2ce46b 100644
+++ b/drivers/char/tpm/tpm_ibmvtpm.c
@@ -32,7 +32,7 @@
 
 static const char tpm_ibmvtpm_driver_name[] = "tpm_ibmvtpm";
 
-static struct vio_device_id tpm_ibmvtpm_device_table[] = {
+static const struct vio_device_id tpm_ibmvtpm_device_table[] = {
 	{ "IBM,vtpm", "IBM,vtpm"},
 	{ "", "" }
 };
#2 lore raw
Quoted 8 lines · Jason Gunthorpe
Quoted 5 lines · Arvind Yadav

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

Thanks Jason.

Quoted 1 line
Quoted 1 line
 drivers/char/tpm/tpm_ibmvtpm.c | 2 +-

Who merges changes for this driver? I assume it's Jarkko?

cheers

#3 lore raw
Quoted 3 lines · Michael Ellerman
Quoted 1 line
Quoted 1 line
 drivers/char/tpm/tpm_ibmvtpm.c | 2 +-

Who merges changes for this driver? I assume it's Jarkko?

Yes

Jason

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot

#4 lore raw
Quoted 9 lines · Jason Gunthorpe
Quoted 3 lines · Michael Ellerman
Quoted 1 line
Quoted 1 line
 drivers/char/tpm/tpm_ibmvtpm.c | 2 +-

Who merges changes for this driver? I assume it's Jarkko?

Yes

Jason

Applied.

/Jarkko

#5 lore raw
Quoted 5 lines · Jarkko Sakkinen
Quoted 4 lines · Jason Gunthorpe
Quoted 2 lines · Michael Ellerman
Quoted 1 line
Quoted 1 line
 drivers/char/tpm/tpm_ibmvtpm.c | 2 +-
Quoted 7 lines
Quoted 5 lines
Quoted 1 line

Who merges changes for this driver? I assume it's Jarkko?

Yes

Jason

Applied.

Thanks.

cheers

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot