mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 11:26:02 +09:00
platform/x86: wmi: remove unnecessary argument
[ Upstream commit84eacf7e64] The GUID block is available for `wmi_create_device()` through `wblock->gblock`. Use that consistently in the function instead of using a mix of `gblock` and `wblock->gblock`. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Link: https://lore.kernel.org/r/20210904175450.156801-8-pobrn@protonmail.com Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Stable-dep-of:028e6e204a("platform/x86: wmi: Break possible infinite loop when parsing GUID") Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
2ad31ce40e
commit
88dfb592d2
@@ -1042,7 +1042,6 @@ static const struct device_type wmi_type_data = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static int wmi_create_device(struct device *wmi_bus_dev,
|
static int wmi_create_device(struct device *wmi_bus_dev,
|
||||||
const struct guid_block *gblock,
|
|
||||||
struct wmi_block *wblock,
|
struct wmi_block *wblock,
|
||||||
struct acpi_device *device)
|
struct acpi_device *device)
|
||||||
{
|
{
|
||||||
@@ -1050,12 +1049,12 @@ static int wmi_create_device(struct device *wmi_bus_dev,
|
|||||||
char method[5];
|
char method[5];
|
||||||
int result;
|
int result;
|
||||||
|
|
||||||
if (gblock->flags & ACPI_WMI_EVENT) {
|
if (wblock->gblock.flags & ACPI_WMI_EVENT) {
|
||||||
wblock->dev.dev.type = &wmi_type_event;
|
wblock->dev.dev.type = &wmi_type_event;
|
||||||
goto out_init;
|
goto out_init;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gblock->flags & ACPI_WMI_METHOD) {
|
if (wblock->gblock.flags & ACPI_WMI_METHOD) {
|
||||||
wblock->dev.dev.type = &wmi_type_method;
|
wblock->dev.dev.type = &wmi_type_method;
|
||||||
mutex_init(&wblock->char_mutex);
|
mutex_init(&wblock->char_mutex);
|
||||||
goto out_init;
|
goto out_init;
|
||||||
@@ -1105,7 +1104,7 @@ static int wmi_create_device(struct device *wmi_bus_dev,
|
|||||||
wblock->dev.dev.bus = &wmi_bus_type;
|
wblock->dev.dev.bus = &wmi_bus_type;
|
||||||
wblock->dev.dev.parent = wmi_bus_dev;
|
wblock->dev.dev.parent = wmi_bus_dev;
|
||||||
|
|
||||||
dev_set_name(&wblock->dev.dev, "%pUL", gblock->guid);
|
dev_set_name(&wblock->dev.dev, "%pUL", wblock->gblock.guid);
|
||||||
|
|
||||||
device_initialize(&wblock->dev.dev);
|
device_initialize(&wblock->dev.dev);
|
||||||
|
|
||||||
@@ -1197,7 +1196,7 @@ static int parse_wdg(struct device *wmi_bus_dev, struct acpi_device *device)
|
|||||||
wblock->acpi_device = device;
|
wblock->acpi_device = device;
|
||||||
wblock->gblock = gblock[i];
|
wblock->gblock = gblock[i];
|
||||||
|
|
||||||
retval = wmi_create_device(wmi_bus_dev, &gblock[i], wblock, device);
|
retval = wmi_create_device(wmi_bus_dev, wblock, device);
|
||||||
if (retval) {
|
if (retval) {
|
||||||
kfree(wblock);
|
kfree(wblock);
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
Reference in New Issue
Block a user