Commit 43aacf83 authored by Barnabás Pőcze's avatar Barnabás Pőcze Committed by Hans de Goede

platform/x86: wmi: remove unnecessary initializations

Some pointers are initialized when they are defined,
but they are almost immediately reassigned in the
following lines. Remove these superfluous assignments.
Signed-off-by: default avatarBarnabás Pőcze <pobrn@protonmail.com>
Link: https://lore.kernel.org/r/20210904175450.156801-6-pobrn@protonmail.comReviewed-by: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
parent 9bf9ca95
...@@ -177,7 +177,7 @@ static int get_subobj_info(acpi_handle handle, const char *pathname, ...@@ -177,7 +177,7 @@ static int get_subobj_info(acpi_handle handle, const char *pathname,
static acpi_status wmi_method_enable(struct wmi_block *wblock, int enable) static acpi_status wmi_method_enable(struct wmi_block *wblock, int enable)
{ {
struct guid_block *block = NULL; struct guid_block *block;
char method[5]; char method[5];
acpi_status status; acpi_status status;
acpi_handle handle; acpi_handle handle;
...@@ -251,8 +251,8 @@ EXPORT_SYMBOL_GPL(wmi_evaluate_method); ...@@ -251,8 +251,8 @@ EXPORT_SYMBOL_GPL(wmi_evaluate_method);
acpi_status wmidev_evaluate_method(struct wmi_device *wdev, u8 instance, acpi_status wmidev_evaluate_method(struct wmi_device *wdev, u8 instance,
u32 method_id, const struct acpi_buffer *in, struct acpi_buffer *out) u32 method_id, const struct acpi_buffer *in, struct acpi_buffer *out)
{ {
struct guid_block *block = NULL; struct guid_block *block;
struct wmi_block *wblock = NULL; struct wmi_block *wblock;
acpi_handle handle; acpi_handle handle;
acpi_status status; acpi_status status;
struct acpi_object_list input; struct acpi_object_list input;
...@@ -299,7 +299,7 @@ EXPORT_SYMBOL_GPL(wmidev_evaluate_method); ...@@ -299,7 +299,7 @@ EXPORT_SYMBOL_GPL(wmidev_evaluate_method);
static acpi_status __query_block(struct wmi_block *wblock, u8 instance, static acpi_status __query_block(struct wmi_block *wblock, u8 instance,
struct acpi_buffer *out) struct acpi_buffer *out)
{ {
struct guid_block *block = NULL; struct guid_block *block;
acpi_handle handle; acpi_handle handle;
acpi_status status, wc_status = AE_ERROR; acpi_status status, wc_status = AE_ERROR;
struct acpi_object_list input; struct acpi_object_list input;
...@@ -405,8 +405,8 @@ EXPORT_SYMBOL_GPL(wmidev_block_query); ...@@ -405,8 +405,8 @@ EXPORT_SYMBOL_GPL(wmidev_block_query);
acpi_status wmi_set_block(const char *guid_string, u8 instance, acpi_status wmi_set_block(const char *guid_string, u8 instance,
const struct acpi_buffer *in) const struct acpi_buffer *in)
{ {
struct guid_block *block = NULL;
struct wmi_block *wblock = NULL; struct wmi_block *wblock = NULL;
struct guid_block *block;
acpi_handle handle; acpi_handle handle;
struct acpi_object_list input; struct acpi_object_list input;
union acpi_object params[2]; union acpi_object params[2];
...@@ -811,8 +811,8 @@ static int wmi_dev_match(struct device *dev, struct device_driver *driver) ...@@ -811,8 +811,8 @@ static int wmi_dev_match(struct device *dev, struct device_driver *driver)
static int wmi_char_open(struct inode *inode, struct file *filp) static int wmi_char_open(struct inode *inode, struct file *filp)
{ {
const char *driver_name = filp->f_path.dentry->d_iname; const char *driver_name = filp->f_path.dentry->d_iname;
struct wmi_block *wblock = NULL; struct wmi_block *wblock;
struct wmi_block *next = NULL; struct wmi_block *next;
list_for_each_entry_safe(wblock, next, &wmi_block_list, list) { list_for_each_entry_safe(wblock, next, &wmi_block_list, list) {
if (!wblock->dev.dev.driver) if (!wblock->dev.dev.driver)
...@@ -844,8 +844,8 @@ static long wmi_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) ...@@ -844,8 +844,8 @@ static long wmi_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
struct wmi_ioctl_buffer __user *input = struct wmi_ioctl_buffer __user *input =
(struct wmi_ioctl_buffer __user *) arg; (struct wmi_ioctl_buffer __user *) arg;
struct wmi_block *wblock = filp->private_data; struct wmi_block *wblock = filp->private_data;
struct wmi_ioctl_buffer *buf = NULL; struct wmi_ioctl_buffer *buf;
struct wmi_driver *wdriver = NULL; struct wmi_driver *wdriver;
int ret; int ret;
if (_IOC_TYPE(cmd) != WMI_IOC) if (_IOC_TYPE(cmd) != WMI_IOC)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment