tpm: replace dynamically allocated bios_dir with a static array

This commit is based on a commit by Nayna Jain. Replaced dynamically
allocated bios_dir with a static array as the size is always constant.

Suggested-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
This commit is contained in:
Jarkko Sakkinen
2016-11-14 05:00:50 -05:00
parent b1a9b7b602
commit cd9b7631a8
4 changed files with 41 additions and 52 deletions

View File

@@ -40,6 +40,7 @@ enum tpm_const {
TPM_BUFSIZE = 4096,
TPM_NUM_DEVICES = 65536,
TPM_RETRY = 50, /* 5 seconds */
TPM_NUM_EVENT_LOG_FILES = 3,
};
enum tpm_timeout {
@@ -171,7 +172,7 @@ struct tpm_chip {
unsigned long duration[3]; /* jiffies */
bool duration_adjusted;
struct dentry **bios_dir;
struct dentry *bios_dir[TPM_NUM_EVENT_LOG_FILES];
const struct attribute_group *groups[3];
unsigned int groups_cnt;