[PATCH 0/3] platform/x86: wmi: add Xiaomi WMI key driver

2019-05-27 Thread Mattias Jacobsson
[PATCH 3/3]: Add new driver Mattias Jacobsson (3): platform/x86: wmi: add context pointer field to struct wmi_device_id platform/x86: wmi: add context argument to the probe function platform/x86: wmi: add Xiaomi WMI key driver drivers/platform/x86/Kconfig | 10 +++ drivers

[PATCH 1/3] platform/x86: wmi: add context pointer field to struct wmi_device_id

2019-05-27 Thread Mattias Jacobsson
find_guid_context() to retrieve that context pointer. Signed-off-by: Mattias Jacobsson <2...@mok.nu> --- drivers/platform/x86/wmi.c | 22 ++ include/linux/mod_devicetable.h | 1 + 2 files changed, 23 insertions(+) diff --git a/drivers/platform/x86/wmi.c b/drivers/pl

[PATCH 3/3] platform/x86: wmi: add Xiaomi WMI key driver

2019-05-27 Thread Mattias Jacobsson
events that are reported by the hardware but not utilized by this driver are Caps Lock(which already work) and Fn lock/unlock. Signed-off-by: Mattias Jacobsson <2...@mok.nu> --- drivers/platform/x86/Kconfig | 10 drivers/platform/x86/Makefile | 1 + drivers/platform/x86/xiaomi

[PATCH 2/3] platform/x86: wmi: add context argument to the probe function

2019-05-27 Thread Mattias Jacobsson
The struct wmi_device_id has a context pointer field, forward this pointer as an argument to the probe function in struct wmi_driver. Update existing users of the same probe function to accept this new context argument. Signed-off-by: Mattias Jacobsson <2...@mok.nu> --- drivers/platfo

Re: [PATCH] modpost: file2alias: define size of alias

2019-02-23 Thread Mattias Jacobsson
On 2019-02-20, Masahiro Yamada wrote: > On Wed, Feb 20, 2019 at 5:09 AM Mattias Jacobsson <2...@mok.nu> wrote: > > > > Hi Masahiro, > > > > On 2019-02-18, Masahiro Yamada wrote: > > > Hi Mattias, > > > > > > On Thu,

Re: [PATCH] modpost: file2alias: define size of alias

2019-02-19 Thread Mattias Jacobsson
Hi Masahiro, On 2019-02-18, Masahiro Yamada wrote: > Hi Mattias, > > On Thu, Feb 7, 2019 at 9:31 PM Mattias Jacobsson <2...@mok.nu> wrote: > > > > The size of the variable alias provided to do_entry functions are > > currently not readily available.

[PATCH v4 7/8] platform/x86: intel-wmi-thunderbolt: use MODULE_DEVICE_TABLE() instead of MODULE_ALIAS()

2019-02-19 Thread Mattias Jacobsson
to use MODULE_DEVICE_TABLE() instead of MODULE_ALIAS(). Signed-off-by: Mattias Jacobsson <2...@mok.nu> --- drivers/platform/x86/intel-wmi-thunderbolt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/platform/x86/intel-wmi-thunderbolt.c b/drivers/platform/x86/int

[PATCH v4 4/8] platform/x86: dell-wmi-descriptor: use MODULE_DEVICE_TABLE() instead of MODULE_ALIAS()

2019-02-19 Thread Mattias Jacobsson
to use MODULE_DEVICE_TABLE() instead of MODULE_ALIAS(). Signed-off-by: Mattias Jacobsson <2...@mok.nu> Reviewed-by: Mario Limonciello --- drivers/platform/x86/dell-wmi-descriptor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/platform/x86/dell-wmi-descripto

[PATCH v4 8/8] platform/x86: wmi-bmof: use MODULE_DEVICE_TABLE() instead of MODULE_ALIAS()

2019-02-19 Thread Mattias Jacobsson
to use MODULE_DEVICE_TABLE() instead of MODULE_ALIAS(). Signed-off-by: Mattias Jacobsson <2...@mok.nu> --- drivers/platform/x86/wmi-bmof.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/platform/x86/wmi-bmof.c b/drivers/platform/x86/wmi-bmof.c index c4530b

[PATCH v4 2/8] platform/x86: wmi: add WMI support to MODULE_DEVICE_TABLE()

