Re: [PATCH] tpm: remove redundant code from self-test functions

2016-04-07 Thread Jarkko Sakkinen
On Wed, Apr 06, 2016 at 04:03:52PM +0200, Christophe Ricard wrote: >Hi Jarkko, > >I think there is a bug in the current version of this patch. >tpm1_pcr_read returns TPM status code (>= 0) > >In tpm_do_selftest, after tpm1_pcr_read, rc is compared with >TPM_HEADER_SIZE. > >

Re: [PATCH] tpm: remove redundant code from self-test functions

2016-04-05 Thread Jarkko Sakkinen
On Fri, Apr 01, 2016 at 09:16:15PM -0600, Jason Gunthorpe wrote: > On Thu, Mar 31, 2016 at 09:37:56AM +0300, Jarkko Sakkinen wrote: > > On Wed, Mar 30, 2016 at 11:46:23PM -0600, Jason Gunthorpe wrote: > > > On Wed, Mar 30, 2016 at 04:20:45PM +0300, Jarkko Sakkinen wrote: > > > > > > > -

Re: [PATCH] tpm: remove redundant code from self-test functions

2016-04-01 Thread Jason Gunthorpe
On Thu, Mar 31, 2016 at 09:37:56AM +0300, Jarkko Sakkinen wrote: > On Wed, Mar 30, 2016 at 11:46:23PM -0600, Jason Gunthorpe wrote: > > On Wed, Mar 30, 2016 at 04:20:45PM +0300, Jarkko Sakkinen wrote: > > > > > - rc = be32_to_cpu(cmd.header.out.return_code); > > > if (rc == TPM

Re: [PATCH] tpm: remove redundant code from self-test functions

2016-03-30 Thread Jarkko Sakkinen
On Wed, Mar 30, 2016 at 11:46:23PM -0600, Jason Gunthorpe wrote: > On Wed, Mar 30, 2016 at 04:20:45PM +0300, Jarkko Sakkinen wrote: > > > - rc = be32_to_cpu(cmd.header.out.return_code); > > if (rc == TPM_ERR_DISABLED || rc == TPM_ERR_DEACTIVATED) { > > This line is the ent

Re: [PATCH] tpm: remove redundant code from self-test functions

2016-03-30 Thread Jason Gunthorpe
On Wed, Mar 30, 2016 at 04:20:45PM +0300, Jarkko Sakkinen wrote: > - rc = be32_to_cpu(cmd.header.out.return_code); > if (rc == TPM_ERR_DISABLED || rc == TPM_ERR_DEACTIVATED) { This line is the entire reason it is open coded, I see it being removed, but I don't see how

Re: [PATCH] tpm: remove redundant code from self-test functions

2016-03-30 Thread Jarkko Sakkinen
On Wed, Mar 30, 2016 at 04:20:45PM +0300, Jarkko Sakkinen wrote: > Self-test functions construct PCR read calls by ad hoc, which is only a > waste space. Use instead tpm_pcr_read_dev (renamed as tpm1_pcr_read() by > this commit) in tpm_do_selftest and tpm2_pcr_read() in > tpm2_do_selftest() functio

[PATCH] tpm: remove redundant code from self-test functions

2016-03-30 Thread Jarkko Sakkinen
Self-test functions construct PCR read calls by ad hoc, which is only a waste space. Use instead tpm_pcr_read_dev (renamed as tpm1_pcr_read() by this commit) in tpm_do_selftest and tpm2_pcr_read() in tpm2_do_selftest() functions in order to remove the duplicate code. Patch can be tested easily tes

Re: [PATCH] tpm: remove redundant code from self-test functions

2016-03-30 Thread kbuild test robot
Hi Jarkko, [auto build test ERROR on next-20160330] [cannot apply to v4.6-rc1 v4.5-rc7 v4.5-rc6 v4.6-rc1] [if your patch is applied to the wrong git tree, please drop us a note to help improving the system] url: https://github.com/0day-ci/linux/commits/Jarkko-Sakkinen/tpm-remove-redundant-co

Re: [PATCH] tpm: remove redundant code from self-test functions

2016-03-29 Thread kbuild test robot
Hi Jarkko, [auto build test ERROR on next-20160330] [cannot apply to v4.6-rc1 v4.5-rc7 v4.5-rc6 v4.6-rc1] [if your patch is applied to the wrong git tree, please drop us a note to help improving the system] url: https://github.com/0day-ci/linux/commits/Jarkko-Sakkinen/tpm-remove-redundant-co

Re: [PATCH] tpm: remove redundant code from self-test functions

2016-03-29 Thread Jarkko Sakkinen
On Wed, Mar 30, 2016 at 08:37:59AM +0300, Jarkko Sakkinen wrote: > Self-test functions construct PCR read calls by ad hoc, which is only a > waste space. Use instead tpm_pcr_read_dev (renamed as tpm1_pcr_read() by > this commit) in tpm_do_selftest and tpm2_pcr_read() in > tpm2_do_selftest() functio

Re: [PATCH] tpm: remove redundant code from self-test functions

2016-03-29 Thread kbuild test robot
Hi Jarkko, [auto build test ERROR on next-20160330] [cannot apply to v4.6-rc1 v4.5-rc7 v4.5-rc6 v4.6-rc1] [if your patch is applied to the wrong git tree, please drop us a note to help improving the system] url: https://github.com/0day-ci/linux/commits/Jarkko-Sakkinen/tpm-remove-redundant-co

[PATCH] tpm: remove redundant code from self-test functions

2016-03-29 Thread Jarkko Sakkinen
Self-test functions construct PCR read calls by ad hoc, which is only a waste space. Use instead tpm_pcr_read_dev (renamed as tpm1_pcr_read() by this commit) in tpm_do_selftest and tpm2_pcr_read() in tpm2_do_selftest() functions in order to remove the duplicate code. Patch can be tested easily tes