Skip to content

Commit

Permalink
ACPI: Remove unnecessary from/to-void* and to-void casts in drivers/acpi
Browse files Browse the repository at this point in the history
Signed-off-by: Jan Engelhardt <jengelh@gmx.de>
Signed-off-by: Len Brown <len.brown@intel.com>
  • Loading branch information
Jan Engelhardt authored and lenb committed Oct 14, 2006
1 parent b4bd8c6 commit 50dd096
Show file tree
Hide file tree
Showing 30 changed files with 138 additions and 145 deletions.
6 changes: 3 additions & 3 deletions drivers/acpi/ac.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ static struct proc_dir_entry *acpi_ac_dir;

static int acpi_ac_seq_show(struct seq_file *seq, void *offset)
{
struct acpi_ac *ac = (struct acpi_ac *)seq->private;
struct acpi_ac *ac = seq->private;


if (!ac)
Expand Down Expand Up @@ -187,7 +187,7 @@ static int acpi_ac_remove_fs(struct acpi_device *device)

static void acpi_ac_notify(acpi_handle handle, u32 event, void *data)
{
struct acpi_ac *ac = (struct acpi_ac *)data;
struct acpi_ac *ac = data;
struct acpi_device *device = NULL;


Expand Down Expand Up @@ -269,7 +269,7 @@ static int acpi_ac_remove(struct acpi_device *device, int type)
if (!device || !acpi_driver_data(device))
return -EINVAL;

ac = (struct acpi_ac *)acpi_driver_data(device);
ac = acpi_driver_data(device);

status = acpi_remove_notify_handler(device->handle,
ACPI_ALL_NOTIFY, acpi_ac_notify);
Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/acpi_memhotplug.c
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ static int acpi_memory_device_remove(struct acpi_device *device, int type)
if (!device || !acpi_driver_data(device))
return -EINVAL;

mem_device = (struct acpi_memory_device *)acpi_driver_data(device);
mem_device = acpi_driver_data(device);
kfree(mem_device);

return 0;
Expand Down
7 changes: 3 additions & 4 deletions drivers/acpi/asus_acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1128,7 +1128,7 @@ static int asus_hotk_get_info(void)
if (ACPI_FAILURE(status))
printk(KERN_WARNING " Couldn't get the DSDT table header\n");
else
asus_info = (struct acpi_table_header *)dsdt.pointer;
asus_info = dsdt.pointer;

/* We have to write 0 on init this far for all ASUS models */
if (!write_acpi_int(hotk->handle, "INIT", 0, &buffer)) {
Expand All @@ -1150,7 +1150,7 @@ static int asus_hotk_get_info(void)
* asus_model_match() and try something completely different.
*/
if (buffer.pointer) {
model = (union acpi_object *)buffer.pointer;
model = buffer.pointer;
switch (model->type) {
case ACPI_TYPE_STRING:
string = model->string.pointer;
Expand Down Expand Up @@ -1245,8 +1245,7 @@ static int asus_hotk_add(struct acpi_device *device)
printk(KERN_NOTICE "Asus Laptop ACPI Extras version %s\n",
ASUS_ACPI_VERSION);

hotk =
(struct asus_hotk *)kmalloc(sizeof(struct asus_hotk), GFP_KERNEL);
hotk = kmalloc(sizeof(struct asus_hotk), GFP_KERNEL);
if (!hotk)
return -ENOMEM;
memset(hotk, 0, sizeof(struct asus_hotk));
Expand Down
22 changes: 11 additions & 11 deletions drivers/acpi/battery.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ acpi_battery_get_info(struct acpi_battery *battery,
return -ENODEV;
}

package = (union acpi_object *)buffer.pointer;
package = buffer.pointer;

/* Extract Package Data */

Expand Down Expand Up @@ -177,7 +177,7 @@ acpi_battery_get_info(struct acpi_battery *battery,
kfree(buffer.pointer);

if (!result)
(*bif) = (struct acpi_battery_info *)data.pointer;
(*bif) = data.pointer;

return result;
}
Expand Down Expand Up @@ -207,7 +207,7 @@ acpi_battery_get_status(struct acpi_battery *battery,
return -ENODEV;
}

package = (union acpi_object *)buffer.pointer;
package = buffer.pointer;

/* Extract Package Data */

Expand Down Expand Up @@ -237,7 +237,7 @@ acpi_battery_get_status(struct acpi_battery *battery,
kfree(buffer.pointer);

if (!result)
(*bst) = (struct acpi_battery_status *)data.pointer;
(*bst) = data.pointer;

return result;
}
Expand Down Expand Up @@ -332,7 +332,7 @@ static struct proc_dir_entry *acpi_battery_dir;
static int acpi_battery_read_info(struct seq_file *seq, void *offset)
{
int result = 0;
struct acpi_battery *battery = (struct acpi_battery *)seq->private;
struct acpi_battery *battery = seq->private;
struct acpi_battery_info *bif = NULL;
char *units = "?";

Expand Down Expand Up @@ -416,7 +416,7 @@ static int acpi_battery_info_open_fs(struct inode *inode, struct file *file)
static int acpi_battery_read_state(struct seq_file *seq, void *offset)
{
int result = 0;
struct acpi_battery *battery = (struct acpi_battery *)seq->private;
struct acpi_battery *battery = seq->private;
struct acpi_battery_status *bst = NULL;
char *units = "?";

Expand Down Expand Up @@ -492,7 +492,7 @@ static int acpi_battery_state_open_fs(struct inode *inode, struct file *file)

static int acpi_battery_read_alarm(struct seq_file *seq, void *offset)
{
struct acpi_battery *battery = (struct acpi_battery *)seq->private;
struct acpi_battery *battery = seq->private;
char *units = "?";


Expand Down Expand Up @@ -529,8 +529,8 @@ acpi_battery_write_alarm(struct file *file,
{
int result = 0;
char alarm_string[12] = { '\0' };
struct seq_file *m = (struct seq_file *)file->private_data;
struct acpi_battery *battery = (struct acpi_battery *)m->private;
struct seq_file *m = file->private_data;
struct acpi_battery *battery = m->private;


if (!battery || (count > sizeof(alarm_string) - 1))
Expand Down Expand Up @@ -656,7 +656,7 @@ static int acpi_battery_remove_fs(struct acpi_device *device)

static void acpi_battery_notify(acpi_handle handle, u32 event, void *data)
{
struct acpi_battery *battery = (struct acpi_battery *)data;
struct acpi_battery *battery = data;
struct acpi_device *device = NULL;


Expand Down Expand Up @@ -740,7 +740,7 @@ static int acpi_battery_remove(struct acpi_device *device, int type)
if (!device || !acpi_driver_data(device))
return -EINVAL;

battery = (struct acpi_battery *)acpi_driver_data(device);
battery = acpi_driver_data(device);

status = acpi_remove_notify_handler(device->handle,
ACPI_ALL_NOTIFY,
Expand Down
8 changes: 4 additions & 4 deletions drivers/acpi/button.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ static struct proc_dir_entry *acpi_button_dir;

static int acpi_button_info_seq_show(struct seq_file *seq, void *offset)
{
struct acpi_button *button = (struct acpi_button *)seq->private;
struct acpi_button *button = seq->private;


if (!button || !button->device)
Expand All @@ -128,7 +128,7 @@ static int acpi_button_info_open_fs(struct inode *inode, struct file *file)

static int acpi_button_state_seq_show(struct seq_file *seq, void *offset)
{
struct acpi_button *button = (struct acpi_button *)seq->private;
struct acpi_button *button = seq->private;
acpi_status status;
unsigned long state;

Expand Down Expand Up @@ -253,7 +253,7 @@ static int acpi_button_remove_fs(struct acpi_device *device)

static void acpi_button_notify(acpi_handle handle, u32 event, void *data)
{
struct acpi_button *button = (struct acpi_button *)data;
struct acpi_button *button = data;


if (!button || !button->device)
Expand All @@ -275,7 +275,7 @@ static void acpi_button_notify(acpi_handle handle, u32 event, void *data)

static acpi_status acpi_button_notify_fixed(void *data)
{
struct acpi_button *button = (struct acpi_button *)data;
struct acpi_button *button = data;


if (!button)
Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/container.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ static int acpi_container_remove(struct acpi_device *device, int type)
acpi_status status = AE_OK;
struct acpi_container *pc = NULL;

pc = (struct acpi_container *)acpi_driver_data(device);
pc = acpi_driver_data(device);
kfree(pc);
return status;
}
Expand Down
6 changes: 3 additions & 3 deletions drivers/acpi/dock.c
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ EXPORT_SYMBOL_GPL(unregister_hotplug_dock_device);
*/
static void dock_notify(acpi_handle handle, u32 event, void *data)
{
struct dock_station *ds = (struct dock_station *)data;
struct dock_station *ds = data;

switch (event) {
case ACPI_NOTIFY_BUS_CHECK:
Expand Down Expand Up @@ -587,7 +587,7 @@ find_dock_devices(acpi_handle handle, u32 lvl, void *context, void **rv)
{
acpi_status status;
acpi_handle tmp;
struct dock_station *ds = (struct dock_station *)context;
struct dock_station *ds = context;
struct dock_dependent_device *dd;

status = acpi_bus_get_ejd(handle, &tmp);
Expand Down Expand Up @@ -702,7 +702,7 @@ static int dock_remove(void)
static acpi_status
find_dock(acpi_handle handle, u32 lvl, void *context, void **rv)
{
int *count = (int *)context;
int *count = context;
acpi_status status = AE_OK;

if (is_dock(handle)) {
Expand Down
12 changes: 6 additions & 6 deletions drivers/acpi/ec.c
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,7 @@ static void acpi_ec_gpe_poll_query(void *ec_cxt)
}
static void acpi_ec_gpe_intr_query(void *ec_cxt)
{
union acpi_ec *ec = (union acpi_ec *)ec_cxt;
union acpi_ec *ec = ec_cxt;
u32 value;
int result = -ENODATA;
static char object_name[5] = { '_', 'Q', '0', '0', '\0' };
Expand Down Expand Up @@ -752,7 +752,7 @@ static u32 acpi_ec_gpe_handler(void *data)
static u32 acpi_ec_gpe_poll_handler(void *data)
{
acpi_status status = AE_OK;
union acpi_ec *ec = (union acpi_ec *)data;
union acpi_ec *ec = data;

if (!ec)
return ACPI_INTERRUPT_NOT_HANDLED;
Expand All @@ -770,7 +770,7 @@ static u32 acpi_ec_gpe_intr_handler(void *data)
{
acpi_status status = AE_OK;
u32 value;
union acpi_ec *ec = (union acpi_ec *)data;
union acpi_ec *ec = data;

if (!ec)
return ACPI_INTERRUPT_NOT_HANDLED;
Expand Down Expand Up @@ -848,7 +848,7 @@ acpi_ec_space_handler(u32 function,
return AE_BAD_PARAMETER;
}

ec = (union acpi_ec *)handler_context;
ec = handler_context;

next_byte:
switch (function) {
Expand Down Expand Up @@ -905,7 +905,7 @@ static struct proc_dir_entry *acpi_ec_dir;

static int acpi_ec_read_info(struct seq_file *seq, void *offset)
{
union acpi_ec *ec = (union acpi_ec *)seq->private;
union acpi_ec *ec = seq->private;


if (!ec)
Expand Down Expand Up @@ -1136,7 +1136,7 @@ static int acpi_ec_remove(struct acpi_device *device, int type)
static acpi_status
acpi_ec_io_ports(struct acpi_resource *resource, void *context)
{
union acpi_ec *ec = (union acpi_ec *)context;
union acpi_ec *ec = context;
struct acpi_generic_address *addr;

if (resource->type != ACPI_RESOURCE_TYPE_IO) {
Expand Down
6 changes: 3 additions & 3 deletions drivers/acpi/fan.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ acpi_fan_write_state(struct file *file, const char __user * buffer,
size_t count, loff_t * ppos)
{
int result = 0;
struct seq_file *m = (struct seq_file *)file->private_data;
struct acpi_fan *fan = (struct acpi_fan *)m->private;
struct seq_file *m = file->private_data;
struct acpi_fan *fan = m->private;
char state_string[12] = { '\0' };


Expand Down Expand Up @@ -229,7 +229,7 @@ static int acpi_fan_remove(struct acpi_device *device, int type)
if (!device || !acpi_driver_data(device))
return -EINVAL;

fan = (struct acpi_fan *)acpi_driver_data(device);
fan = acpi_driver_data(device);

acpi_fan_remove_fs(device);

Expand Down
4 changes: 2 additions & 2 deletions drivers/acpi/glue.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ struct acpi_find_pci_root {
static acpi_status
do_root_bridge_busnr_callback(struct acpi_resource *resource, void *data)
{
unsigned long *busnr = (unsigned long *)data;
unsigned long *busnr = data;
struct acpi_resource_address64 address;

if (resource->type != ACPI_RESOURCE_TYPE_ADDRESS16 &&
Expand Down Expand Up @@ -217,7 +217,7 @@ do_acpi_find_child(acpi_handle handle, u32 lvl, void *context, void **rv)
acpi_status status;
struct acpi_device_info *info;
struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
struct acpi_find_child *find = (struct acpi_find_child *)context;
struct acpi_find_child *find = context;

status = acpi_get_object_info(handle, &buffer);
if (ACPI_SUCCESS(status)) {
Expand Down
5 changes: 2 additions & 3 deletions drivers/acpi/hotkey.c
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,7 @@ static char *format_result(union acpi_object *object)

static int hotkey_polling_seq_show(struct seq_file *seq, void *offset)
{
struct acpi_polling_hotkey *poll_hotkey =
(struct acpi_polling_hotkey *)seq->private;
struct acpi_polling_hotkey *poll_hotkey = seq->private;
char *buf;


Expand Down Expand Up @@ -577,7 +576,7 @@ init_poll_hotkey_device(union acpi_hotkey *key, char **config_entry,
if (ACPI_FAILURE(status))
goto do_fail_zero;
key->poll_hotkey.poll_result =
(union acpi_object *)kmalloc(sizeof(union acpi_object), GFP_KERNEL);
kmalloc(sizeof(union acpi_object), GFP_KERNEL);
if (!key->poll_hotkey.poll_result)
goto do_fail_zero;
return AE_OK;
Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/i2c_ec.c
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ static void __exit acpi_ec_hc_exit(void)

struct acpi_ec_hc *acpi_get_ec_hc(struct acpi_device *device)
{
return ((struct acpi_ec_hc *)acpi_driver_data(device->parent));
return acpi_driver_data(device->parent);
}

EXPORT_SYMBOL(acpi_get_ec_hc);
Expand Down
6 changes: 3 additions & 3 deletions drivers/acpi/ibm_acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1721,7 +1721,7 @@ static struct ibm_struct ibms[] = {
static int dispatch_read(char *page, char **start, off_t off, int count,
int *eof, void *data)
{
struct ibm_struct *ibm = (struct ibm_struct *)data;
struct ibm_struct *ibm = data;
int len;

if (!ibm || !ibm->read)
Expand All @@ -1746,7 +1746,7 @@ static int dispatch_read(char *page, char **start, off_t off, int count,
static int dispatch_write(struct file *file, const char __user * userbuf,
unsigned long count, void *data)
{
struct ibm_struct *ibm = (struct ibm_struct *)data;
struct ibm_struct *ibm = data;
char *kernbuf;
int ret;

Expand Down Expand Up @@ -1775,7 +1775,7 @@ static int dispatch_write(struct file *file, const char __user * userbuf,

static void dispatch_notify(acpi_handle handle, u32 event, void *data)
{
struct ibm_struct *ibm = (struct ibm_struct *)data;
struct ibm_struct *ibm = data;

if (!ibm || !ibm->notify)
return;
Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/numa.c
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ int acpi_get_pxm(acpi_handle h)
handle = phandle;
status = acpi_evaluate_integer(handle, "_PXM", NULL, &pxm);
if (ACPI_SUCCESS(status))
return (int)pxm;
return pxm;
status = acpi_get_parent(handle, &phandle);
} while (ACPI_SUCCESS(status));
return -1;
Expand Down
Loading

0 comments on commit 50dd096

Please sign in to comment.