2019-02-19 Thread Mattias Jacobsson
() by adding info about struct wmi_device_id in devicetable-offsets.c and add a WMI entry point in file2alias.c. The type argument for MODULE_DEVICE_TABLE(type, name) is wmi. Suggested-by: Pali Rohár Signed-off-by: Mattias Jacobsson <2...@mok.nu> --- What do you think about writing it th

[PATCH v4 6/8] platform/x86: huawei-wmi: use MODULE_DEVICE_TABLE() instead of MODULE_ALIAS()

2019-02-19 Thread Mattias Jacobsson
to use MODULE_DEVICE_TABLE() instead of MODULE_ALIAS(). Signed-off-by: Mattias Jacobsson <2...@mok.nu> --- drivers/platform/x86/huawei-wmi.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/platform/x86/huawei-wmi.c b/drivers/platform/x86/huawei-wmi.c index 59872f

[PATCH v4 3/8] platform/x86: dell-smbios-wmi: use MODULE_DEVICE_TABLE() instead of MODULE_ALIAS()

2019-02-19 Thread Mattias Jacobsson
to use MODULE_DEVICE_TABLE() instead of MODULE_ALIAS(). Signed-off-by: Mattias Jacobsson <2...@mok.nu> Reviewed-by: Mario Limonciello --- drivers/platform/x86/dell-smbios-wmi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/platform/x86/dell-smbios-wmi.c b/d

[PATCH v4 5/8] platform/x86: dell-wmi: use MODULE_DEVICE_TABLE() instead of MODULE_ALIAS()

2019-02-19 Thread Mattias Jacobsson
to use MODULE_DEVICE_TABLE() instead of MODULE_ALIAS(). Signed-off-by: Mattias Jacobsson <2...@mok.nu> Reviewed-by: Mario Limonciello --- drivers/platform/x86/dell-wmi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/platform/x86/dell-wmi.c b/drivers/platfo

[PATCH v4 1/8] platform/x86: wmi: move struct wmi_device_id to mod_devicetable.h

2019-02-19 Thread Mattias Jacobsson
. Therefore update wmi_dev_match()'s loop to check for an empty guid_string instead of a NULL pointer. Signed-off-by: Mattias Jacobsson <2...@mok.nu> --- drivers/platform/x86/wmi.c | 2 +- include/linux/mod_devicetable.h | 12 include/linux/wmi.h | 5 + 3 files c

[PATCH v4 0/8] platform/x86: wmi: add WMI support to

2019-02-19 Thread Mattias Jacobsson
o document the reasoning behind the changes [1]: https://lkml.kernel.org/r/20190122200302.19861-1-...@mok.nu [2]: https://lkml.kernel.org/r/20190126210634.GB13882@wrath [3]: https://lore.kernel.org/lkml/20190207123022.7961-1-...@mok.nu/ Mattias Jacobsson (8): platform/x86: wmi: move struct wmi

Re: [PATCH v3 2/3] platform/x86: wmi: add WMI support to MODULE_DEVICE_TABLE()

2019-02-07 Thread Mattias Jacobsson
On 2019-02-05, Andy Shevchenko wrote: > On Sun, Feb 3, 2019 at 9:04 PM Mattias Jacobsson <2...@mok.nu> wrote: > > On 2019-01-30, Andy Shevchenko wrote: > > > On Wed, Jan 30, 2019 at 5:15 PM Mattias Jacobsson <2...@mok.nu> wrote: > > > > > + i

[PATCH] modpost: file2alias: define size of alias

2019-02-07 Thread Mattias Jacobsson
The size of the variable alias provided to do_entry functions are currently not readily available. Thus hindering do_entry functions to perform bounds checking. Define the macro ALIAS_SIZE containing the size of the variable alias. Signed-off-by: Mattias Jacobsson <2...@mok.nu> --- R

Re: [PATCH v3 2/3] platform/x86: wmi: add WMI support to MODULE_DEVICE_TABLE()

2019-02-03 Thread Mattias Jacobsson
On 2019-01-30, Andy Shevchenko wrote: > On Wed, Jan 30, 2019 at 5:15 PM Mattias Jacobsson <2...@mok.nu> wrote: > > > > The kernel provides the macro MODULE_DEVICE_TABLE() where driver authors > > can specify their device type and their array of device_ids and thereby

Re: [PATCH v3 3/3] platform/x86: wmi: use MODULE_DEVICE_TABLE() instead of MODULE_ALIAS()

