aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char
diff options
context:
space:
mode:
authorXiaoyan Zhang <xiaoyan.zhang@intel.com>2013-08-29 08:39:11 -0400
committerJames Morris <james.l.morris@oracle.com>2012-09-04 19:52:23 -0400
commit81198078d7da4240f3cbfc2c6a8ea6cd417f51a7 (patch)
tree8f92437b16f9013d2632a149dea0a0cf357d2734 /drivers/char
parentf84fdff0fdcda7e509ce530e0ee612233a2104fb (diff)
driver/char/tpm: declare internal symbols as static
This patch declares the internal struct and functions as static to provide more security. Signed-off-by: Xiaoyan Zhang <xiaoyan.zhang@intel.com> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com> Reviewed-by: Kent Yoder <key@linux.vnet.ibm.com> Signed-off-by: James Morris <james.l.morris@oracle.com>
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/tpm/tpm.c4
-rw-r--r--drivers/char/tpm/tpm_ppi.c37
2 files changed, 21 insertions, 20 deletions
diff --git a/drivers/char/tpm/tpm.c b/drivers/char/tpm/tpm.c
index 39526c053158..6724615a4fdd 100644
--- a/drivers/char/tpm/tpm.c
+++ b/drivers/char/tpm/tpm.c
@@ -915,7 +915,7 @@ EXPORT_SYMBOL_GPL(tpm_show_pcrs);
915 915
916#define READ_PUBEK_RESULT_SIZE 314 916#define READ_PUBEK_RESULT_SIZE 314
917#define TPM_ORD_READPUBEK cpu_to_be32(124) 917#define TPM_ORD_READPUBEK cpu_to_be32(124)
918struct tpm_input_header tpm_readpubek_header = { 918static struct tpm_input_header tpm_readpubek_header = {
919 .tag = TPM_TAG_RQU_COMMAND, 919 .tag = TPM_TAG_RQU_COMMAND,
920 .length = cpu_to_be32(30), 920 .length = cpu_to_be32(30),
921 .ordinal = TPM_ORD_READPUBEK 921 .ordinal = TPM_ORD_READPUBEK
@@ -1395,7 +1395,7 @@ EXPORT_SYMBOL_GPL(tpm_dev_vendor_release);
1395 * Once all references to platform device are down to 0, 1395 * Once all references to platform device are down to 0,
1396 * release all allocated structures. 1396 * release all allocated structures.
1397 */ 1397 */
1398void tpm_dev_release(struct device *dev) 1398static void tpm_dev_release(struct device *dev)
1399{ 1399{
1400 struct tpm_chip *chip = dev_get_drvdata(dev); 1400 struct tpm_chip *chip = dev_get_drvdata(dev);
1401 1401
diff --git a/drivers/char/tpm/tpm_ppi.c b/drivers/char/tpm/tpm_ppi.c
index 440fa1c2d301..f27b58cfae98 100644
--- a/drivers/char/tpm/tpm_ppi.c
+++ b/drivers/char/tpm/tpm_ppi.c
@@ -53,8 +53,8 @@ static inline void ppi_assign_params(union acpi_object params[4],
53 params[3].package.elements = NULL; 53 params[3].package.elements = NULL;
54} 54}
55 55
56ssize_t tpm_show_ppi_version(struct device *dev, struct device_attribute *attr, 56static ssize_t tpm_show_ppi_version(struct device *dev,
57 char *buf) 57 struct device_attribute *attr, char *buf)
58{ 58{
59 acpi_handle handle; 59 acpi_handle handle;
60 acpi_status status; 60 acpi_status status;
@@ -82,9 +82,8 @@ ssize_t tpm_show_ppi_version(struct device *dev, struct device_attribute *attr,
82 return status; 82 return status;
83} 83}
84 84
85ssize_t tpm_show_ppi_request(struct device *dev, 85static ssize_t tpm_show_ppi_request(struct device *dev,
86 struct device_attribute *attr, 86 struct device_attribute *attr, char *buf)
87 char *buf)
88{ 87{
89 acpi_handle handle; 88 acpi_handle handle;
90 acpi_status status; 89 acpi_status status;
@@ -132,9 +131,9 @@ cleanup:
132 return status; 131 return status;
133} 132}
134 133
135ssize_t tpm_store_ppi_request(struct device *dev, 134static ssize_t tpm_store_ppi_request(struct device *dev,
136 struct device_attribute *attr, 135 struct device_attribute *attr,
137 const char *buf, size_t count) 136 const char *buf, size_t count)
138{ 137{
139 char version[PPI_VERSION_LEN + 1]; 138 char version[PPI_VERSION_LEN + 1];
140 acpi_handle handle; 139 acpi_handle handle;
@@ -207,9 +206,9 @@ ssize_t tpm_store_ppi_request(struct device *dev,
207 return status; 206 return status;
208} 207}
209 208
210ssize_t tpm_show_ppi_transition_action(struct device *dev, 209static ssize_t tpm_show_ppi_transition_action(struct device *dev,
211 struct device_attribute *attr, 210 struct device_attribute *attr,
212 char *buf) 211 char *buf)
213{ 212{
214 char version[PPI_VERSION_LEN + 1]; 213 char version[PPI_VERSION_LEN + 1];
215 acpi_handle handle; 214 acpi_handle handle;
@@ -269,9 +268,9 @@ ssize_t tpm_show_ppi_transition_action(struct device *dev,
269 return status; 268 return status;
270} 269}
271 270
272ssize_t tpm_show_ppi_response(struct device *dev, 271static ssize_t tpm_show_ppi_response(struct device *dev,
273 struct device_attribute *attr, 272 struct device_attribute *attr,
274 char *buf) 273 char *buf)
275{ 274{
276 acpi_handle handle; 275 acpi_handle handle;
277 acpi_status status; 276 acpi_status status;
@@ -413,14 +412,16 @@ static ssize_t show_ppi_operations(char *buf, u32 start, u32 end)
413 return str - buf; 412 return str - buf;
414} 413}
415 414
416ssize_t tpm_show_ppi_tcg_operations(struct device *dev, 415static ssize_t tpm_show_ppi_tcg_operations(struct device *dev,
417 struct device_attribute *attr, char *buf) 416 struct device_attribute *attr,
417 char *buf)
418{ 418{
419 return show_ppi_operations(buf, 0, PPI_TPM_REQ_MAX); 419 return show_ppi_operations(buf, 0, PPI_TPM_REQ_MAX);
420} 420}
421 421
422ssize_t tpm_show_ppi_vs_operations(struct device *dev, 422static ssize_t tpm_show_ppi_vs_operations(struct device *dev,
423 struct device_attribute *attr, char *buf) 423 struct device_attribute *attr,
424 char *buf)
424{ 425{
425 return show_ppi_operations(buf, PPI_VS_REQ_START, PPI_VS_REQ_END); 426 return show_ppi_operations(buf, PPI_VS_REQ_START, PPI_VS_REQ_END);
426} 427}