* [PATCH] platform/x86: wmi: Drop forward declaration of static functions
@ 2022-09-19 12:22 Uwe Kleine-König
2022-09-19 12:56 ` Hans de Goede
0 siblings, 1 reply; 2+ messages in thread
From: Uwe Kleine-König @ 2022-09-19 12:22 UTC (permalink / raw)
To: Mark Gross, Hans de Goede; +Cc: platform-driver-x86, kernel
Usually it's not necessary to declare static functions if the symbols are
in the right order. Moving the definition of acpi_wmi_driver down in the
compilation unit allows to drop two such declarations.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/platform/x86/wmi.c | 21 +++++++++------------
1 file changed, 9 insertions(+), 12 deletions(-)
diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c
index aed293b5af81..dbc535b772b3 100644
--- a/drivers/platform/x86/wmi.c
+++ b/drivers/platform/x86/wmi.c
@@ -95,9 +95,6 @@ module_param(debug_dump_wdg, bool, 0444);
MODULE_PARM_DESC(debug_dump_wdg,
"Dump available WMI interfaces [0/1]");
-static int acpi_wmi_remove(struct platform_device *device);
-static int acpi_wmi_probe(struct platform_device *device);
-
static const struct acpi_device_id wmi_device_ids[] = {
{"PNP0C14", 0},
{"pnp0c14", 0},
@@ -105,15 +102,6 @@ static const struct acpi_device_id wmi_device_ids[] = {
};
MODULE_DEVICE_TABLE(acpi, wmi_device_ids);
-static struct platform_driver acpi_wmi_driver = {
- .driver = {
- .name = "acpi-wmi",
- .acpi_match_table = wmi_device_ids,
- },
- .probe = acpi_wmi_probe,
- .remove = acpi_wmi_remove,
-};
-
/*
* GUID parsing functions
*/
@@ -1449,6 +1437,15 @@ void wmi_driver_unregister(struct wmi_driver *driver)
}
EXPORT_SYMBOL(wmi_driver_unregister);
+static struct platform_driver acpi_wmi_driver = {
+ .driver = {
+ .name = "acpi-wmi",
+ .acpi_match_table = wmi_device_ids,
+ },
+ .probe = acpi_wmi_probe,
+ .remove = acpi_wmi_remove,
+};
+
static int __init acpi_wmi_init(void)
{
int error;
base-commit: 568035b01cfb107af8d2e4bd2fb9aea22cf5b868
--
2.37.2
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] platform/x86: wmi: Drop forward declaration of static functions
2022-09-19 12:22 [PATCH] platform/x86: wmi: Drop forward declaration of static functions Uwe Kleine-König
@ 2022-09-19 12:56 ` Hans de Goede
0 siblings, 0 replies; 2+ messages in thread
From: Hans de Goede @ 2022-09-19 12:56 UTC (permalink / raw)
To: Uwe Kleine-König, Mark Gross; +Cc: platform-driver-x86, kernel
Hi,
On 9/19/22 13:22, Uwe Kleine-König wrote:
> Usually it's not necessary to declare static functions if the symbols are
> in the right order. Moving the definition of acpi_wmi_driver down in the
> compilation unit allows to drop two such declarations.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Thank you for your patch, I've applied this patch to my review-hans
branch:
https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=review-hans
Note it will show up in my review-hans branch once I've pushed my
local branch there, which might take a while.
Once I've run some tests on this branch the patches there will be
added to the platform-drivers-x86/for-next branch and eventually
will be included in the pdx86 pull-request to Linus for the next
merge-window.
Regards,
Hans
> ---
> drivers/platform/x86/wmi.c | 21 +++++++++------------
> 1 file changed, 9 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c
> index aed293b5af81..dbc535b772b3 100644
> --- a/drivers/platform/x86/wmi.c
> +++ b/drivers/platform/x86/wmi.c
> @@ -95,9 +95,6 @@ module_param(debug_dump_wdg, bool, 0444);
> MODULE_PARM_DESC(debug_dump_wdg,
> "Dump available WMI interfaces [0/1]");
>
> -static int acpi_wmi_remove(struct platform_device *device);
> -static int acpi_wmi_probe(struct platform_device *device);
> -
> static const struct acpi_device_id wmi_device_ids[] = {
> {"PNP0C14", 0},
> {"pnp0c14", 0},
> @@ -105,15 +102,6 @@ static const struct acpi_device_id wmi_device_ids[] = {
> };
> MODULE_DEVICE_TABLE(acpi, wmi_device_ids);
>
> -static struct platform_driver acpi_wmi_driver = {
> - .driver = {
> - .name = "acpi-wmi",
> - .acpi_match_table = wmi_device_ids,
> - },
> - .probe = acpi_wmi_probe,
> - .remove = acpi_wmi_remove,
> -};
> -
> /*
> * GUID parsing functions
> */
> @@ -1449,6 +1437,15 @@ void wmi_driver_unregister(struct wmi_driver *driver)
> }
> EXPORT_SYMBOL(wmi_driver_unregister);
>
> +static struct platform_driver acpi_wmi_driver = {
> + .driver = {
> + .name = "acpi-wmi",
> + .acpi_match_table = wmi_device_ids,
> + },
> + .probe = acpi_wmi_probe,
> + .remove = acpi_wmi_remove,
> +};
> +
> static int __init acpi_wmi_init(void)
> {
> int error;
>
> base-commit: 568035b01cfb107af8d2e4bd2fb9aea22cf5b868
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-09-19 12:56 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-19 12:22 [PATCH] platform/x86: wmi: Drop forward declaration of static functions Uwe Kleine-König
2022-09-19 12:56 ` Hans de Goede
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox