···1146 if (ACPI_FAILURE(status))1147 printk(KERN_WARNING " Couldn't get the DSDT table header\n");1148 else1149- asus_info = (struct acpi_table_header *)dsdt.pointer;11501151 /* We have to write 0 on init this far for all ASUS models */1152 if (!write_acpi_int(hotk->handle, "INIT", 0, &buffer)) {···1168 * asus_model_match() and try something completely different.1169 */1170 if (buffer.pointer) {1171- model = (union acpi_object *)buffer.pointer;1172 switch (model->type) {1173 case ACPI_TYPE_STRING:1174 string = model->string.pointer;···1264 printk(KERN_NOTICE "Asus Laptop ACPI Extras version %s\n",1265 ASUS_ACPI_VERSION);12661267- hotk =1268- (struct asus_hotk *)kmalloc(sizeof(struct asus_hotk), GFP_KERNEL);1269 if (!hotk)1270 return -ENOMEM;1271 memset(hotk, 0, sizeof(struct asus_hotk));
···1146 if (ACPI_FAILURE(status))1147 printk(KERN_WARNING " Couldn't get the DSDT table header\n");1148 else1149+ asus_info = dsdt.pointer;11501151 /* We have to write 0 on init this far for all ASUS models */1152 if (!write_acpi_int(hotk->handle, "INIT", 0, &buffer)) {···1168 * asus_model_match() and try something completely different.1169 */1170 if (buffer.pointer) {1171+ model = buffer.pointer;1172 switch (model->type) {1173 case ACPI_TYPE_STRING:1174 string = model->string.pointer;···1264 printk(KERN_NOTICE "Asus Laptop ACPI Extras version %s\n",1265 ASUS_ACPI_VERSION);12661267+ hotk = kmalloc(sizeof(struct asus_hotk), GFP_KERNEL);01268 if (!hotk)1269 return -ENOMEM;1270 memset(hotk, 0, sizeof(struct asus_hotk));
···673 return -ENODEV;674 }675676- cst = (union acpi_object *)buffer.pointer;677678 /* There must be at least 2 elements */679 if (!cst || (cst->type != ACPI_TYPE_PACKAGE) || cst->package.count < 2) {···702703 memset(&cx, 0, sizeof(cx));704705- element = (union acpi_object *)&(cst->package.elements[i]);706 if (element->type != ACPI_TYPE_PACKAGE)707 continue;708709 if (element->package.count != 4)710 continue;711712- obj = (union acpi_object *)&(element->package.elements[0]);713714 if (obj->type != ACPI_TYPE_BUFFER)715 continue;···721 continue;722723 /* There should be an easy way to extract an integer... */724- obj = (union acpi_object *)&(element->package.elements[1]);725 if (obj->type != ACPI_TYPE_INTEGER)726 continue;727···754 }755 }756757- obj = (union acpi_object *)&(element->package.elements[2]);758 if (obj->type != ACPI_TYPE_INTEGER)759 continue;760761 cx.latency = obj->integer.value;762763- obj = (union acpi_object *)&(element->package.elements[3]);764 if (obj->type != ACPI_TYPE_INTEGER)765 continue;766···10291030static int acpi_processor_power_seq_show(struct seq_file *seq, void *offset)1031{1032- struct acpi_processor *pr = (struct acpi_processor *)seq->private;1033 unsigned int i;10341035
···673 return -ENODEV;674 }675676+ cst = buffer.pointer;677678 /* There must be at least 2 elements */679 if (!cst || (cst->type != ACPI_TYPE_PACKAGE) || cst->package.count < 2) {···702703 memset(&cx, 0, sizeof(cx));704705+ element = &(cst->package.elements[i]);706 if (element->type != ACPI_TYPE_PACKAGE)707 continue;708709 if (element->package.count != 4)710 continue;711712+ obj = &(element->package.elements[0]);713714 if (obj->type != ACPI_TYPE_BUFFER)715 continue;···721 continue;722723 /* There should be an easy way to extract an integer... */724+ obj = &(element->package.elements[1]);725 if (obj->type != ACPI_TYPE_INTEGER)726 continue;727···754 }755 }756757+ obj = &(element->package.elements[2]);758 if (obj->type != ACPI_TYPE_INTEGER)759 continue;760761 cx.latency = obj->integer.value;762763+ obj = &(element->package.elements[3]);764 if (obj->type != ACPI_TYPE_INTEGER)765 continue;766···10291030static int acpi_processor_power_seq_show(struct seq_file *seq, void *offset)1031{1032+ struct acpi_processor *pr = seq->private;1033 unsigned int i;10341035
···236 return -ENODEV;237 }238239+ pss = buffer.pointer;240 if (!pss || (pss->type != ACPI_TYPE_PACKAGE)) {241 printk(KERN_ERR PREFIX "Invalid _PSS data\n");242 result = -EFAULT;···410411static int acpi_processor_perf_seq_show(struct seq_file *seq, void *offset)412{413+ struct acpi_processor *pr = seq->private;414 int i;415416···451 size_t count, loff_t * data)452{453 int result = 0;454+ struct seq_file *m = file->private_data;455+ struct acpi_processor *pr = m->private;456 struct acpi_processor_performance *perf;457 char state_string[12] = { '\0' };458 unsigned int new_state = 0;···551 return -ENODEV;552 }553554+ psd = buffer.pointer;555 if (!psd || (psd->type != ACPI_TYPE_PACKAGE)) {556 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid _PSD data\n"));557 result = -EFAULT;
+3-3
drivers/acpi/processor_thermal.c
···208 if (result)209 return result;210211- pr = (struct acpi_processor *)acpi_driver_data(device);212 if (!pr)213 return -ENODEV;214···348 size_t count, loff_t * data)349{350 int result = 0;351- struct seq_file *m = (struct seq_file *)file->private_data;352- struct acpi_processor *pr = (struct acpi_processor *)m->private;353 char limit_string[25] = { '\0' };354 int px = 0;355 int tx = 0;
···208 if (result)209 return result;210211+ pr = acpi_driver_data(device);212 if (!pr)213 return -ENODEV;214···348 size_t count, loff_t * data)349{350 int result = 0;351+ struct seq_file *m = file->private_data;352+ struct acpi_processor *pr = m->private;353 char limit_string[25] = { '\0' };354 int px = 0;355 int tx = 0;
+3-3
drivers/acpi/processor_throttling.c
···259static int acpi_processor_throttling_seq_show(struct seq_file *seq,260 void *offset)261{262- struct acpi_processor *pr = (struct acpi_processor *)seq->private;263 int i = 0;264 int result = 0;265···307 size_t count, loff_t * data)308{309 int result = 0;310- struct seq_file *m = (struct seq_file *)file->private_data;311- struct acpi_processor *pr = (struct acpi_processor *)m->private;312 char state_string[12] = { '\0' };313314
···259static int acpi_processor_throttling_seq_show(struct seq_file *seq,260 void *offset)261{262+ struct acpi_processor *pr = seq->private;263 int i = 0;264 int result = 0;265···307 size_t count, loff_t * data)308{309 int result = 0;310+ struct seq_file *m = file->private_data;311+ struct acpi_processor *pr = m->private;312 char state_string[12] = { '\0' };313314
+12-12
drivers/acpi/sbs.c
···923924static int acpi_battery_read_info(struct seq_file *seq, void *offset)925{926- struct acpi_battery *battery = (struct acpi_battery *)seq->private;927 int cscale;928 int result = 0;929···10761077static int acpi_battery_read_alarm(struct seq_file *seq, void *offset)1078{1079- struct acpi_battery *battery = (struct acpi_battery *)seq->private;1080 int result = 0;1081 int cscale;1082···1125acpi_battery_write_alarm(struct file *file, const char __user * buffer,1126 size_t count, loff_t * ppos)1127{1128- struct seq_file *seq = (struct seq_file *)file->private_data;1129- struct acpi_battery *battery = (struct acpi_battery *)seq->private;1130 char alarm_string[12] = { '\0' };1131 int result, old_alarm, new_alarm;1132···1160 if (result) {1161 ACPI_DEBUG_PRINT((ACPI_DB_ERROR,1162 "acpi_battery_set_alarm() failed\n"));1163- (void)acpi_battery_set_alarm(battery, old_alarm);1164 goto end;1165 }1166 result = acpi_battery_get_alarm(battery);1167 if (result) {1168 ACPI_DEBUG_PRINT((ACPI_DB_ERROR,1169 "acpi_battery_get_alarm() failed\n"));1170- (void)acpi_battery_set_alarm(battery, old_alarm);1171 goto end;1172 }1173···12171218static int acpi_ac_read_state(struct seq_file *seq, void *offset)1219{1220- struct acpi_sbs *sbs = (struct acpi_sbs *)seq->private;1221 int result;12221223 if (sbs->zombie) {···1302 battery->init_state = 1;1303 }13041305- (void)sprintf(dir_name, ACPI_BATTERY_DIR_NAME, id);13061307 result = acpi_sbs_generic_add_fs(&battery->battery_entry,1308 acpi_battery_dir,···1485 }14861487 if (old_battery_present != new_battery_present) {1488- (void)sprintf(dir_name, ACPI_BATTERY_DIR_NAME, id);1489 result = acpi_sbs_generate_event(sbs->device,1490 ACPI_SBS_BATTERY_NOTIFY_STATUS,1491 new_battery_present,···1498 }1499 }1500 if (old_remaining_capacity != battery->state.remaining_capacity) {1501- (void)sprintf(dir_name, ACPI_BATTERY_DIR_NAME, id);1502 result = acpi_sbs_generate_event(sbs->device,1503 ACPI_SBS_BATTERY_NOTIFY_STATUS,1504 new_battery_present,···1659 init_timer(&sbs->update_timer);1660 if (update_mode == QUEUE_UPDATE_MODE) {1661 status = acpi_os_execute(OSL_GPE_HANDLER,1662- acpi_sbs_update_queue, (void *)sbs);1663 if (status != AE_OK) {1664 ACPI_DEBUG_PRINT((ACPI_DB_ERROR,1665 "acpi_os_execute() failed\n"));···16851686int acpi_sbs_remove(struct acpi_device *device, int type)1687{1688- struct acpi_sbs *sbs = NULL;1689 int id;16901691 if (!device) {
···923924static int acpi_battery_read_info(struct seq_file *seq, void *offset)925{926+ struct acpi_battery *battery = seq->private;927 int cscale;928 int result = 0;929···10761077static int acpi_battery_read_alarm(struct seq_file *seq, void *offset)1078{1079+ struct acpi_battery *battery = seq->private;1080 int result = 0;1081 int cscale;1082···1125acpi_battery_write_alarm(struct file *file, const char __user * buffer,1126 size_t count, loff_t * ppos)1127{1128+ struct seq_file *seq = file->private_data;1129+ struct acpi_battery *battery = seq->private;1130 char alarm_string[12] = { '\0' };1131 int result, old_alarm, new_alarm;1132···1160 if (result) {1161 ACPI_DEBUG_PRINT((ACPI_DB_ERROR,1162 "acpi_battery_set_alarm() failed\n"));1163+ acpi_battery_set_alarm(battery, old_alarm);1164 goto end;1165 }1166 result = acpi_battery_get_alarm(battery);1167 if (result) {1168 ACPI_DEBUG_PRINT((ACPI_DB_ERROR,1169 "acpi_battery_get_alarm() failed\n"));1170+ acpi_battery_set_alarm(battery, old_alarm);1171 goto end;1172 }1173···12171218static int acpi_ac_read_state(struct seq_file *seq, void *offset)1219{1220+ struct acpi_sbs *sbs = seq->private;1221 int result;12221223 if (sbs->zombie) {···1302 battery->init_state = 1;1303 }13041305+ sprintf(dir_name, ACPI_BATTERY_DIR_NAME, id);13061307 result = acpi_sbs_generic_add_fs(&battery->battery_entry,1308 acpi_battery_dir,···1485 }14861487 if (old_battery_present != new_battery_present) {1488+ sprintf(dir_name, ACPI_BATTERY_DIR_NAME, id);1489 result = acpi_sbs_generate_event(sbs->device,1490 ACPI_SBS_BATTERY_NOTIFY_STATUS,1491 new_battery_present,···1498 }1499 }1500 if (old_remaining_capacity != battery->state.remaining_capacity) {1501+ sprintf(dir_name, ACPI_BATTERY_DIR_NAME, id);1502 result = acpi_sbs_generate_event(sbs->device,1503 ACPI_SBS_BATTERY_NOTIFY_STATUS,1504 new_battery_present,···1659 init_timer(&sbs->update_timer);1660 if (update_mode == QUEUE_UPDATE_MODE) {1661 status = acpi_os_execute(OSL_GPE_HANDLER,1662+ acpi_sbs_update_queue, sbs);1663 if (status != AE_OK) {1664 ACPI_DEBUG_PRINT((ACPI_DB_ERROR,1665 "acpi_os_execute() failed\n"));···16851686int acpi_sbs_remove(struct acpi_device *device, int type)1687{1688+ struct acpi_sbs *sbs;1689 int id;16901691 if (!device) {
+1-1
drivers/acpi/tables.c
···228static int229acpi_table_compute_checksum(void *table_pointer, unsigned long length)230{231- u8 *p = (u8 *) table_pointer;232 unsigned long remains = length;233 unsigned long sum = 0;234
···228static int229acpi_table_compute_checksum(void *table_pointer, unsigned long length)230{231+ u8 *p = table_pointer;232 unsigned long remains = length;233 unsigned long sum = 0;234
+15-15
drivers/acpi/thermal.c
···663static void acpi_thermal_check(void *data)664{665 int result = 0;666- struct acpi_thermal *tz = (struct acpi_thermal *)data;667 unsigned long sleep_time = 0;668 int i = 0;669 struct acpi_thermal_state state;···778779static int acpi_thermal_state_seq_show(struct seq_file *seq, void *offset)780{781- struct acpi_thermal *tz = (struct acpi_thermal *)seq->private;782783784 if (!tz)···813static int acpi_thermal_temp_seq_show(struct seq_file *seq, void *offset)814{815 int result = 0;816- struct acpi_thermal *tz = (struct acpi_thermal *)seq->private;817818819 if (!tz)···837838static int acpi_thermal_trip_seq_show(struct seq_file *seq, void *offset)839{840- struct acpi_thermal *tz = (struct acpi_thermal *)seq->private;841 int i = 0;842 int j = 0;843···893 const char __user * buffer,894 size_t count, loff_t * ppos)895{896- struct seq_file *m = (struct seq_file *)file->private_data;897- struct acpi_thermal *tz = (struct acpi_thermal *)m->private;898899 char *limit_string;900 int num, critical, hot, passive;···953954static int acpi_thermal_cooling_seq_show(struct seq_file *seq, void *offset)955{956- struct acpi_thermal *tz = (struct acpi_thermal *)seq->private;957958959 if (!tz)···984 const char __user * buffer,985 size_t count, loff_t * ppos)986{987- struct seq_file *m = (struct seq_file *)file->private_data;988- struct acpi_thermal *tz = (struct acpi_thermal *)m->private;989 int result = 0;990 char mode_string[12] = { '\0' };991···10141015static int acpi_thermal_polling_seq_show(struct seq_file *seq, void *offset)1016{1017- struct acpi_thermal *tz = (struct acpi_thermal *)seq->private;101810191020 if (!tz)···1043 const char __user * buffer,1044 size_t count, loff_t * ppos)1045{1046- struct seq_file *m = (struct seq_file *)file->private_data;1047- struct acpi_thermal *tz = (struct acpi_thermal *)m->private;1048 int result = 0;1049 char polling_string[12] = { '\0' };1050 int seconds = 0;···11701171static void acpi_thermal_notify(acpi_handle handle, u32 event, void *data)1172{1173- struct acpi_thermal *tz = (struct acpi_thermal *)data;1174 struct acpi_device *device = NULL;11751176···1324 if (!device || !acpi_driver_data(device))1325 return -EINVAL;13261327- tz = (struct acpi_thermal *)acpi_driver_data(device);13281329 /* avoid timer adding new defer task */1330 tz->zombie = 1;···1364 if (!device || !acpi_driver_data(device))1365 return -EINVAL;13661367- tz = (struct acpi_thermal *)acpi_driver_data(device);13681369 acpi_thermal_get_temperature(tz);1370
···663static void acpi_thermal_check(void *data)664{665 int result = 0;666+ struct acpi_thermal *tz = data;667 unsigned long sleep_time = 0;668 int i = 0;669 struct acpi_thermal_state state;···778779static int acpi_thermal_state_seq_show(struct seq_file *seq, void *offset)780{781+ struct acpi_thermal *tz = seq->private;782783784 if (!tz)···813static int acpi_thermal_temp_seq_show(struct seq_file *seq, void *offset)814{815 int result = 0;816+ struct acpi_thermal *tz = seq->private;817818819 if (!tz)···837838static int acpi_thermal_trip_seq_show(struct seq_file *seq, void *offset)839{840+ struct acpi_thermal *tz = seq->private;841 int i = 0;842 int j = 0;843···893 const char __user * buffer,894 size_t count, loff_t * ppos)895{896+ struct seq_file *m = file->private_data;897+ struct acpi_thermal *tz = m->private;898899 char *limit_string;900 int num, critical, hot, passive;···953954static int acpi_thermal_cooling_seq_show(struct seq_file *seq, void *offset)955{956+ struct acpi_thermal *tz = seq->private;957958959 if (!tz)···984 const char __user * buffer,985 size_t count, loff_t * ppos)986{987+ struct seq_file *m = file->private_data;988+ struct acpi_thermal *tz = m->private;989 int result = 0;990 char mode_string[12] = { '\0' };991···10141015static int acpi_thermal_polling_seq_show(struct seq_file *seq, void *offset)1016{1017+ struct acpi_thermal *tz = seq->private;101810191020 if (!tz)···1043 const char __user * buffer,1044 size_t count, loff_t * ppos)1045{1046+ struct seq_file *m = file->private_data;1047+ struct acpi_thermal *tz = m->private;1048 int result = 0;1049 char polling_string[12] = { '\0' };1050 int seconds = 0;···11701171static void acpi_thermal_notify(acpi_handle handle, u32 event, void *data)1172{1173+ struct acpi_thermal *tz = data;1174 struct acpi_device *device = NULL;11751176···1324 if (!device || !acpi_driver_data(device))1325 return -EINVAL;13261327+ tz = acpi_driver_data(device);13281329 /* avoid timer adding new defer task */1330 tz->zombie = 1;···1364 if (!device || !acpi_driver_data(device))1365 return -EINVAL;13661367+ tz = acpi_driver_data(device);13681369 acpi_thermal_get_temperature(tz);1370