From: Roberto Sassu Subject: Re: [PATCH 3/4] tpm: introduce tpm_pcr_algorithms() Date: Wed, 5 Apr 2017 15:33:55 +0200 Message-ID: References: <20170329102452.32212-1-roberto.sassu@huawei.com> <20170329102452.32212-4-roberto.sassu@huawei.com> <20170405121331.w5njxsf3nrztvlzb@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20170405121331.w5njxsf3nrztvlzb-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: tpmdd-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org To: Jarkko Sakkinen Cc: linux-ima-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org, tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: tpmdd-devel@lists.sourceforge.net On 4/5/2017 2:13 PM, Jarkko Sakkinen wrote: > On Wed, Mar 29, 2017 at 12:24:51PM +0200, Roberto Sassu wrote: >> Return the algorithms supported by the TPM. The limit >> (TPM_ACTIVE_BANKS_MAX) has been exported to include/linux/tpm.h. >> >> Signed-off-by: Roberto Sassu > > Why is this needed? The reason of exporting the limit is that this simplifies the code dealing with information returned by the TPM driver interface. The new function tpm_pcr_algorithms() can accept as input a static array, instead of returning a dynamic array that must be freed by the caller. Since the size of the dynamic array would have been the same of that of the active_banks array, member of the tpm_chip structure, and since the limit is small, the choice of using static arrays seems reasonable. Roberto ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot