diff options
author | Peter Huewe <peterhuewe@gmx.de> | 2012-11-12 17:37:17 -0500 |
---|---|---|
committer | Kent Yoder <key@linux.vnet.ibm.com> | 2013-02-05 10:38:21 -0500 |
commit | 720ca4a9af1f1ce1d4d95ec4d6166ce84ede227f (patch) | |
tree | d842524e7250972dead02426a9181d0cbdbc7f47 /drivers/char/tpm/tpm.c | |
parent | feab398e580b1847b729203573a638cf90d5e7fc (diff) |
char/tpm: Remove duplicated lookup table
The entries in tpm_protected_ordinal_duration are exactly the same as
the first 12 in tpm_ordinal_duration, so we can simply remove this one,
and save some bytes.
This does not change the behavior of the driver.
Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Kent Yoder <key@linux.vnet.ibm.com>
Diffstat (limited to 'drivers/char/tpm/tpm.c')
-rw-r--r-- | drivers/char/tpm/tpm.c | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/drivers/char/tpm/tpm.c b/drivers/char/tpm/tpm.c index 93211df52aab..9e3c529cac80 100644 --- a/drivers/char/tpm/tpm.c +++ b/drivers/char/tpm/tpm.c | |||
@@ -65,21 +65,6 @@ static DECLARE_BITMAP(dev_mask, TPM_NUM_DEVICES); | |||
65 | * values of the SHORT, MEDIUM, and LONG durations are retrieved | 65 | * values of the SHORT, MEDIUM, and LONG durations are retrieved |
66 | * from the chip during initialization with a call to tpm_get_timeouts. | 66 | * from the chip during initialization with a call to tpm_get_timeouts. |
67 | */ | 67 | */ |
68 | static const u8 tpm_protected_ordinal_duration[TPM_MAX_PROTECTED_ORDINAL] = { | ||
69 | TPM_UNDEFINED, /* 0 */ | ||
70 | TPM_UNDEFINED, | ||
71 | TPM_UNDEFINED, | ||
72 | TPM_UNDEFINED, | ||
73 | TPM_UNDEFINED, | ||
74 | TPM_UNDEFINED, /* 5 */ | ||
75 | TPM_UNDEFINED, | ||
76 | TPM_UNDEFINED, | ||
77 | TPM_UNDEFINED, | ||
78 | TPM_UNDEFINED, | ||
79 | TPM_SHORT, /* 10 */ | ||
80 | TPM_SHORT, | ||
81 | }; | ||
82 | |||
83 | static const u8 tpm_ordinal_duration[TPM_MAX_ORDINAL] = { | 68 | static const u8 tpm_ordinal_duration[TPM_MAX_ORDINAL] = { |
84 | TPM_UNDEFINED, /* 0 */ | 69 | TPM_UNDEFINED, /* 0 */ |
85 | TPM_UNDEFINED, | 70 | TPM_UNDEFINED, |
@@ -357,8 +342,7 @@ unsigned long tpm_calc_ordinal_duration(struct tpm_chip *chip, | |||
357 | else if ((ordinal & TPM_PROTECTED_ORDINAL_MASK) < | 342 | else if ((ordinal & TPM_PROTECTED_ORDINAL_MASK) < |
358 | TPM_MAX_PROTECTED_ORDINAL) | 343 | TPM_MAX_PROTECTED_ORDINAL) |
359 | duration_idx = | 344 | duration_idx = |
360 | tpm_protected_ordinal_duration[ordinal & | 345 | tpm_ordinal_duration[ordinal & TPM_PROTECTED_ORDINAL_MASK]; |
361 | TPM_PROTECTED_ORDINAL_MASK]; | ||
362 | 346 | ||
363 | if (duration_idx != TPM_UNDEFINED) | 347 | if (duration_idx != TPM_UNDEFINED) |
364 | duration = chip->vendor.duration[duration_idx]; | 348 | duration = chip->vendor.duration[duration_idx]; |