Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1671163
| From | Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] tpm: consolidate the TPM startup code |
| Date | 2017-06-20 23:50 +0200 |
| Message-ID | <tUzc5-5At-11@gated-at.bofh.it> (permalink) |
| References | <tUvUR-3DD-13@gated-at.bofh.it> <tUxai-4kt-21@gated-at.bofh.it> <tUypJ-52u-59@gated-at.bofh.it> |
| Organization | Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo |
On Tue, Jun 20, 2017 at 10:55:29PM +0200, Jarkko Sakkinen wrote: > On Tue, Jun 20, 2017 at 01:31:52PM -0600, Jason Gunthorpe wrote: > > On Tue, Jun 20, 2017 at 08:13:34PM +0200, Jarkko Sakkinen wrote: > > > Consolidated all the "manual" TPM startup code to a single function > > > in order to make code flows a bit cleaner and migrate to tpm_buf. > > > > > > Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> > > > drivers/char/tpm/tpm-interface.c | 67 +++++++++++++++++++++++++--------------- > > > drivers/char/tpm/tpm.h | 6 +--- > > > drivers/char/tpm/tpm2-cmd.c | 32 +------------------ > > > 3 files changed, 44 insertions(+), 61 deletions(-) > > > > Makes sense to me > > > > > diff --git a/drivers/char/tpm/tpm-interface.c b/drivers/char/tpm/tpm-interface.c > > > index d2b4df6d9894..fbef47d8bd06 100644 > > > +++ b/drivers/char/tpm/tpm-interface.c > > > @@ -540,6 +540,47 @@ ssize_t tpm_transmit_cmd(struct tpm_chip *chip, struct tpm_space *space, > > > } > > > EXPORT_SYMBOL_GPL(tpm_transmit_cmd); > > > > > > +#define TPM_ORD_STARTUP 153 > > > +#define TPM_ST_CLEAR 1 > > > > We should really have a tpm1.h and tpm2.h that has all these various > > constants and things instead of open coding them randomly all over.. > > > > Jason > > I agree. I agree means here that I agree if you mean only protocol specific constants. I do not think it would make sense with things like struct tpm_readpubek_out that is a throw away only used by that one function as helper (would compare it to a helper function). It would only make reading the code slower. It would make sense, for example, to have enum tpm_ordinals for all TPM 1.2 ordinals in tpm1_proto.h (yes would add _proto for clarity). /Jarkko
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH] tpm: consolidate the TPM startup code Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> - 2017-06-20 20:20 +0200
Re: [PATCH] tpm: consolidate the TPM startup code Jason Gunthorpe <jgunthorpe@obsidianresearch.com> - 2017-06-20 21:40 +0200
Re: [tpmdd-devel] [PATCH] tpm: consolidate the TPM startup code Ken Goldman <kgold@linux.vnet.ibm.com> - 2017-06-20 23:00 +0200
Re: [PATCH] tpm: consolidate the TPM startup code Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> - 2017-06-20 23:00 +0200
Re: [PATCH] tpm: consolidate the TPM startup code Stefan Berger <stefanb@linux.vnet.ibm.com> - 2017-06-20 23:30 +0200
Re: [PATCH] tpm: consolidate the TPM startup code Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> - 2017-06-20 23:40 +0200
Re: [PATCH] tpm: consolidate the TPM startup code Stefan Berger <stefanb@linux.vnet.ibm.com> - 2017-06-21 00:20 +0200
Re: [PATCH] tpm: consolidate the TPM startup code Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> - 2017-06-20 23:40 +0200
Re: [PATCH] tpm: consolidate the TPM startup code Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> - 2017-06-20 23:50 +0200
csiph-web