diff options
author | Henrique de Moraes Holschuh <hmh@hmh.eng.br> | 2007-04-21 10:08:36 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2007-04-21 23:30:34 -0400 |
commit | d8fd94d9f08237ffda7e44e6825b057bf20a90e3 (patch) | |
tree | 0c0a818fd36aaa8ea708e64ac4db727df95724e3 /drivers/misc/thinkpad_acpi.h | |
parent | 926411779287ad4f7013c9d80aa44fd131b70cd9 (diff) |
ACPI: thinkpad-acpi: use bitfields for module flags
Use a bitfield to hold boolean module-wide flags, to conserve some memory.
It is easy and it is clean, so we do it just for the heck of it even if it
saves very little space.
Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/misc/thinkpad_acpi.h')
-rw-r--r-- | drivers/misc/thinkpad_acpi.h | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/drivers/misc/thinkpad_acpi.h b/drivers/misc/thinkpad_acpi.h index 8b72061d8f0e..4d3ab4015ff2 100644 --- a/drivers/misc/thinkpad_acpi.h +++ b/drivers/misc/thinkpad_acpi.h | |||
@@ -173,6 +173,22 @@ struct ibm_init_struct { | |||
173 | struct ibm_struct *data; | 173 | struct ibm_struct *data; |
174 | }; | 174 | }; |
175 | 175 | ||
176 | static struct { | ||
177 | #ifdef CONFIG_THINKPAD_ACPI_BAY | ||
178 | u16 bay_status:1; | ||
179 | u16 bay_eject:1; | ||
180 | u16 bay_status2:1; | ||
181 | u16 bay_eject2:1; | ||
182 | #endif | ||
183 | u16 bluetooth:1; | ||
184 | u16 hotkey:1; | ||
185 | u16 hotkey_mask:1; | ||
186 | u16 light:1; | ||
187 | u16 light_status:1; | ||
188 | u16 wan:1; | ||
189 | u16 fan_ctrl_status_undef:1; | ||
190 | } tp_features; | ||
191 | |||
176 | static struct list_head tpacpi_all_drivers; | 192 | static struct list_head tpacpi_all_drivers; |
177 | 193 | ||
178 | static struct ibm_init_struct ibms_init[]; | 194 | static struct ibm_init_struct ibms_init[]; |
@@ -193,9 +209,6 @@ static int thinkpad_acpi_driver_read(char *p); | |||
193 | */ | 209 | */ |
194 | 210 | ||
195 | #ifdef CONFIG_THINKPAD_ACPI_BAY | 211 | #ifdef CONFIG_THINKPAD_ACPI_BAY |
196 | static int bay_status_supported, bay_eject_supported; | ||
197 | static int bay_status2_supported, bay_eject2_supported; | ||
198 | |||
199 | static acpi_handle bay_handle, bay_ej_handle; | 212 | static acpi_handle bay_handle, bay_ej_handle; |
200 | static acpi_handle bay2_handle, bay2_ej_handle; | 213 | static acpi_handle bay2_handle, bay2_ej_handle; |
201 | 214 | ||
@@ -220,8 +233,6 @@ static int beep_write(char *buf); | |||
220 | * Bluetooth subdriver | 233 | * Bluetooth subdriver |
221 | */ | 234 | */ |
222 | 235 | ||
223 | static int bluetooth_supported; | ||
224 | |||
225 | static int bluetooth_init(struct ibm_init_struct *iibm); | 236 | static int bluetooth_init(struct ibm_init_struct *iibm); |
226 | static int bluetooth_status(void); | 237 | static int bluetooth_status(void); |
227 | static int bluetooth_read(char *p); | 238 | static int bluetooth_read(char *p); |
@@ -311,7 +322,6 @@ enum fan_control_commands { | |||
311 | static enum fan_status_access_mode fan_status_access_mode; | 322 | static enum fan_status_access_mode fan_status_access_mode; |
312 | static enum fan_control_access_mode fan_control_access_mode; | 323 | static enum fan_control_access_mode fan_control_access_mode; |
313 | static enum fan_control_commands fan_control_commands; | 324 | static enum fan_control_commands fan_control_commands; |
314 | static int fan_control_status_known; | ||
315 | static u8 fan_control_initial_status; | 325 | static u8 fan_control_initial_status; |
316 | static int fan_watchdog_maxinterval; | 326 | static int fan_watchdog_maxinterval; |
317 | 327 | ||
@@ -340,8 +350,6 @@ static int fan_write_cmd_watchdog(const char *cmd, int *rc); | |||
340 | * Hotkey subdriver | 350 | * Hotkey subdriver |
341 | */ | 351 | */ |
342 | 352 | ||
343 | static int hotkey_supported; | ||
344 | static int hotkey_mask_supported; | ||
345 | static int hotkey_orig_status; | 353 | static int hotkey_orig_status; |
346 | static int hotkey_orig_mask; | 354 | static int hotkey_orig_mask; |
347 | 355 | ||
@@ -382,8 +390,6 @@ static int led_write(char *buf); | |||
382 | * Light (thinklight) subdriver | 390 | * Light (thinklight) subdriver |
383 | */ | 391 | */ |
384 | 392 | ||
385 | static int light_supported; | ||
386 | static int light_status_supported; | ||
387 | static acpi_handle lght_handle, ledb_handle; | 393 | static acpi_handle lght_handle, ledb_handle; |
388 | 394 | ||
389 | static int light_init(struct ibm_init_struct *iibm); | 395 | static int light_init(struct ibm_init_struct *iibm); |
@@ -453,8 +459,6 @@ static int volume_write(char *buf); | |||
453 | * Wan subdriver | 459 | * Wan subdriver |
454 | */ | 460 | */ |
455 | 461 | ||
456 | static int wan_supported; | ||
457 | |||
458 | static int wan_init(struct ibm_init_struct *iibm); | 462 | static int wan_init(struct ibm_init_struct *iibm); |
459 | static int wan_status(void); | 463 | static int wan_status(void); |
460 | static int wan_read(char *p); | 464 | static int wan_read(char *p); |