2019-01-31 Thread Mattias Jacobsson
On 2019-01-30, Andy Shevchenko wrote: > On Wed, Jan 30, 2019 at 5:15 PM Mattias Jacobsson <2...@mok.nu> wrote: > > > > WMI drivers can if they have specified an array of struct wmi_device_id > > use the MODULE_DEVICE_TABLE() macro to automatically generate the > >

[PATCH v3 3/3] platform/x86: wmi: use MODULE_DEVICE_TABLE() instead of MODULE_ALIAS()

2019-01-30 Thread Mattias Jacobsson
drivers that have specified an array of struct wmi_device_id to use MODULE_DEVICE_TABLE() instead of MODULE_ALIAS(). Signed-off-by: Mattias Jacobsson <2...@mok.nu> Reviewed-by: Mario Limonciello --- drivers/platform/x86/dell-smbios-wmi.c | 2 +- drivers/platform/x86/dell-wmi-descriptor.c

[PATCH v3 2/3] platform/x86: wmi: add WMI support to MODULE_DEVICE_TABLE()

2019-01-30 Thread Mattias Jacobsson
() by adding info about struct wmi_device_id in devicetable-offsets.c and add a WMI entry point in file2alias.c. The type argument for MODULE_DEVICE_TABLE(type, name) is wmi. Suggested-by: Pali Rohár Signed-off-by: Mattias Jacobsson <2...@mok.nu> --- What do you think about this

[PATCH v2] platform/x86: wmi: fix potential null pointer dereference

2019-01-30 Thread Mattias Jacobsson
if the variable is NULL. Fixes: 844af950da94 ("platform/x86: wmi: Turn WMI into a bus driver") Signed-off-by: Mattias Jacobsson <2...@mok.nu> --- drivers/platform/x86/wmi.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/platform/x86/wmi.c b/drivers/platform

[PATCH v3 0/3] platform/x86: wmi: add WMI support to MODULE_DEVICE_TABLE()

2019-01-30 Thread Mattias Jacobsson
-by tag * depend upon patch [1] * reword commit message for [PATCH 2/3] and [PATCH 3/3] to document the reasoning behind the changes [1]: https://lkml.kernel.org/r/20190122200302.19861-1-...@mok.nu [2]: https://lkml.kernel.org/r/20190126210634.GB13882@wrath Mattias Jacobsson (3): platform/x86: wmi

[PATCH v3 1/3] platform/x86: wmi: move struct wmi_device_id to mod_devicetable.h

2019-01-30 Thread Mattias Jacobsson
. Therefore update wmi_dev_match()'s loop to check for an empty guid_string instead of a NULL pointer. Signed-off-by: Mattias Jacobsson <2...@mok.nu> --- drivers/platform/x86/wmi.c | 2 +- include/linux/mod_devicetable.h | 12 include/linux/wmi.h | 5 + 3 files c

Re: [PATCH v2 2/3] platform/x86: wmi: add WMI support to MODULE_DEVICE_TABLE()

2019-01-28 Thread Mattias Jacobsson
On 2019-01-28, Pali Rohár wrote: > On Monday 28 January 2019 15:09:11 Mattias Jacobsson wrote: > > Hi, > > > > On 2019-01-27, Andy Shevchenko wrote: > > > On Sun, Jan 27, 2019 at 9:04 PM Mattias Jacobsson <2...@mok.nu> wrote: > > > > > >

Re: [PATCH] platform/x86: wmi: fix potential null pointer dereferences

2019-01-28 Thread Mattias Jacobsson
Hi, On 2019-01-27, Andy Shevchenko wrote: > On Tue, Jan 22, 2019 at 10:04 PM Mattias Jacobsson <2...@mok.nu> wrote: > > > > In the function wmi_dev_match() there are three variables that > > potentially can result in a null pointer dereference. Namely: > &

Re: [PATCH v2 2/3] platform/x86: wmi: add WMI support to MODULE_DEVICE_TABLE()

2019-01-28 Thread Mattias Jacobsson
Hi, On 2019-01-27, Andy Shevchenko wrote: > On Sun, Jan 27, 2019 at 9:04 PM Mattias Jacobsson <2...@mok.nu> wrote: > > > > The kernel provides the macro MODULE_DEVICE_TABLE() where driver authors > > can specify their device type and their array of device_

Re: [PATCH v2 1/3] platform/x86: wmi: move struct wmi_device_id to mod_devicetable.h

