All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH v1 00/30] platform/x86: wmi: minor improvements
@ 2021-09-04 17:54 Barnabás Pőcze
  2021-09-04 17:54 ` [RFC PATCH v1 01/30] platform/x86: wmi: fix kernel doc Barnabás Pőcze
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Barnabás Pőcze @ 2021-09-04 17:54 UTC (permalink / raw)
  To: Hans de Goede, Mark Gross, platform-driver-x86

This patch series contains minor changes in the WMI bus, which
aim to remove unnecessary code, get rid of duplication, and
various style changes.

Most of the patches should have no observable effect on the behaviour.

Barnabás Pőcze (30):
  platform/x86: wmi: fix kernel doc
  platform/x86: wmi: fix checkpatch warnings
  platform/x86: wmi: remove commas
  platform/x86: wmi: remove unnecessary initialization
  platform/x86: wmi: remove unnecessary initializations
  platform/x86: wmi: remove unnecessary variable
  platform/x86: wmi: remove unnecessary argument
  platform/x86: wmi: remove unnecessary casts
  platform/x86: wmi: remove stray empty line
  platform/x86: wmi: remove unnecessary checks
  platform/x86: wmi: use BIT() macro
  platform/x86: wmi: use bool instead of int
  platform/x86: wmi: use dynamic debug to print data about events
  platform/x86: wmi: use guid_t and guid_equal()
  platform/x86: wmi: make GUID block packed
  platform/x86: wmi: use sysfs_emit()
  platform/x86: wmi: use sizeof() instead of hard-coding
  platform/x86: wmi: use !p to check for NULL
  platform/x86: wmi: use sizeof(*p) in allocation
  platform/x86: wmi: remove variable
  platform/x86: wmi: move variables
  platform/x86: wmi: align arguments of functions
  platform/x86: wmi: improve debug messages
  platform/x86: wmi: do not fail if disabling fails
  platform/x86: wmi: simplify error handling logic
  platform/x86: wmi: introduce helper to convert driver to WMI driver
  platform/x86: wmi: introduce helper to generate method names
  platform/x86: wmi: introduce helper to determine type
  platform/x86: wmi: introduce helper to retrieve event data
  platform/x86: wmi: more detailed error reporting in find_guid()

 drivers/platform/x86/wmi.c | 378 +++++++++++++++++++------------------
 1 file changed, 197 insertions(+), 181 deletions(-)

--
2.33.0



^ permalink raw reply	[flat|nested] 8+ messages in thread

* [RFC PATCH v1 01/30] platform/x86: wmi: fix kernel doc
  2021-09-04 17:54 [RFC PATCH v1 00/30] platform/x86: wmi: minor improvements Barnabás Pőcze
@ 2021-09-04 17:54 ` Barnabás Pőcze
  2021-09-04 17:54 ` [RFC PATCH v1 02/30] platform/x86: wmi: fix checkpatch warnings Barnabás Pőcze
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Barnabás Pőcze @ 2021-09-04 17:54 UTC (permalink / raw)
  To: Hans de Goede, Mark Gross, platform-driver-x86

The kernel doc erroneously specified `wmi_uninstall_notify_handler()`
for the `wmi_remove_notify_handler()` function. Fix that.

Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com>
---
 drivers/platform/x86/wmi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c
index a76313006bdc..0b931629f0b0 100644
--- a/drivers/platform/x86/wmi.c
+++ b/drivers/platform/x86/wmi.c
@@ -551,7 +551,7 @@ wmi_notify_handler handler, void *data)
 EXPORT_SYMBOL_GPL(wmi_install_notify_handler);

 /**
- * wmi_uninstall_notify_handler - Unregister handler for WMI events
+ * wmi_remove_notify_handler - Unregister handler for WMI events
  * @guid: 36 char string of the form fa50ff2b-f2e8-45de-83fa-65417f2f49ba
  *
  * Unregister handler for events sent to the ACPI-WMI mapper device.
--
2.33.0



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [RFC PATCH v1 02/30] platform/x86: wmi: fix checkpatch warnings
  2021-09-04 17:54 [RFC PATCH v1 00/30] platform/x86: wmi: minor improvements Barnabás Pőcze
  2021-09-04 17:54 ` [RFC PATCH v1 01/30] platform/x86: wmi: fix kernel doc Barnabás Pőcze
