aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/acpica/utexcep.c
diff options
context:
space:
mode:
authorBob Moore <robert.moore@intel.com>2013-03-08 04:22:39 -0500
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-03-11 19:45:05 -0400
commitae1b4769989f8707a1f092db191fa2f9a0fc8604 (patch)
treea6f05a11c411b1b2a5da2d136e5d2df3b2d7da5d /drivers/acpi/acpica/utexcep.c
parent995b9a9d44acaf9e551be6f1fe606af179b9753f (diff)
ACPICA: Add exception descriptions to exception info table
Descriptions to be compiled/used by the acpihelp utility only. Not compiled for the kernel ACPICA code. Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi/acpica/utexcep.c')
-rw-r--r--drivers/acpi/acpica/utexcep.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/drivers/acpi/acpica/utexcep.c b/drivers/acpi/acpica/utexcep.c
index a0ab7c02e87c..b543a144941a 100644
--- a/drivers/acpi/acpica/utexcep.c
+++ b/drivers/acpi/acpica/utexcep.c
@@ -64,7 +64,7 @@ ACPI_MODULE_NAME("utexcep")
64 ******************************************************************************/ 64 ******************************************************************************/
65const char *acpi_format_exception(acpi_status status) 65const char *acpi_format_exception(acpi_status status)
66{ 66{
67 const char *exception = NULL; 67 const struct acpi_exception_info *exception;
68 68
69 ACPI_FUNCTION_ENTRY(); 69 ACPI_FUNCTION_ENTRY();
70 70
@@ -76,10 +76,10 @@ const char *acpi_format_exception(acpi_status status)
76 ACPI_ERROR((AE_INFO, 76 ACPI_ERROR((AE_INFO,
77 "Unknown exception code: 0x%8.8X", status)); 77 "Unknown exception code: 0x%8.8X", status));
78 78
79 exception = "UNKNOWN_STATUS_CODE"; 79 return ("UNKNOWN_STATUS_CODE");
80 } 80 }
81 81
82 return (ACPI_CAST_PTR(const char, exception)); 82 return (exception->name);
83} 83}
84 84
85ACPI_EXPORT_SYMBOL(acpi_format_exception) 85ACPI_EXPORT_SYMBOL(acpi_format_exception)
@@ -97,10 +97,10 @@ ACPI_EXPORT_SYMBOL(acpi_format_exception)
97 * an ASCII string. 97 * an ASCII string.
98 * 98 *
99 ******************************************************************************/ 99 ******************************************************************************/
100const char *acpi_ut_validate_exception(acpi_status status) 100const struct acpi_exception_info *acpi_ut_validate_exception(acpi_status status)
101{ 101{
102 u32 sub_status; 102 u32 sub_status;
103 const char *exception = NULL; 103 const struct acpi_exception_info *exception = NULL;
104 104
105 ACPI_FUNCTION_ENTRY(); 105 ACPI_FUNCTION_ENTRY();
106 106
@@ -113,35 +113,35 @@ const char *acpi_ut_validate_exception(acpi_status status)
113 case AE_CODE_ENVIRONMENTAL: 113 case AE_CODE_ENVIRONMENTAL:
114 114
115 if (sub_status <= AE_CODE_ENV_MAX) { 115 if (sub_status <= AE_CODE_ENV_MAX) {
116 exception = acpi_gbl_exception_names_env[sub_status]; 116 exception = &acpi_gbl_exception_names_env[sub_status];
117 } 117 }
118 break; 118 break;
119 119
120 case AE_CODE_PROGRAMMER: 120 case AE_CODE_PROGRAMMER:
121 121
122 if (sub_status <= AE_CODE_PGM_MAX) { 122 if (sub_status <= AE_CODE_PGM_MAX) {
123 exception = acpi_gbl_exception_names_pgm[sub_status]; 123 exception = &acpi_gbl_exception_names_pgm[sub_status];
124 } 124 }
125 break; 125 break;
126 126
127 case AE_CODE_ACPI_TABLES: 127 case AE_CODE_ACPI_TABLES:
128 128
129 if (sub_status <= AE_CODE_TBL_MAX) { 129 if (sub_status <= AE_CODE_TBL_MAX) {
130 exception = acpi_gbl_exception_names_tbl[sub_status]; 130 exception = &acpi_gbl_exception_names_tbl[sub_status];
131 } 131 }
132 break; 132 break;
133 133
134 case AE_CODE_AML: 134 case AE_CODE_AML:
135 135
136 if (sub_status <= AE_CODE_AML_MAX) { 136 if (sub_status <= AE_CODE_AML_MAX) {
137 exception = acpi_gbl_exception_names_aml[sub_status]; 137 exception = &acpi_gbl_exception_names_aml[sub_status];
138 } 138 }
139 break; 139 break;
140 140
141 case AE_CODE_CONTROL: 141 case AE_CODE_CONTROL:
142 142
143 if (sub_status <= AE_CODE_CTRL_MAX) { 143 if (sub_status <= AE_CODE_CTRL_MAX) {
144 exception = acpi_gbl_exception_names_ctrl[sub_status]; 144 exception = &acpi_gbl_exception_names_ctrl[sub_status];
145 } 145 }
146 break; 146 break;
147 147
@@ -149,5 +149,9 @@ const char *acpi_ut_validate_exception(acpi_status status)
149 break; 149 break;
150 } 150 }
151 151
152 return (ACPI_CAST_PTR(const char, exception)); 152 if (!exception || !exception->name) {
153 return (NULL);
154 }
155
156 return (exception);
153} 157}