2019-01-28 Thread Mattias Jacobsson
Hi Andy, Thanks for reviewing! On 2019-01-27, Andy Shevchenko wrote: > On Sun, Jan 27, 2019 at 9:04 PM Mattias Jacobsson <2...@mok.nu> wrote: > > > > In preparation for adding WMI support to MODULE_DEVICE_TABLE() move the > > definition of struct wmi_device_id to m

Re: [PATCH 0/3] platform/x86: wmi: add WMI support to MODULE_DEVICE_TABLE()

2019-01-27 Thread Mattias Jacobsson
Hi Darren, On 2019-01-26, Darren Hart wrote: > On Sat, Jan 19, 2019 at 12:55:52PM +0100, Mattias Jacobsson wrote: > > This patchset adds WMI support to MODULE_DEVICE_TABLE(). > > Hi Mattias, > > Thanks for the patch series. I've reviewed and found no major issues - but

[PATCH v2 3/3] platform/x86: wmi: use MODULE_DEVICE_TABLE() instead of MODULE_ALIAS()

2019-01-27 Thread Mattias Jacobsson
drivers that have specified an array of struct wmi_device_id to use MODULE_DEVICE_TABLE() instead of MODULE_ALIAS(). Signed-off-by: Mattias Jacobsson <2...@mok.nu> Reviewed-by: Mario Limonciello --- drivers/platform/x86/dell-smbios-wmi.c | 2 +- drivers/platform/x86/dell-wmi-descriptor.c

[PATCH v2 1/3] platform/x86: wmi: move struct wmi_device_id to mod_devicetable.h

2019-01-27 Thread Mattias Jacobsson
. Therefore update wmi_dev_match()'s loop to check for an empty guid_string instead of a NULL pointer. Signed-off-by: Mattias Jacobsson <2...@mok.nu> --- drivers/platform/x86/wmi.c | 2 +- include/linux/mod_devicetable.h | 13 + include/linux/wmi.h | 5 + 3 files c

[PATCH v2 2/3] platform/x86: wmi: add WMI support to MODULE_DEVICE_TABLE()

2019-01-27 Thread Mattias Jacobsson
() by adding info about struct wmi_device_id in devicetable-offsets.c and add a WMI entry point in file2alias.c. The type argument for MODULE_DEVICE_TABLE(type, name) is wmi. Suggested-by: Pali Rohár Signed-off-by: Mattias Jacobsson <2...@mok.nu> --- scripts/mod/devicetable-offsets.

[PATCH v2 0/3] platform/x86: wmi: add WMI support to MODULE_DEVICE_TABLE()

2019-01-27 Thread Mattias Jacobsson
-...@mok.nu [2]: https://lkml.kernel.org/r/20190126210634.GB13882@wrath Mattias Jacobsson (3): platform/x86: wmi: move struct wmi_device_id to mod_devicetable.h platform/x86: wmi: add WMI support to MODULE_DEVICE_TABLE() platform/x86: wmi: use MODULE_DEVICE_TABLE() instead of MODULE_ALIAS

Re: [PATCH] platform/x86: wmi: fix potential null pointer dereferences

2019-01-27 Thread Mattias Jacobsson
Hi Darren, On 2019-01-26, Darren Hart wrote: > On Tue, Jan 22, 2019 at 09:03:01PM +0100, Mattias Jacobsson wrote: > > In the function wmi_dev_match() there are three variables that > > potentially can result in a null pointer dereference. Namely: > > Is this someth

Re: [PATCH 1/3] platform/x86: wmi: move struct wmi_device_id to mod_devicetable.h

2019-01-22 Thread Mattias Jacobsson
On 2019-01-19, Mattias Jacobsson 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 co

[PATCH] platform/x86: wmi: fix potential null pointer dereferences

2019-01-22 Thread Mattias Jacobsson
ull pointer dereference. The NULL checks are performed prior to running container_of() for the variables dev/wblock and driver/wmi_driver. Fixes: 844af950da94 ("platform/x86: wmi: Turn WMI into a bus driver") Signed-off-by: Mattias Jacobsson <2...@mok.nu> --- drivers/plat

[PATCH 3/3] platform/x86: wmi: use MODULE_DEVICE_TABLE() instead of MODULE_ALIAS()

2019-01-19 Thread Mattias Jacobsson
(). Signed-off-by: Mattias Jacobsson <2...@mok.nu> --- drivers/platform/x86/dell-smbios-wmi.c | 2 +- drivers/platform/x86/dell-wmi-descriptor.c | 2 +- drivers/platform/x86/dell-wmi.c | 4 ++-- drivers/platform/x86/huawei-wmi.c| 3 +-- drivers/platform/x86

