aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/debug.c
diff options
context:
space:
mode:
authorLen Brown <len.brown@intel.com>2005-08-05 00:44:28 -0400
committerLen Brown <len.brown@intel.com>2005-08-05 00:45:14 -0400
commit4be44fcd3bf648b782f4460fd06dfae6c42ded4b (patch)
tree5b5b7d296ea58786f53b95e5eac9565ff66890b0 /drivers/acpi/debug.c
parentc65ade4dc8b486e8c8b9b0a6399789a5428e2039 (diff)
[ACPI] Lindent all ACPI files
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/debug.c')
-rw-r--r--drivers/acpi/debug.c115
1 files changed, 55 insertions, 60 deletions
diff --git a/drivers/acpi/debug.c b/drivers/acpi/debug.c
index 2c0dac559f16..263322b7d113 100644
--- a/drivers/acpi/debug.c
+++ b/drivers/acpi/debug.c
@@ -12,17 +12,14 @@
12#include <acpi/acglobal.h> 12#include <acpi/acglobal.h>
13 13
14#define _COMPONENT ACPI_SYSTEM_COMPONENT 14#define _COMPONENT ACPI_SYSTEM_COMPONENT
15ACPI_MODULE_NAME ("debug") 15ACPI_MODULE_NAME("debug")
16
17#define ACPI_SYSTEM_FILE_DEBUG_LAYER "debug_layer" 16#define ACPI_SYSTEM_FILE_DEBUG_LAYER "debug_layer"
18#define ACPI_SYSTEM_FILE_DEBUG_LEVEL "debug_level" 17#define ACPI_SYSTEM_FILE_DEBUG_LEVEL "debug_level"
19
20#ifdef MODULE_PARAM_PREFIX 18#ifdef MODULE_PARAM_PREFIX
21#undef MODULE_PARAM_PREFIX 19#undef MODULE_PARAM_PREFIX
22#endif 20#endif
23
24#define MODULE_PARAM_PREFIX 21#define MODULE_PARAM_PREFIX
25module_param(acpi_dbg_layer, uint, 0400); 22 module_param(acpi_dbg_layer, uint, 0400);
26module_param(acpi_dbg_level, uint, 0400); 23module_param(acpi_dbg_level, uint, 0400);
27 24
28struct acpi_dlayer { 25struct acpi_dlayer {
@@ -35,8 +32,7 @@ struct acpi_dlevel {
35}; 32};
36#define ACPI_DEBUG_INIT(v) { .name = #v, .value = v } 33#define ACPI_DEBUG_INIT(v) { .name = #v, .value = v }
37 34
38static const struct acpi_dlayer acpi_debug_layers[] = 35static const struct acpi_dlayer acpi_debug_layers[] = {
39{
40 ACPI_DEBUG_INIT(ACPI_UTILITIES), 36 ACPI_DEBUG_INIT(ACPI_UTILITIES),
41 ACPI_DEBUG_INIT(ACPI_HARDWARE), 37 ACPI_DEBUG_INIT(ACPI_HARDWARE),
42 ACPI_DEBUG_INIT(ACPI_EVENTS), 38 ACPI_DEBUG_INIT(ACPI_EVENTS),
@@ -53,8 +49,7 @@ static const struct acpi_dlayer acpi_debug_layers[] =
53 ACPI_DEBUG_INIT(ACPI_TOOLS), 49 ACPI_DEBUG_INIT(ACPI_TOOLS),
54}; 50};
55 51
56static const struct acpi_dlevel acpi_debug_levels[] = 52static const struct acpi_dlevel acpi_debug_levels[] = {
57{
58 ACPI_DEBUG_INIT(ACPI_LV_ERROR), 53 ACPI_DEBUG_INIT(ACPI_LV_ERROR),
59 ACPI_DEBUG_INIT(ACPI_LV_WARN), 54 ACPI_DEBUG_INIT(ACPI_LV_WARN),
60 ACPI_DEBUG_INIT(ACPI_LV_INIT), 55 ACPI_DEBUG_INIT(ACPI_LV_INIT),
@@ -88,81 +83,77 @@ static const struct acpi_dlevel acpi_debug_levels[] =
88 ACPI_DEBUG_INIT(ACPI_LV_AML_DISASSEMBLE), 83 ACPI_DEBUG_INIT(ACPI_LV_AML_DISASSEMBLE),
89 ACPI_DEBUG_INIT(ACPI_LV_VERBOSE_INFO), 84 ACPI_DEBUG_INIT(ACPI_LV_VERBOSE_INFO),
90 ACPI_DEBUG_INIT(ACPI_LV_FULL_TABLES), 85 ACPI_DEBUG_INIT(ACPI_LV_FULL_TABLES),
91 ACPI_DEBUG_INIT(ACPI_LV_EVENTS), 86 ACPI_DEBUG_INIT(ACPI_LV_EVENTS),
92}; 87};
93 88
94static int 89static int
95acpi_system_read_debug ( 90acpi_system_read_debug(char *page,
96 char *page, 91 char **start, off_t off, int count, int *eof, void *data)
97 char **start,
98 off_t off,
99 int count,
100 int *eof,
101 void *data)
102{ 92{
103 char *p = page; 93 char *p = page;
104 int size = 0; 94 int size = 0;
105 unsigned int i; 95 unsigned int i;
106 96
107 if (off != 0) 97 if (off != 0)
108 goto end; 98 goto end;
109 99
110 p += sprintf(p, "%-25s\tHex SET\n", "Description"); 100 p += sprintf(p, "%-25s\tHex SET\n", "Description");
111 101
112 switch ((unsigned long) data) { 102 switch ((unsigned long)data) {
113 case 0: 103 case 0:
114 for (i = 0; i < ARRAY_SIZE(acpi_debug_layers); i++) { 104 for (i = 0; i < ARRAY_SIZE(acpi_debug_layers); i++) {
115 p += sprintf(p, "%-25s\t0x%08lX [%c]\n", 105 p += sprintf(p, "%-25s\t0x%08lX [%c]\n",
116 acpi_debug_layers[i].name, 106 acpi_debug_layers[i].name,
117 acpi_debug_layers[i].value, 107 acpi_debug_layers[i].value,
118 (acpi_dbg_layer & acpi_debug_layers[i].value) ? 108 (acpi_dbg_layer & acpi_debug_layers[i].
119 '*' : ' '); 109 value) ? '*' : ' ');
120 } 110 }
121 p += sprintf(p, "%-25s\t0x%08X [%c]\n", "ACPI_ALL_DRIVERS", 111 p += sprintf(p, "%-25s\t0x%08X [%c]\n", "ACPI_ALL_DRIVERS",
122 ACPI_ALL_DRIVERS, 112 ACPI_ALL_DRIVERS,
123 (acpi_dbg_layer & ACPI_ALL_DRIVERS) == ACPI_ALL_DRIVERS? 113 (acpi_dbg_layer & ACPI_ALL_DRIVERS) ==
124 '*' : (acpi_dbg_layer & ACPI_ALL_DRIVERS) == 0 ? 114 ACPI_ALL_DRIVERS ? '*' : (acpi_dbg_layer &
125 ' ' : '-'); 115 ACPI_ALL_DRIVERS) ==
116 0 ? ' ' : '-');
126 p += sprintf(p, 117 p += sprintf(p,
127 "--\ndebug_layer = 0x%08X (* = enabled, - = partial)\n", 118 "--\ndebug_layer = 0x%08X (* = enabled, - = partial)\n",
128 acpi_dbg_layer); 119 acpi_dbg_layer);
129 break; 120 break;
130 case 1: 121 case 1:
131 for (i = 0; i < ARRAY_SIZE(acpi_debug_levels); i++) { 122 for (i = 0; i < ARRAY_SIZE(acpi_debug_levels); i++) {
132 p += sprintf(p, "%-25s\t0x%08lX [%c]\n", 123 p += sprintf(p, "%-25s\t0x%08lX [%c]\n",
133 acpi_debug_levels[i].name, 124 acpi_debug_levels[i].name,
134 acpi_debug_levels[i].value, 125 acpi_debug_levels[i].value,
135 (acpi_dbg_level & acpi_debug_levels[i].value) ? 126 (acpi_dbg_level & acpi_debug_levels[i].
136 '*' : ' '); 127 value) ? '*' : ' ');
137 } 128 }
138 p += sprintf(p, "--\ndebug_level = 0x%08X (* = enabled)\n", 129 p += sprintf(p, "--\ndebug_level = 0x%08X (* = enabled)\n",
139 acpi_dbg_level); 130 acpi_dbg_level);
140 break; 131 break;
141 default: 132 default:
142 p += sprintf(p, "Invalid debug option\n"); 133 p += sprintf(p, "Invalid debug option\n");
143 break; 134 break;
144 } 135 }
145 136
146end: 137 end:
147 size = (p - page); 138 size = (p - page);
148 if (size <= off+count) *eof = 1; 139 if (size <= off + count)
140 *eof = 1;
149 *start = page + off; 141 *start = page + off;
150 size -= off; 142 size -= off;
151 if (size>count) size = count; 143 if (size > count)
152 if (size<0) size = 0; 144 size = count;
145 if (size < 0)
146 size = 0;
153 147
154 return size; 148 return size;
155} 149}
156 150
157
158static int 151static int
159acpi_system_write_debug ( 152acpi_system_write_debug(struct file *file,
160 struct file *file, 153 const char __user * buffer,
161 const char __user *buffer, 154 unsigned long count, void *data)
162 unsigned long count,
163 void *data)
164{ 155{
165 char debug_string[12] = {'\0'}; 156 char debug_string[12] = { '\0' };
166 157
167 ACPI_FUNCTION_TRACE("acpi_system_write_debug"); 158 ACPI_FUNCTION_TRACE("acpi_system_write_debug");
168 159
@@ -174,7 +165,7 @@ acpi_system_write_debug (
174 165
175 debug_string[count] = '\0'; 166 debug_string[count] = '\0';
176 167
177 switch ((unsigned long) data) { 168 switch ((unsigned long)data) {
178 case 0: 169 case 0:
179 acpi_dbg_layer = simple_strtoul(debug_string, NULL, 0); 170 acpi_dbg_layer = simple_strtoul(debug_string, NULL, 0);
180 break; 171 break;
@@ -190,9 +181,9 @@ acpi_system_write_debug (
190 181
191static int __init acpi_debug_init(void) 182static int __init acpi_debug_init(void)
192{ 183{
193 struct proc_dir_entry *entry; 184 struct proc_dir_entry *entry;
194 int error = 0; 185 int error = 0;
195 char * name; 186 char *name;
196 187
197 ACPI_FUNCTION_TRACE("acpi_debug_init"); 188 ACPI_FUNCTION_TRACE("acpi_debug_init");
198 189
@@ -201,8 +192,10 @@ static int __init acpi_debug_init(void)
201 192
202 /* 'debug_layer' [R/W] */ 193 /* 'debug_layer' [R/W] */
203 name = ACPI_SYSTEM_FILE_DEBUG_LAYER; 194 name = ACPI_SYSTEM_FILE_DEBUG_LAYER;
204 entry = create_proc_read_entry(name, S_IFREG|S_IRUGO|S_IWUSR, acpi_root_dir, 195 entry =
205 acpi_system_read_debug,(void *)0); 196 create_proc_read_entry(name, S_IFREG | S_IRUGO | S_IWUSR,
197 acpi_root_dir, acpi_system_read_debug,
198 (void *)0);
206 if (entry) 199 if (entry)
207 entry->write_proc = acpi_system_write_debug; 200 entry->write_proc = acpi_system_write_debug;
208 else 201 else
@@ -210,19 +203,21 @@ static int __init acpi_debug_init(void)
210 203
211 /* 'debug_level' [R/W] */ 204 /* 'debug_level' [R/W] */
212 name = ACPI_SYSTEM_FILE_DEBUG_LEVEL; 205 name = ACPI_SYSTEM_FILE_DEBUG_LEVEL;
213 entry = create_proc_read_entry(name, S_IFREG|S_IRUGO|S_IWUSR, acpi_root_dir, 206 entry =
214 acpi_system_read_debug, (void *)1); 207 create_proc_read_entry(name, S_IFREG | S_IRUGO | S_IWUSR,
215 if (entry) 208 acpi_root_dir, acpi_system_read_debug,
209 (void *)1);
210 if (entry)
216 entry->write_proc = acpi_system_write_debug; 211 entry->write_proc = acpi_system_write_debug;
217 else 212 else
218 goto Error; 213 goto Error;
219 214
220 Done: 215 Done:
221 return_VALUE(error); 216 return_VALUE(error);
222 217
223 Error: 218 Error:
224 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 219 ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
225 "Unable to create '%s' proc fs entry\n", name)); 220 "Unable to create '%s' proc fs entry\n", name));
226 221
227 remove_proc_entry(ACPI_SYSTEM_FILE_DEBUG_LEVEL, acpi_root_dir); 222 remove_proc_entry(ACPI_SYSTEM_FILE_DEBUG_LEVEL, acpi_root_dir);
228 remove_proc_entry(ACPI_SYSTEM_FILE_DEBUG_LAYER, acpi_root_dir); 223 remove_proc_entry(ACPI_SYSTEM_FILE_DEBUG_LAYER, acpi_root_dir);