tpm: fix gcc printk warnings
PATCH 1/1 tpm: fix gcc printk warnings
(Kylene, please add TPM info to MAINTAINERS or CREDITS)
Fix gcc printk arg type warnings:
drivers/char/tpm/tpm.c:145: warning: unsigned int format, different type arg (arg 5) drivers/char/tpm/tpm.c:153: warning: int format, different type arg (arg 4) drivers/char/tpm/tpm.c:190: warning: int format, different type arg (arg 4)
diffstat:=
drivers/char/tpm/tpm.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
drivers/char/tpm/tpm.c renamed from drivers/char/tpm/tpm.c~tpm_printk +3 -3
@@ -143,7 +143,7 @@ static ssize_t tpm_transmit(struct tpm_creturn -ENODATA ;if (count > bufsiz) {dev_err (&chip->pci_dev->dev, -"invalid count value %x %x \n" , count, bufsiz); +"invalid count value %x %lx\n" , count, (unsigned long )bufsiz);return -E2BIG ; }
@@ -151,7 +151,7 @@ static ssize_t tpm_transmit(struct tpm_cif ((len = chip->vendor->send (chip, (u8 *) buf, count)) <0 ) {dev_err (&chip->pci_dev->dev, -"tpm_transmit: tpm_send: error %d\n" , len); +"tpm_transmit: tpm_send: error %Zd\n" , len);return len; }
@@ -188,7 +188,7 @@ out_recv: len = chip->vendor->recv (chip, (u8 *) buf, bufsiz);if (len <0 )dev_err (&chip->pci_dev->dev, -"tpm_transmit: tpm_recv: error %d\n" , len); +"tpm_transmit: tpm_recv: error %Zd\n" , len);up (&chip->tpm_mutex);return len; }
---
drivers/char/tpm/tpm.c static ssize_t tpm_transmit(struct tpm_c · line 146
Quoted 3 lines · Randy.Dunlap
drivers/char/tpm/tpm.c renamed from drivers/char/tpm/tpm.c~tpm_printk +1
-1- "invalid count value %x %x \n", count, bufsiz); + "invalid count value %x %lx\n", count, (unsigned long)bufsiz);
Nope. Please use %Z for size_t args.
Quoted 3 lines · Andrew Morton
"Randy.Dunlap" <[email protected]> wrote:
Nope. Please use %Z for
size_targs.
Yeps. Here it is.
Signature · 1 line
~Randy
Fix gcc printk arg type warnings:
drivers/char/tpm/tpm.c:145: warning: unsigned int format, different type arg (arg 5) drivers/char/tpm/tpm.c:153: warning: int format, different type arg (arg 4) drivers/char/tpm/tpm.c:190: warning: int format, different type arg (arg 4)
diffstat:=
drivers/char/tpm/tpm.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
drivers/char/tpm/tpm.c renamed from drivers/char/tpm/tpm.c~tpm_printk +3 -3
@@ -143,7 +143,7 @@ static ssize_t tpm_transmit(struct tpm_creturn -ENODATA ;if (count > bufsiz) {dev_err (&chip->pci_dev->dev, -"invalid count value %x %x \n" , count, bufsiz); +"invalid count value %x %Zx\n" , count, bufsiz);return -E2BIG ; }
@@ -151,7 +151,7 @@ static ssize_t tpm_transmit(struct tpm_cif ((len = chip->vendor->send (chip, (u8 *) buf, count)) <0 ) {dev_err (&chip->pci_dev->dev, -"tpm_transmit: tpm_send: error %d\n" , len); +"tpm_transmit: tpm_send: error %Zd\n" , len);return len; }
@@ -188,7 +188,7 @@ out_recv: len = chip->vendor->recv (chip, (u8 *) buf, bufsiz);if (len <0 )dev_err (&chip->pci_dev->dev, -"tpm_transmit: tpm_recv: error %d\n" , len); +"tpm_transmit: tpm_recv: error %Zd\n" , len);up (&chip->tpm_mutex);return len; }
The patch that was attached to this orginal message looks good to me and can be applied to the Tpm driver.
Thanks,
Kylie
Quoted 7 lines · Randy.Dunlap
Quoted 3 lines · Andrew Morton
"Randy.Dunlap" <[email protected]> wrote:
Nope. Please use %Z for
size_targs.Yeps. Here it is.
PATCH 1/1 Fix Tpm driver -- Maintainers entry
In reply to Randy.DunlapQuoted 1 line · Randy.Dunlap
(Kylene, please add TPM info to
MAINTAINERSor CREDITS)
This patch adds the maintainers entry.
---
MAINTAINERS +7 -0
@@ -2116,6 +2116,13 @@ M: [email protected] L: [email protected] S: Maintained +TPM DEVICE DRIVER +P: Kylene Hall +M: [email protected] +W: http://tpmdd.sourceforge.net +L: [email protected] +S: Maintained + UltraSPARC (sparc64): P: David S. Miller M: [email protected]