[PATCH 0/3] platform/x86: wmi: add WMI support to MODULE_DEVICE_TABLE()

2019-01-19 Thread Mattias Jacobsson
This patchset adds WMI support to MODULE_DEVICE_TABLE(). [PATCH 1/3]: prepare struct wmi_device_id [PATCH 2/3]: add support [PATCH 3/3]: update existing drivers to use MODULE_DEVICE_TABLE() Mattias Jacobsson (3): platform/x86: wmi: move struct wmi_device_id to mod_devicetable.h platform/x86

[PATCH 1/3] platform/x86: wmi: move struct wmi_device_id to mod_devicetable.h

2019-01-19 Thread Mattias Jacobsson
. Therefore update wmi_dev_match()'s loop to check for an empty guid_string instead of a NULL pointer. Signed-off-by: Mattias Jacobsson <2...@mok.nu> --- drivers/platform/x86/wmi.c | 2 +- include/linux/mod_devicetable.h | 13 + include/linux/wmi.h | 5 + 3 files c

[PATCH 2/3] platform/x86: wmi: add WMI support to MODULE_DEVICE_TABLE()

2019-01-19 Thread Mattias Jacobsson
Add WMI support to MODULE_DEVICE_TABLE() by adding info about struct wmi_device_id in devicetable-offsets.c and add a WMI entry point in file2alias.c. The type argument for MODULE_DEVICE_TABLE(type, name) is wmi. Signed-off-by: Mattias Jacobsson <2...@mok.nu> --- The idea of adding wmi s

[tip:perf/urgent] perf strbuf: Remove redundant va_end() in strbuf_addv()

2019-01-08 Thread tip-bot for Mattias Jacobsson
Commit-ID: 099be748865eece21362aee416c350c0b1ae34df Gitweb: https://git.kernel.org/tip/099be748865eece21362aee416c350c0b1ae34df Author: Mattias Jacobsson <2...@mok.nu> AuthorDate: Sat, 29 Dec 2018 15:17:50 +0100 Committer: Arnaldo Carvalho de Melo CommitDate: Fri, 4 Jan 2019 12

[PATCH] perf tools: util: remove redundant va_end() in strbuf_addv()

2018-12-29 Thread Mattias Jacobsson
Each call to va_copy() should have one, and only one, corresponding call to va_end(). In strbuf_addv() some code paths result in va_end() getting called multiple times. Remove the superfluous va_end(). Fixes: ce49d8436cff ("perf strbuf: Match va_{add,copy} with va_end") Signed-off-b

[tip:x86/boot] x86/boot: Add missing va_end() to die()

2018-11-28 Thread tip-bot for Mattias Jacobsson
Commit-ID: 69be4efeb959147ff86f22e35aea9526f9b86715 Gitweb: https://git.kernel.org/tip/69be4efeb959147ff86f22e35aea9526f9b86715 Author: Mattias Jacobsson <2...@mok.nu> AuthorDate: Wed, 28 Nov 2018 17:16:07 +0100 Committer: Borislav Petkov CommitDate: Wed, 28 Nov 2018 20:06:07 +010

[tip:x86/boot] x86/boot: Add missing va_end() to die()

2018-11-28 Thread tip-bot for Mattias Jacobsson
Commit-ID: 69be4efeb959147ff86f22e35aea9526f9b86715 Gitweb: https://git.kernel.org/tip/69be4efeb959147ff86f22e35aea9526f9b86715 Author: Mattias Jacobsson <2...@mok.nu> AuthorDate: Wed, 28 Nov 2018 17:16:07 +0100 Committer: Borislav Petkov CommitDate: Wed, 28 Nov 2018 20:06:07 +010

[PATCH] x86: boot: add missing va_end to die

2018-11-28 Thread Mattias Jacobsson
Each call to va_start must have a corresponding call to va_end before the end of the function. Add the missing va_end. Found with Coccinelle. Signed-off-by: Mattias Jacobsson <2...@mok.nu> --- arch/x86/boot/tools/build.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/x86/boot

[PATCH] x86: boot: add missing va_end to die

2018-11-28 Thread Mattias Jacobsson
Each call to va_start must have a corresponding call to va_end before the end of the function. Add the missing va_end. Found with Coccinelle. Signed-off-by: Mattias Jacobsson <2...@mok.nu> --- arch/x86/boot/tools/build.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/x86/boot