@ 2021-09-04 17:54 ` Barnabás Pőcze
  2021-09-04 17:55 ` [RFC PATCH v1 03/30] platform/x86: wmi: remove commas Barnabás Pőcze
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Barnabás Pőcze @ 2021-09-04 17:54 UTC (permalink / raw)
  To: Hans de Goede, Mark Gross, platform-driver-x86

Fix the following two checkpatch warnings:

 * "space required before the open parenthesis '('"
 * "that open brace { should be on the previous line"

Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com>
---
 drivers/platform/x86/wmi.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c
index 0b931629f0b0..73ed17a53af5 100644
--- a/drivers/platform/x86/wmi.c
+++ b/drivers/platform/x86/wmi.c
@@ -488,7 +488,7 @@ static void wmi_notify_debug(u32 value, void *context)
 		return;

 	pr_info("DEBUG Event ");
-	switch(obj->type) {
+	switch (obj->type) {
 	case ACPI_TYPE_BUFFER:
 		pr_cont("BUFFER_TYPE - length %d\n", obj->buffer.length);
 		break;
@@ -1277,8 +1277,7 @@ static void acpi_wmi_notify_handler(acpi_handle handle, u32 event,

 		if (wblock->acpi_device->handle == handle &&
 		    (block->flags & ACPI_WMI_EVENT) &&
-		    (block->notify_id == event))
-		{
+		    (block->notify_id == event)) {
 			found_it = true;
 			break;
 		}
--
2.33.0



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [RFC PATCH v1 03/30] platform/x86: wmi: remove commas
  2021-09-04 17:54 [RFC PATCH v1 00/30] platform/x86: wmi: minor improvements Barnabás Pőcze
  2021-09-04 17:54 ` [RFC PATCH v1 01/30] platform/x86: wmi: fix kernel doc Barnabás Pőcze
  2021-09-04 17:54 ` [RFC PATCH v1 02/30] platform/x86: wmi: fix checkpatch warnings Barnabás Pőcze
@ 2021-09-04 17:55 ` Barnabás Pőcze
  2021-09-04 17:55 ` [RFC PATCH v1 04/30] platform/x86: wmi: remove unnecessary initialization Barnabás Pőcze
  2021-09-13  9:19 ` [RFC PATCH v1 00/30] platform/x86: wmi: minor improvements Hans de Goede
  4 siblings, 0 replies; 8+ messages in thread
From: Barnabás Pőcze @ 2021-09-04 17:55 UTC (permalink / raw)
  To: Hans de Goede, Mark Gross, platform-driver-x86

Remove commas that are after terminating entries in arrays.

Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com>
---
 drivers/platform/x86/wmi.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c
index 73ed17a53af5..67c09d81a676 100644
--- a/drivers/platform/x86/wmi.c
+++ b/drivers/platform/x86/wmi.c
@@ -714,7 +714,7 @@ static struct attribute *wmi_attrs[] = {
 	&dev_attr_guid.attr,
 	&dev_attr_instance_count.attr,
 	&dev_attr_expensive.attr,
-	NULL,
+	NULL
 };
 ATTRIBUTE_GROUPS(wmi);

@@ -729,7 +729,7 @@ static DEVICE_ATTR_RO(notify_id);

 static struct attribute *wmi_event_attrs[] = {
 	&dev_attr_notify_id.attr,
-	NULL,
+	NULL
 };
 ATTRIBUTE_GROUPS(wmi_event);

@@ -755,13 +755,13 @@ static DEVICE_ATTR_RO(setable);
 static struct attribute *wmi_data_attrs[] = {
 	&dev_attr_object_id.attr,
 	&dev_attr_setable.attr,
-	NULL,
+	NULL
 };
 ATTRIBUTE_GROUPS(wmi_data);

 static struct attribute *wmi_method_attrs[] = {
 	&dev_attr_object_id.attr,
-	NULL,
+	NULL
 };
 ATTRIBUTE_GROUPS(wmi_method);

--
2.33.0



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [RFC PATCH v1 04/30] platform/x86: wmi: remove unnecessary initialization
  2021-09-04 17:54 [RFC PATCH v1 00/30] platform/x86: wmi: minor improvements Barnabás Pőcze
                   ` (2 preceding siblings ...)
  2021-09-04 17:55 ` [RFC PATCH v1 03/30] platform/x86: wmi: remove commas Barnabás Pőcze
@ 2021-09-04 17:55 ` Barnabás Pőcze
  2021-09-13  9:19 ` [RFC PATCH v1 00/30] platform/x86: wmi: minor improvements Hans de Goede
  4 siblings, 0 replies; 8+ messages in thread
From: Barnabás Pőcze @ 2021-09-04 17:55 UTC (permalink / raw)
  To: Hans de Goede, Mark Gross, platform-driver-x86

The empty initializer `{ }` is enough to properly initialize
the terminating acpi_device_id entry in the device table,
so use that.

Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com>
---
 drivers/platform/x86/wmi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c
index 67c09d81a676..6ad5962da59b 100644
--- a/drivers/platform/x86/wmi.c
+++ b/drivers/platform/x86/wmi.c
@@ -91,7 +91,7 @@ static int acpi_wmi_probe(struct platform_device *device);
 static const struct acpi_device_id wmi_device_ids[] = {
 	{"PNP0C14", 0},
 	{"pnp0c14", 0},
-	{"", 0},
+	{ }
 };
 MODULE_DEVICE_TABLE(acpi, wmi_device_ids);

--
2.33.0



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [RFC PATCH v1 00/30] platform/x86: wmi: minor improvements
  2021-09-04 17:54 [RFC PATCH v1 00/30] platform/x86: wmi: minor improvements Barnabás Pőcze
                   ` (3 preceding siblings ...)
  2021-09-04 17:55 ` [RFC PATCH v1 04/30] platform/x86: wmi: remove unnecessary initialization Barnabás Pőcze
@ 2021-09-13  9:19 ` Hans de Goede
  2021-09-13 10:23   ` Barnabás Pőcze
  4 siblings, 1 reply; 8+ messages in thread
From: Hans de Goede @ 2021-09-13  9:19 UTC (permalink / raw)
  To: Barnabás Pőcze, Mark Gross, platform-driver-x86

Hi Barnabás,

On 9/4/21 7:54 PM, Barnabás Pőcze wrote:
> This patch series contains minor changes in the WMI bus, which
> aim to remove unnecessary code, get rid of duplication, and
> various style changes.
> 
> Most of the patches should have no observable effect on the behaviour.
> 
> Barnabás Pőcze (30):
>   platform/x86: wmi: fix kernel doc
>   platform/x86: wmi: fix checkpatch warnings
>   platform/x86: wmi: remove commas
>   platform/x86: wmi: remove unnecessary initialization
>   platform/x86: wmi: remove unnecessary initializations
>   platform/x86: wmi: remove unnecessary variable
>   platform/x86: wmi: remove unnecessary argument
>   platform/x86: wmi: remove unnecessary casts
>   platform/x86: wmi: remove stray empty line
>   platform/x86: wmi: remove unnecessary checks
>   platform/x86: wmi: use BIT() macro
>   platform/x86: wmi: use bool instead of int
>   platform/x86: wmi: use dynamic debug to print data about events
>   platform/x86: wmi: use guid_t and guid_equal()
>   platform/x86: wmi: make GUID block packed
>   platform/x86: wmi: use sysfs_emit()
>   platform/x86: wmi: use sizeof() instead of hard-coding
>   platform/x86: wmi: use !p to check for NULL
>   platform/x86: wmi: use sizeof(*p) in allocation
>   platform/x86: wmi: remove variable
>   platform/x86: wmi: move variables
>   platform/x86: wmi: align arguments of functions
>   platform/x86: wmi: improve debug messages
>   platform/x86: wmi: do not fail if disabling fails
>   platform/x86: wmi: simplify error handling logic
>   platform/x86: wmi: introduce helper to convert driver to WMI driver
>   platform/x86: wmi: introduce helper to generate method names
>   platform/x86: wmi: introduce helper to determine type
>   platform/x86: wmi: introduce helper to retrieve event data
>   platform/x86: wmi: more detailed error reporting in find_guid()
> 
>  drivers/platform/x86/wmi.c | 378 +++++++++++++++++++------------------
>  1 file changed, 197 insertions(+), 181 deletions(-)

Thank you for this big cleanup series.

Not sure why this is marked as a RFC?

I've gone over patches 1 - 7 sofar and they all look like
straight forward simple cleanups. So I will at least apply those
right away.

I've some small remarks to patch 6, which I've fixed up while applying
the patch. I will reply to patch 6 with my remarks.

I will continue the process the series and reply to patches which
I have any remarks to. Depending on how this goes I might end up merging
the first X patches, or just merge everything, we will see :)

Regards,

Hans


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [RFC PATCH v1 00/30] platform/x86: wmi: minor improvements
  2021-09-13  9:19 ` [RFC PATCH v1 00/30] platform/x86: wmi: minor improvements Hans de Goede
@ 2021-09-13 10:23   ` Barnabás Pőcze
  2021-09-13 10:31     ` Hans de Goede
  0 siblings, 1 reply; 8+ messages in thread
From: Barnabás Pőcze @ 2021-09-13 10:23 UTC (permalink / raw)
  To: Hans de Goede; +Cc: Mark Gross, platform-driver-x86

Hi


2021. szeptember 13., hétfő 11:19 keltezéssel, Hans de Goede írta:
> [...]
> Thank you for this big cleanup series.
>
> Not sure why this is marked as a RFC?
>
> I've gone over patches 1 - 7 sofar and they all look like
> straight forward simple cleanups. So I will at least apply those
> right away.
> [...]

It's RFC because, well, I wanted to get some comments and see if it's not unwanted.

And I had made some local changes since I have sent the series:
patch 17[1] has been replaced. So please ignore that.

[1]: https://patchwork.kernel.org/project/platform-driver-x86/patch/20210904175450.156801-18-pobrn@protonmail.com/


Best regards,
Barnabás Pőcze

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [RFC PATCH v1 00/30] platform/x86: wmi: minor improvements
  2021-09-13 10:23   ` Barnabás Pőcze
@ 2021-09-13 10:31     ` Hans de Goede
  0 siblings, 0 replies; 8+ messages in thread
From: Hans de Goede @ 2021-09-13 10:31 UTC (permalink / raw)
  To: Barnabás Pőcze; +Cc: Mark Gross, platform-driver-x86

Hi,

On 9/13/21 12:23 PM, Barnabás Pőcze wrote:
> Hi
> 
> 
> 2021. szeptember 13., hétfő 11:19 keltezéssel, Hans de Goede írta:
>> [...]
>> Thank you for this big cleanup series.
>>
>> Not sure why this is marked as a RFC?
>>
>> I've gone over patches 1 - 7 sofar and they all look like
>> straight forward simple cleanups. So I will at least apply those
>> right away.
>> [...]
> 
> It's RFC because, well, I wanted to get some comments and see if it's not unwanted.
> 
> And I had made some local changes since I have sent the series:
> patch 17[1] has been replaced. So please ignore that.

Ok I've dropped patch 17; and sorry if I've caused any extra work for you
by picking this up early. I had time to review and process this large series
today, so I decided to tackle it right away (now that the merge window is done).

Regards,

Hans


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-09-13 10:31 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-04 17:54 [RFC PATCH v1 00/30] platform/x86: wmi: minor improvements Barnabás Pőcze
2021-09-04 17:54 ` [RFC PATCH v1 01/30] platform/x86: wmi: fix kernel doc Barnabás Pőcze
2021-09-04 17:54 ` [RFC PATCH v1 02/30] platform/x86: wmi: fix checkpatch warnings Barnabás Pőcze
2021-09-04 17:55 ` [RFC PATCH v1 03/30] platform/x86: wmi: remove commas Barnabás Pőcze
2021-09-04 17:55 ` [RFC PATCH v1 04/30] platform/x86: wmi: remove unnecessary initialization Barnabás Pőcze
2021-09-13  9:19 ` [RFC PATCH v1 00/30] platform/x86: wmi: minor improvements Hans de Goede
2021-09-13 10:23   ` Barnabás Pőcze
2021-09-13 10:31     ` Hans de Goede

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.