lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 27 Nov 2018 12:02:39 +0100
From:   Takashi Iwai <tiwai@...e.de>
To:     "Ayman Bagabas" <ayman.bagabas@...il.com>
Cc:     <alsa-devel@...a-project.org>, "Hui Wang" <hui.wang@...onical.com>,
        "Andy Shevchenko" <andy@...radead.org>,
        "Darren Hart" <dvhart@...radead.org>,
        "Jaroslav Kysela" <perex@...ex.cz>,
        "Kailang Yang" <kailang@...ltek.com>,
        <linux-kernel@...r.kernel.org>,
        <platform-driver-x86@...r.kernel.org>
Subject: Re: [PATCH v7 2/3] x86: add support for Huawei WMI hotkeys.

Some more forgotten bits...

On Tue, 27 Nov 2018 03:57:48 +0100,
Ayman Bagabas wrote:
> --- a/drivers/platform/x86/Kconfig
> +++ b/drivers/platform/x86/Kconfig
....
> +config HUAWEI_WMI
> +	tristate "Huawei WMI hotkeys driver"
> +	depends on ACPI_WMI
> +	depends on INPUT
> +	select INPUT_SPARSEKMAP
> +	select LEDS_TRIGGERS
> +	select LEDS_TRIGGER_AUDIO

I guess "select LEDS_CLASS" is needed as well.
Other drivers had already it.

> --- /dev/null
> +++ b/drivers/platform/x86/huawei-wmi.c
....
> +static int huawei_wmi_micmute_led_set(bool on)
> +{
> +	acpi_handle handle;
> +	char *method;
> +	union acpi_object args[3];
> +	struct acpi_object_list arg_list = {
> +		.pointer = args,
> +		.count = ARRAY_SIZE(args),
> +	};
> +
> +	handle = ACPI_HANDLE(&inputdev->dev);
> +	args[0].type = args[1].type = args[2].type = ACPI_TYPE_INTEGER;
> +	args[1].integer.value = 0x04;
> +
> +	if (acpi_has_method(handle, method = "\\_SB.PCI0.LPCB.EC0.SPIN")) {

This looks ugly...  And checkpatch also complains.

> +		args[0].integer.value = 0;
> +		args[2].integer.value = on ? 1 : 0;
> +	} else if (acpi_has_method(handle, method = "\\_SB.PCI0.LPCB.EC0.WPIN")) {
> +		args[0].integer.value = 1;
> +		args[2].integer.value = on ? 0 : 1;
> +	} else {
> +		dev_err(&inputdev->dev, "Unable to find ACPI method\n");
> +		return -ENOSYS;
> +	}

Can these checks be done at initialization phase?  It doesn't seem
needed to be executed at each call.


thanks,

Takashi

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