On Sun, Jan 27, 2019 at 9:04 PM Mattias Jacobsson <[email protected]> wrote:
>
> In preparation for adding WMI support to MODULE_DEVICE_TABLE() move the
> definition of struct wmi_device_id to mod_devicetable.h and inline
> guid_string in the struct.
>
> Changing guid_string to an inline char array changes the loop conditions
> when looping over an array of struct wmi_device_id. Therefore update
> wmi_dev_match()'s loop to check for an empty guid_string instead of a
> NULL pointer.

Below some minor comments.

> -       while (id->guid_string) {
> +       while (id->guid_string[0] != '\0') {

Hmm.. I would rather put it as

while (*id->guid_string) {

> +#define WMI_MODULE_PREFIX      "wmi:"

> +#define WMI_GUID_STRING_LEN    36

Isn't this already defined in UUID namespace?
(include/linux/uuid.h IIRC)

>  #include <linux/device.h>
>  #include <linux/acpi.h>

> +#include <linux/mod_devicetable.h>

Not sure it's needed since acpi.h includes that.

-- 
With Best Regards,
Andy Shevchenko

Reply via email to