From: Miquel Raynal <miquel.raynal@bootlin.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3 03/25] tpm: disociate TPMv1.x specific and generic code
Date: Tue, 15 May 2018 10:56:56 +0200 [thread overview]
Message-ID: <20180515105656.667cbecb@xps13> (raw)
In-Reply-To: <20180514194307.GW12235@bill-the-cat.ec.rr.com>
Hi Tom,
On Mon, 14 May 2018 15:43:07 -0400, Tom Rini <trini@konsulko.com> wrote:
> On Mon, May 14, 2018 at 08:01:57PM +0200, Miquel Raynal wrote:
> > Hi Simon,
> >
> > On Wed, 2 May 2018 20:31:48 -0600, Simon Glass <sjg@chromium.org> wrote:
> >
> > > Hi Miquel,
> > >
> > > On 2 May 2018 at 02:59, Miquel Raynal <miquel.raynal@bootlin.com> wrote:
> > > > There are no changes in this commit unless:
> > > > 1/ a new organization of the code as follow.
> > > > 2/ some *very* basic checkpatch.pl corrections that polluated my reports
> > > > like s/uint<x>_t/u<x>/, blank spaces and non-aligned parameters on
> > > > parenthesis.
> > > >
> > > > * cmd/ directory:
> > > > > move existing code from cmd/tpm.c in cmd/tpm-common.c
> > > > > move specific code in cmd/tpm-v1.c
> > > > > create a specific header file with generic definitions for
> > > > commands only called cmd/tpm-user-utils.h
> > > >
> > > > * lib/ directory:
> > > > > move existing code from lib/tpm.c in lib/tpm-common.c
> > > > > move specific code in lib/tpm-v1.c
> > > > > create a specific header file with generic definitions for
> > > > the library itself called lib/tpm-utils.h
> > > >
> > > > * include/ directory:
> > > > > move existing code from include/tpm.h in include/tpm-common.h
> > > > > move specific code in include/tpm-v1.h
> > > >
> > > > Code designated as 'common' is compiled if TPM are used. Code designated
> > > > as 'specific' is compiled only if the right specification has been
> > > > selected.
> > > >
> > > > All files include tpm-common.h.
> > > > Files in cmd/ include tpm-user-utils.h.
> > > > Files in lib/ include tpm-utils.h.
> > > > Depending on the specification, files may include either (not both)
> > > > tpm-v1.h or tpm-v2.h.
> > > >
> > > > Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> > > > ---
> > > > cmd/Makefile | 3 +-
> > > > cmd/tpm-common.c | 289 +++++++++++++++++++++++++++++++++++
> > > > cmd/tpm-user-utils.h | 25 +++
> > > > cmd/{tpm.c => tpm-v1.c} | 305 ++-----------------------------------
> > > > cmd/tpm_test.c | 2 +-
> > > > drivers/tpm/tpm-uclass.c | 4 +-
> > > > drivers/tpm/tpm_atmel_twi.c | 2 +-
> > > > drivers/tpm/tpm_tis_infineon.c | 2 +-
> > > > drivers/tpm/tpm_tis_lpc.c | 2 +-
> > > > drivers/tpm/tpm_tis_sandbox.c | 2 +-
> > > > drivers/tpm/tpm_tis_st33zp24_i2c.c | 2 +-
> > > > drivers/tpm/tpm_tis_st33zp24_spi.c | 2 +-
> > > > include/tpm-common.h | 214 ++++++++++++++++++++++++++
> > > > include/{tpm.h => tpm-v1.h} | 274 ++++++---------------------------
> > > > lib/Makefile | 3 +-
> > > > lib/tpm-common.c | 189 +++++++++++++++++++++++
> > > > lib/tpm-utils.h | 96 ++++++++++++
> > > > lib/{tpm.c => tpm-v1.c} | 248 +-----------------------------
> > > > 18 files changed, 886 insertions(+), 778 deletions(-)
> > > > create mode 100644 cmd/tpm-common.c
> > > > create mode 100644 cmd/tpm-user-utils.h
> > > > rename cmd/{tpm.c => tpm-v1.c} (76%)
> > > > create mode 100644 include/tpm-common.h
> > > > rename include/{tpm.h => tpm-v1.h} (62%)
> > > > create mode 100644 lib/tpm-common.c
> > > > create mode 100644 lib/tpm-utils.h
> > > > rename lib/{tpm.c => tpm-v1.c} (81%)
> > > >
> > >
> > > This is a bit hard to review as there is so much going on.
> > >
> > > Can you do the patman/chcekpatch clean-up in a separate patch before
> > > this one? Then hopefully most of this becomes just a rename?
> >
> > I understand your point and made all the checkpatch.pl changes in
> > different commits previously to this one.
> >
> > Unfortunately, as I split one file (<dir> being include/cmd/lib):
> > - <dir>/tpm.x
> > in two files:
> > - <dir>/tpm-common.x
> > - <dir>/tpm-v1.x
> >
> > There will never be just a rename :/
> >
> > >
> > > Also do you have to do it all at once in one patch? It seem slike you
> > > could move lib/ around separately from cmd/ for example.
> > >
> > > At present all I can give is a rubber stamp.
> >
> > I think it would add more changes doing so because of the includes
> > being renamed. Plus, I don't think the understanding would be enhanced
> > as the point of this commit is to clearly separate shared code and
> > specific code for TPMv1 only chips. From my point of view doing so in
> > several commits does not clarify the goal, nor it would simplify the
> > review :(
> >
> > Otherwise, in the next version there will be nothing more than just code
> > moves in this commit.
> >
> > Hope this new split of the changes will be enough?
>
> You're really sure you've only got just file renames, content moving and
> related header additions here? Thanks!
>
I tried my best, yes :)
Thanks,
Miquèl
next prev parent reply other threads:[~2018-05-15 8:56 UTC|newest]
Thread overview: 58+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-02 8:59 [U-Boot] [PATCH v3 00/25] Introduce TPMv2.0 support Miquel Raynal
2018-05-02 8:59 ` [U-Boot] [PATCH v3 01/25] tpm: add Revision ID field in the chip structure Miquel Raynal
2018-05-02 8:59 ` [U-Boot] [PATCH v3 02/25] tpm: prepare introduction of TPMv2.x support in Kconfig Miquel Raynal
2018-05-02 19:33 ` Simon Glass
2018-05-02 8:59 ` [U-Boot] [PATCH v3 03/25] tpm: disociate TPMv1.x specific and generic code Miquel Raynal
2018-05-03 2:31 ` Simon Glass
2018-05-14 18:01 ` Miquel Raynal
2018-05-14 19:43 ` Tom Rini
2018-05-15 8:56 ` Miquel Raynal [this message]
2018-05-02 8:59 ` [U-Boot] [PATCH v3 04/25] tpm: prepare support for TPMv2.x commands Miquel Raynal
2018-05-03 2:31 ` Simon Glass
2018-05-03 12:27 ` Miquel Raynal
2018-05-02 8:59 ` [U-Boot] [PATCH v3 05/25] tpm: add macros to enhance TPM commands readability Miquel Raynal
2018-05-03 2:31 ` Simon Glass
2018-05-02 8:59 ` [U-Boot] [PATCH v3 06/25] tpm: add possible traces to analyze buffers returned by the TPM Miquel Raynal
2018-05-02 8:59 ` [U-Boot] [PATCH v3 07/25] tpm: report driver error code to upper layer Miquel Raynal
2018-05-03 2:31 ` Simon Glass
2018-05-02 8:59 ` [U-Boot] [PATCH v3 08/25] tpm: add TPM2_Startup command support Miquel Raynal
2018-05-03 2:31 ` Simon Glass
2018-05-02 8:59 ` [U-Boot] [PATCH v3 09/25] tpm: add TPM2_SelfTest " Miquel Raynal
2018-05-03 2:32 ` Simon Glass
2018-05-02 8:59 ` [U-Boot] [PATCH v3 10/25] tpm: add TPM2_Clear " Miquel Raynal
2018-05-03 2:32 ` Simon Glass
2018-05-02 8:59 ` [U-Boot] [PATCH v3 11/25] tpm: add TPM2_PCR_Extend " Miquel Raynal
2018-05-03 2:32 ` Simon Glass
2018-05-02 8:59 ` [U-Boot] [PATCH v3 12/25] tpm: add TPM2_PCR_Read " Miquel Raynal
2018-05-03 2:32 ` Simon Glass
2018-05-15 7:52 ` Miquel Raynal
2018-05-02 8:59 ` [U-Boot] [PATCH v3 13/25] tpm: add TPM2_GetCapability " Miquel Raynal
2018-05-03 2:32 ` Simon Glass
2018-05-15 8:19 ` Miquel Raynal
2018-05-02 8:59 ` [U-Boot] [PATCH v3 14/25] tpm: add dictionary attack mitigation commands support Miquel Raynal
2018-05-03 2:32 ` Simon Glass
2018-05-02 8:59 ` [U-Boot] [PATCH v3 15/25] tpm: add TPM2_HierarchyChangeAuth command support Miquel Raynal
2018-05-03 2:32 ` Simon Glass
2018-05-02 8:59 ` [U-Boot] [PATCH v3 16/25] tpm: add PCR authentication commands support Miquel Raynal
2018-05-03 2:32 ` Simon Glass
2018-05-02 8:59 ` [U-Boot] [PATCH v3 17/25] tpm: add support for TPMv2.x SPI modules Miquel Raynal
2018-05-03 2:32 ` Simon Glass
2018-05-15 8:48 ` Miquel Raynal
2018-05-02 8:59 ` [U-Boot] [PATCH v3 18/25] tpm: add the possibility to reset the chip with a gpio Miquel Raynal
2018-05-03 2:32 ` Simon Glass
2018-05-02 8:59 ` [U-Boot] [PATCH v3 19/25] doc: device-tree-bindings: add ST33TPHF20 TPMv2.0 module info Miquel Raynal
2018-05-03 2:32 ` Simon Glass
2018-05-02 8:59 ` [U-Boot] [PATCH v3 20/25] test/py: add TPMv2.x test suite Miquel Raynal
2018-05-03 2:32 ` Simon Glass
2018-05-02 8:59 ` [U-Boot] [PATCH v3 21/25] tpm: add a Sandbox TPMv2.x driver Miquel Raynal
2018-05-03 2:32 ` Simon Glass
2018-05-02 8:59 ` [U-Boot] [PATCH v3 22/25] doc: device-tree-bindings: add Sandbox TPMv2.0 module info Miquel Raynal
2018-05-03 2:32 ` Simon Glass
2018-05-03 12:45 ` Miquel Raynal
2018-05-02 8:59 ` [U-Boot] [PATCH v3 23/25] sandbox: dts: add Sandbox TPMv2.x node Miquel Raynal
2018-05-03 2:32 ` Simon Glass
2018-05-02 8:59 ` [U-Boot] [PATCH v3 24/25] configs: add TPMv2.x support in Sandbox Miquel Raynal
2018-05-03 2:32 ` Simon Glass
2018-05-02 8:59 ` [U-Boot] [PATCH v3 25/25] tpm: allow Sandbox to run TPMv2.x commands Miquel Raynal
2018-05-03 2:32 ` Simon Glass
2018-05-03 12:56 ` Miquel Raynal
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180515105656.667cbecb@xps13 \
--to=miquel.raynal@bootlin.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox