linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] Use tpm_transmit_cmd() consistently
@ 2016-06-17 21:10 Jarkko Sakkinen
  2016-06-17 21:10 ` [PATCH 1/5] tpm: unify tpm_gen_interrupt() Jarkko Sakkinen
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Jarkko Sakkinen @ 2016-06-17 21:10 UTC (permalink / raw)
  To: Peter Huewe, Jason Gunthorpe
  Cc: linux-security-module, Stefan Berger, Jarkko Sakkinen, open list,
	moderated list:TPM DEVICE DRIVER

This patch set updates the subsystem consistently use tpm_transmit_cmd()
throughout the subsystem the exception being tpm_write() where it makes
sense to use the raw interface because higher level command handling is
delegated to user space.

Jarkko Sakkinen (5):
  tpm: unify tpm_gen_interrupt()
  tpm: return error code from tpm_gen_interrupt()
  tpm: use tpm_transmit_cmd() in tpm2_probe()
  tpm: rename tpm_pcr_read_dev() to tpm1_pcr_read()
  tpm: use tpm1_pcr_read() in tpm_do_selftest()

 drivers/char/tpm/tpm-interface.c | 36 +++++++++++++++++++-----------------
 drivers/char/tpm/tpm-sysfs.c     |  2 +-
 drivers/char/tpm/tpm.h           |  5 ++---
 drivers/char/tpm/tpm2-cmd.c      | 21 +--------------------
 drivers/char/tpm/tpm_tis_core.c  |  7 +++----
 5 files changed, 26 insertions(+), 45 deletions(-)

-- 
2.7.4

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/5] tpm: unify tpm_gen_interrupt()
  2016-06-17 21:10 [PATCH 0/5] Use tpm_transmit_cmd() consistently Jarkko Sakkinen
@ 2016-06-17 21:10 ` Jarkko Sakkinen
  2016-06-24 19:30   ` Jason Gunthorpe
  2016-06-17 21:10 ` [PATCH 2/5] tpm: return error code from tpm_gen_interrupt() Jarkko Sakkinen
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 8+ messages in thread
From: Jarkko Sakkinen @ 2016-06-17 21:10 UTC (permalink / raw)
  To: Peter Huewe, Jason Gunthorpe
  Cc: linux-security-module, Stefan Berger, Jarkko Sakkinen,
	Marcel Selhorst, moderated list:TPM DEVICE DRIVER, open list

Migrated into single tpm_gen_interrupt() function and cleaned up the
whole construction in general because it was starting to turn into a
train wreck.

Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
---
 drivers/char/tpm/tpm-interface.c | 23 ++++++++++++++---------
 drivers/char/tpm/tpm.h           |  3 +--
 drivers/char/tpm/tpm2-cmd.c      | 17 -----------------
 drivers/char/tpm/tpm_tis_core.c  |  5 +----
 4 files changed, 16 insertions(+), 32 deletions(-)

diff --git a/drivers/char/tpm/tpm-interface.c b/drivers/char/tpm/tpm-interface.c
index 5e3c1b6..e953618 100644
--- a/drivers/char/tpm/tpm-interface.c
+++ b/drivers/char/tpm/tpm-interface.c
@@ -459,18 +459,23 @@ ssize_t tpm_getcap(struct tpm_chip *chip, __be32 subcap_id, cap_t *cap,
 	return rc;
 }
 
+/**
+ * tpm_gen_interrupt -- generate an interrupt by issuing an idempotent command
+ * @chip: TPM chip to use
+ *
+ * Returns 0 on success, < 0 in case of fatal error or a value > 0 representing
+ * a TPM error code.
+ */
 void tpm_gen_interrupt(struct tpm_chip *chip)
 {
-	struct	tpm_cmd_t tpm_cmd;
-	ssize_t rc;
+	const char *desc = "attempting to generate an interrupt";
+	u32 cap2;
+	cap_t cap;
 
-	tpm_cmd.header.in = tpm_getcap_header;
-	tpm_cmd.params.getcap_in.cap = TPM_CAP_PROP;
-	tpm_cmd.params.getcap_in.subcap_size = cpu_to_be32(4);
-	tpm_cmd.params.getcap_in.subcap = TPM_CAP_PROP_TIS_TIMEOUT;
-
-	rc = tpm_transmit_cmd(chip, &tpm_cmd, TPM_INTERNAL_RESULT_SIZE,
-			      "attempting to determine the timeouts");
+	if (chip->flags & TPM_CHIP_FLAG_TPM2)
+		tpm2_get_tpm_pt(chip, 0x100, &cap2, desc);
+	else
+		tpm_getcap(chip, TPM_CAP_PROP_TIS_TIMEOUT, &cap, desc);
 }
 EXPORT_SYMBOL_GPL(tpm_gen_interrupt);
 
