On Tue, Nov 13, 2018 at 10:49:31AM +0100, Roberto Sassu wrote: > On 11/12/2018 7:09 PM, Nayna Jain wrote: > > > > > > On 11/09/2018 02:59 PM, Roberto Sassu wrote: > > > This patch checks if a PCR bank is active (at least one bit in the > > > pcr_select mask is set). > > > --- > > > drivers/char/tpm/tpm2-cmd.c | 44 +++++++++++++++++++++++++++---------- > > > 1 file changed, 32 insertions(+), 12 deletions(-) > > > > > > diff --git a/drivers/char/tpm/tpm2-cmd.c b/drivers/char/tpm/tpm2-cmd.c > > > index 533089cede07..eba8f8d00a09 100644 > > > --- a/drivers/char/tpm/tpm2-cmd.c > > > +++ b/drivers/char/tpm/tpm2-cmd.c > > > @@ -854,15 +854,20 @@ struct tpm2_pcr_selection { > > > static ssize_t tpm2_get_pcr_allocation(struct tpm_chip *chip) > > > { > > > - struct tpm2_pcr_selection pcr_selection; > > > + struct tpm2_pcr_selection *pcr_selection; > > > struct tpm_buf buf; > > > void *marker; > > > void *end; > > > void *pcr_select_offset; > > > u32 sizeof_pcr_selection; > > > + u32 nr_possible_banks; > > > + u32 nr_active_banks = 0; > > > > The TCG Spec uses the term "allocated" and not "active". For > > consistency, I think we can also use the term "allocated". For example - > > nr_allocated_banks and *allocated_banks both here and in struct > > tpm_chip. > > > > Sorry, it took me sometime to be clear on this else would have mentioned > > previously. > > Thanks. Jarkko? > > Roberto Agree with Nayna. /Jarkko