diff --git a/drivers/char/tpm/tpm.h b/drivers/char/tpm/tpm.h
index 8890df2..276a3c5 100644
--- a/drivers/char/tpm/tpm.h
+++ b/drivers/char/tpm/tpm.h
@@ -483,7 +483,7 @@ ssize_t tpm_transmit(struct tpm_chip *chip, const char *buf,
 ssize_t tpm_transmit_cmd(struct tpm_chip *chip, void *cmd, int len,
 			 const char *desc);
 extern int tpm_get_timeouts(struct tpm_chip *);
-extern void tpm_gen_interrupt(struct tpm_chip *);
+void tpm_gen_interrupt(struct tpm_chip *);
 extern int tpm_do_selftest(struct tpm_chip *);
 extern unsigned long tpm_calc_ordinal_duration(struct tpm_chip *, u32);
 extern int tpm_pm_suspend(struct device *);
@@ -530,6 +530,5 @@ extern int tpm2_startup(struct tpm_chip *chip, u16 startup_type);
 extern void tpm2_shutdown(struct tpm_chip *chip, u16 shutdown_type);
 extern unsigned long tpm2_calc_ordinal_duration(struct tpm_chip *, u32);
 extern int tpm2_do_selftest(struct tpm_chip *chip);
-extern int tpm2_gen_interrupt(struct tpm_chip *chip);
 extern int tpm2_probe(struct tpm_chip *chip);
 #endif
diff --git a/drivers/char/tpm/tpm2-cmd.c b/drivers/char/tpm/tpm2-cmd.c
index a1673dc..77ef027 100644
--- a/drivers/char/tpm/tpm2-cmd.c
+++ b/drivers/char/tpm/tpm2-cmd.c
@@ -897,23 +897,6 @@ int tpm2_do_selftest(struct tpm_chip *chip)
 EXPORT_SYMBOL_GPL(tpm2_do_selftest);
 
 /**
- * tpm2_gen_interrupt() - generate an interrupt
- * @chip: TPM chip to use
- *
- * 0 is returned when the operation is successful. If a negative number is
- * returned it remarks a POSIX error code. If a positive number is returned
- * it remarks a TPM error.
- */
-int tpm2_gen_interrupt(struct tpm_chip *chip)
-{
-	u32 dummy;
-
-	return tpm2_get_tpm_pt(chip, 0x100, &dummy,
-			       "attempting to generate an interrupt");
-}
-EXPORT_SYMBOL_GPL(tpm2_gen_interrupt);
-
-/**
  * tpm2_probe() - probe TPM 2.0
  * @chip: TPM chip to use
  *
diff --git a/drivers/char/tpm/tpm_tis_core.c b/drivers/char/tpm/tpm_tis_core.c
index 03a06b3..c7dc58d 100644
--- a/drivers/char/tpm/tpm_tis_core.c
+++ b/drivers/char/tpm/tpm_tis_core.c
@@ -580,10 +580,7 @@ static int tpm_tis_probe_irq_single(struct tpm_chip *chip, u32 intmask,
 	/* Generate an interrupt by having the core call through to
 	 * tpm_tis_send
 	 */
-	if (chip->flags & TPM_CHIP_FLAG_TPM2)
-		tpm2_gen_interrupt(chip);
-	else
-		tpm_gen_interrupt(chip);
+	tpm_gen_interrupt(chip);
 
 	/* tpm_tis_send will either confirm the interrupt is working or it
 	 * will call disable_irq which undoes all of the above.
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/5] tpm: return error code from tpm_gen_interrupt()
  2016-06-17 21:10 [PATCH 0/5] Use tpm_transmit_cmd() consistently Jarkko Sakkinen
  2016-06-17 21:10 ` [PATCH 1/5] tpm: unify tpm_gen_interrupt() Jarkko Sakkinen
@ 2016-06-17 21:10 ` Jarkko Sakkinen
  2016-06-17 21:10 ` [PATCH 3/5] tpm: use tpm_transmit_cmd() in tpm2_probe() Jarkko Sakkinen
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Jarkko Sakkinen @ 2016-06-17 21:10 UTC (permalink / raw)
  To: Peter Huewe, Jason Gunthorpe
  Cc: linux-security-module, Stefan Berger, Jarkko Sakkinen,
	Marcel Selhorst, moderated list:TPM DEVICE DRIVER, open list

Return error code from tpm_gen_interrupt() and fail tpm_tis family of
drivers on a system error. It doesn't make sense to continue if we
cannot even reach the TPM.

Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
---
 drivers/char/tpm/tpm-interface.c | 6 +++---
 drivers/char/tpm/tpm.h           | 2 +-
 drivers/char/tpm/tpm_tis_core.c  | 4 +++-
 3 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/char/tpm/tpm-interface.c b/drivers/char/tpm/tpm-interface.c
index e953618..4aeacf3 100644
--- a/drivers/char/tpm/tpm-interface.c
+++ b/drivers/char/tpm/tpm-interface.c
@@ -466,16 +466,16 @@ ssize_t tpm_getcap(struct tpm_chip *chip, __be32 subcap_id, cap_t *cap,
  * Returns 0 on success, < 0 in case of fatal error or a value > 0 representing
  * a TPM error code.
  */
-void tpm_gen_interrupt(struct tpm_chip *chip)
+int tpm_gen_interrupt(struct tpm_chip *chip)
 {
 	const char *desc = "attempting to generate an interrupt";
 	u32 cap2;
 	cap_t cap;
 
 	if (chip->flags & TPM_CHIP_FLAG_TPM2)
-		tpm2_get_tpm_pt(chip, 0x100, &cap2, desc);
+		return tpm2_get_tpm_pt(chip, 0x100, &cap2, desc);
 	else
-		tpm_getcap(chip, TPM_CAP_PROP_TIS_TIMEOUT, &cap, desc);
+		return tpm_getcap(chip, TPM_CAP_PROP_TIS_TIMEOUT, &cap, desc);
 }
 EXPORT_SYMBOL_GPL(tpm_gen_interrupt);
 
diff --git a/drivers/char/tpm/tpm.h b/drivers/char/tpm/tpm.h
index 276a3c5..de93535 100644
--- a/drivers/char/tpm/tpm.h
+++ b/drivers/char/tpm/tpm.h
@@ -483,7 +483,7 @@ ssize_t tpm_transmit(struct tpm_chip *chip, const char *buf,
 ssize_t tpm_transmit_cmd(struct tpm_chip *chip, void *cmd, int len,
 			 const char *desc);
 extern int tpm_get_timeouts(struct tpm_chip *);
-void tpm_gen_interrupt(struct tpm_chip *);
+int tpm_gen_interrupt(struct tpm_chip *);
 extern int tpm_do_selftest(struct tpm_chip *);
 extern unsigned long tpm_calc_ordinal_duration(struct tpm_chip *, u32);
 extern int tpm_pm_suspend(struct device *);
diff --git a/drivers/char/tpm/tpm_tis_core.c b/drivers/char/tpm/tpm_tis_core.c
index c7dc58d..79168ca 100644
--- a/drivers/char/tpm/tpm_tis_core.c
+++ b/drivers/char/tpm/tpm_tis_core.c
@@ -580,7 +580,9 @@ static int tpm_tis_probe_irq_single(struct tpm_chip *chip, u32 intmask,
 	/* Generate an interrupt by having the core call through to
 	 * tpm_tis_send
 	 */
-	tpm_gen_interrupt(chip);
+	rc = tpm_gen_interrupt(chip);
+	if (rc < 0)
+		return rc;
 
 	/* tpm_tis_send will either confirm the interrupt is working or it
 	 * will call disable_irq which undoes all of the above.
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 3/5] tpm: use tpm_transmit_cmd() in tpm2_probe()
  2016-06-17 21:10 [PATCH 0/5] Use tpm_transmit_cmd() consistently Jarkko Sakkinen
  2016-06-17 21:10 ` [PATCH 1/5] tpm: unify tpm_gen_interrupt() Jarkko Sakkinen
  2016-06-17 21:10 ` [PATCH 2/5] tpm: return error code from tpm_gen_interrupt() Jarkko Sakkinen
@ 2016-06-17 21:10 ` Jarkko Sakkinen
  2016-06-17 21:10 ` [PATCH 4/5] tpm: rename tpm_pcr_read_dev() to tpm1_pcr_read() Jarkko Sakkinen
  2016-06-17 21:10 ` [PATCH 5/5] tpm: use tpm1_pcr_read() in tpm_do_selftest() Jarkko Sakkinen
  4 siblings, 0 replies; 8+ messages in thread
From: Jarkko Sakkinen @ 2016-06-17 21:10 UTC (permalink / raw)
  To: Peter Huewe, Jason Gunthorpe
  Cc: linux-security-module, Stefan Berger, Jarkko Sakkinen,
	Marcel Selhorst, moderated list:TPM DEVICE DRIVER, open list

It is better to tpm_transmit_cmd() in tpm2_probe() in order to get
consistent command handling throughout the subsystem.

Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
---
 drivers/char/tpm/tpm2-cmd.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/char/tpm/tpm2-cmd.c b/drivers/char/tpm/tpm2-cmd.c
index 77ef027..a43e51a 100644
--- a/drivers/char/tpm/tpm2-cmd.c
+++ b/drivers/char/tpm/tpm2-cmd.c
@@ -913,11 +913,9 @@ int tpm2_probe(struct tpm_chip *chip)
 	cmd.params.get_tpm_pt_in.property_id = cpu_to_be32(0x100);
 	cmd.params.get_tpm_pt_in.property_cnt = cpu_to_be32(1);
 
-	rc = tpm_transmit(chip, (const char *) &cmd, sizeof(cmd));
+	rc = tpm_transmit_cmd(chip, &cmd, sizeof(cmd), NULL);
 	if (rc <  0)
 		return rc;
-	else if (rc < TPM_HEADER_SIZE)
-		return -EFAULT;
 
 	if (be16_to_cpu(cmd.header.out.tag) == TPM2_ST_NO_SESSIONS)
 		chip->flags |= TPM_CHIP_FLAG_TPM2;
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 4/5] tpm: rename tpm_pcr_read_dev() to tpm1_pcr_read()
  2016-06-17 21:10 [PATCH 0/5] Use tpm_transmit_cmd() consistently Jarkko Sakkinen
                   ` (2 preceding siblings ...)
  2016-06-17 21:10 ` [PATCH 3/5] tpm: use tpm_transmit_cmd() in tpm2_probe() Jarkko Sakkinen
@ 2016-06-17 21:10 ` Jarkko Sakkinen
  2016-06-17 21:10 ` [PATCH 5/5] tpm: use tpm1_pcr_read() in tpm_do_selftest() Jarkko Sakkinen
  4 siblings, 0 replies; 8+ messages in thread
From: Jarkko Sakkinen @ 2016-06-17 21:10 UTC (permalink / raw)
  To: Peter Huewe, Jason Gunthorpe
  Cc: linux-security-module, Stefan Berger, Jarkko Sakkinen,
	Marcel Selhorst, moderated list:TPM DEVICE DRIVER, open list

Gave more consistent name tpm1_pcr_read() as the TPM2 version is called
tpm2_pcr_read().

Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
---
 drivers/char/tpm/tpm-interface.c | 4 ++--
 drivers/char/tpm/tpm-sysfs.c     | 2 +-
 drivers/char/tpm/tpm.h           | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/char/tpm/tpm-interface.c b/drivers/char/tpm/tpm-interface.c
index 4aeacf3..3995f5c 100644
--- a/drivers/char/tpm/tpm-interface.c
+++ b/drivers/char/tpm/tpm-interface.c
@@ -670,7 +670,7 @@ static struct tpm_input_header pcrread_header = {
 	.ordinal = TPM_ORDINAL_PCRREAD
 };
 
-int tpm_pcr_read_dev(struct tpm_chip *chip, int pcr_idx, u8 *res_buf)
+int tpm1_pcr_read(struct tpm_chip *chip, int pcr_idx, u8 *res_buf)
 {
 	int rc;
 	struct tpm_cmd_t cmd;
@@ -732,7 +732,7 @@ int tpm_pcr_read(u32 chip_num, int pcr_idx, u8 *res_buf)
 	if (chip->flags & TPM_CHIP_FLAG_TPM2)
 		rc = tpm2_pcr_read(chip, pcr_idx, res_buf);
 	else
-		rc = tpm_pcr_read_dev(chip, pcr_idx, res_buf);
+		rc = tpm1_pcr_read(chip, pcr_idx, res_buf);
 	tpm_put_ops(chip);
 	return rc;
 }
diff --git a/drivers/char/tpm/tpm-sysfs.c b/drivers/char/tpm/tpm-sysfs.c
index b46cf70..a89d0e2 100644
--- a/drivers/char/tpm/tpm-sysfs.c
+++ b/drivers/char/tpm/tpm-sysfs.c
@@ -101,7 +101,7 @@ static ssize_t pcrs_show(struct device *dev, struct device_attribute *attr,
 
 	num_pcrs = be32_to_cpu(cap.num_pcrs);
 	for (i = 0; i < num_pcrs; i++) {
-		rc = tpm_pcr_read_dev(chip, i, digest);
+		rc = tpm1_pcr_read(chip, i, digest);
 		if (rc)
 			break;
 		str += sprintf(str, "PCR-%02d: ", i);
diff --git a/drivers/char/tpm/tpm.h b/drivers/char/tpm/tpm.h
index de93535..382c7e6 100644
--- a/drivers/char/tpm/tpm.h
+++ b/drivers/char/tpm/tpm.h
@@ -504,7 +504,7 @@ extern void tpm_chip_unregister(struct tpm_chip *chip);
 
 void tpm_sysfs_add_device(struct tpm_chip *chip);
 
-int tpm_pcr_read_dev(struct tpm_chip *chip, int pcr_idx, u8 *res_buf);
+int tpm1_pcr_read(struct tpm_chip *chip, int pcr_idx, u8 *res_buf);
 
 #ifdef CONFIG_ACPI
 extern void tpm_add_ppi(struct tpm_chip *chip);
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 5/5] tpm: use tpm1_pcr_read() in tpm_do_selftest()
  2016-06-17 21:10 [PATCH 0/5] Use tpm_transmit_cmd() consistently Jarkko Sakkinen
                   ` (3 preceding siblings ...)
  2016-06-17 21:10 ` [PATCH 4/5] tpm: rename tpm_pcr_read_dev() to tpm1_pcr_read() Jarkko Sakkinen
@ 2016-06-17 21:10 ` Jarkko Sakkinen
  4 siblings, 0 replies; 8+ messages in thread
From: Jarkko Sakkinen @ 2016-06-17 21:10 UTC (permalink / raw)
  To: Peter Huewe, Jason Gunthorpe
  Cc: linux-security-module, Stefan Berger, Jarkko Sakkinen,
	Marcel Selhorst, moderated list:TPM DEVICE DRIVER, open list

Remove ad-hoc protocol message construction and call instead
tpm1_pcr_read().

Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
---
 drivers/char/tpm/tpm-interface.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/char/tpm/tpm-interface.c b/drivers/char/tpm/tpm-interface.c
index 3995f5c..d0899fb 100644
--- a/drivers/char/tpm/tpm-interface.c
+++ b/drivers/char/tpm/tpm-interface.c
@@ -797,7 +797,7 @@ int tpm_do_selftest(struct tpm_chip *chip)
 	unsigned int loops;
 	unsigned int delay_msec = 100;
 	unsigned long duration;
-	struct tpm_cmd_t cmd;
+	u8 dummy[TPM_DIGEST_SIZE];
 
 	duration = tpm_calc_ordinal_duration(chip, TPM_ORD_CONTINUE_SELFTEST);
 
@@ -812,9 +812,7 @@ int tpm_do_selftest(struct tpm_chip *chip)
 
 	do {
 		/* Attempt to read a PCR value */
-		cmd.header.in = pcrread_header;
-		cmd.params.pcrread_in.pcr_idx = cpu_to_be32(0);
-		rc = tpm_transmit(chip, (u8 *) &cmd, READ_PCR_RESULT_SIZE);
+		rc = tpm1_pcr_read(chip, 0, dummy);
 		/* Some buggy TPMs will not respond to tpm_tis_ready() for
 		 * around 300ms while the self test is ongoing, keep trying
 		 * until the self test duration expires. */
@@ -829,7 +827,6 @@ int tpm_do_selftest(struct tpm_chip *chip)
 		if (rc < TPM_HEADER_SIZE)
 			return -EFAULT;
 
-		rc = be32_to_cpu(cmd.header.out.return_code);
 		if (rc == TPM_ERR_DISABLED || rc == TPM_ERR_DEACTIVATED) {
 			dev_info(&chip->dev,
 				 "TPM is disabled/deactivated (0x%X)\n", rc);
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/5] tpm: unify tpm_gen_interrupt()
  2016-06-17 21:10 ` [PATCH 1/5] tpm: unify tpm_gen_interrupt() Jarkko Sakkinen
@ 2016-06-24 19:30   ` Jason Gunthorpe
  2016-06-24 20:25     ` Jarkko Sakkinen
  0 siblings, 1 reply; 8+ messages in thread
From: Jason Gunthorpe @ 2016-06-24 19:30 UTC (permalink / raw)
  To: Jarkko Sakkinen
  Cc: Peter Huewe, linux-security-module, Stefan Berger,
	Marcel Selhorst, moderated list:TPM DEVICE DRIVER, open list

On Fri, Jun 17, 2016 at 11:10:43PM +0200, Jarkko Sakkinen wrote:
>  extern int tpm_get_timeouts(struct tpm_chip *);
> -extern void tpm_gen_interrupt(struct tpm_chip *);
> +void tpm_gen_interrupt(struct tpm_chip *);

Dropping the argument name is not the kernel standard, if these lines
are going to be churned they may as well be churned to the standard.

FWIW, all the extern's should be dropped too.

Jason

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/5] tpm: unify tpm_gen_interrupt()
  2016-06-24 19:30   ` Jason Gunthorpe
@ 2016-06-24 20:25     ` Jarkko Sakkinen
  0 siblings, 0 replies; 8+ messages in thread
From: Jarkko Sakkinen @ 2016-06-24 20:25 UTC (permalink / raw)
  To: Jason Gunthorpe
  Cc: Peter Huewe, linux-security-module, Stefan Berger,
	Marcel Selhorst, moderated list:TPM DEVICE DRIVER, open list

On Fri, Jun 24, 2016 at 01:30:24PM -0600, Jason Gunthorpe wrote:
> On Fri, Jun 17, 2016 at 11:10:43PM +0200, Jarkko Sakkinen wrote:
> >  extern int tpm_get_timeouts(struct tpm_chip *);
> > -extern void tpm_gen_interrupt(struct tpm_chip *);
> > +void tpm_gen_interrupt(struct tpm_chip *);
> 
> Dropping the argument name is not the kernel standard, if these lines
> are going to be churned they may as well be churned to the standard.
> 
> FWIW, all the extern's should be dropped too.

Thanks for pointin these out. And yes, since this is mostly a cleanup
series, adding a patch that would clean up those unnecessary externs
would make sense. I'll send a revised version with your suggestions.

> Jason

/Jarkko

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-06-24 20:26 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-17 21:10 [PATCH 0/5] Use tpm_transmit_cmd() consistently Jarkko Sakkinen
2016-06-17 21:10 ` [PATCH 1/5] tpm: unify tpm_gen_interrupt() Jarkko Sakkinen
2016-06-24 19:30   ` Jason Gunthorpe
2016-06-24 20:25     ` Jarkko Sakkinen
2016-06-17 21:10 ` [PATCH 2/5] tpm: return error code from tpm_gen_interrupt() Jarkko Sakkinen
2016-06-17 21:10 ` [PATCH 3/5] tpm: use tpm_transmit_cmd() in tpm2_probe() Jarkko Sakkinen
2016-06-17 21:10 ` [PATCH 4/5] tpm: rename tpm_pcr_read_dev() to tpm1_pcr_read() Jarkko Sakkinen
2016-06-17 21:10 ` [PATCH 5/5] tpm: use tpm1_pcr_read() in tpm_do_selftest() Jarkko Sakkinen

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).