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:   Thu, 7 Mar 2019 17:00:35 +0000
From:   David Laight <David.Laight@...LAB.COM>
To:     'Jiaxun Yang' <jiaxun.yang@...goat.com>,
        "ibm-acpi@....eng.br" <ibm-acpi@....eng.br>
CC:     "dvhart@...radead.org" <dvhart@...radead.org>,
        "andy@...radead.org" <andy@...radead.org>,
        "ibm-acpi-devel@...ts.sourceforge.net" 
        <ibm-acpi-devel@...ts.sourceforge.net>,
        "platform-driver-x86@...r.kernel.org" 
        <platform-driver-x86@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "stable@...r.kernel.org" <stable@...r.kernel.org>
Subject: RE: [PATCH] platform/x86: thinkpad_acpi: disable bluetooth for some
 machines

From: Jiaxun Yang
> Sent: 07 March 2019 08:08
...
> +static int __init have_bt_fwbug(void)
> +{
> +	/* Some AMD based ThinkPads have a firmware bug that calling
> +	 * "GBDC" will cause bluetooth on Intel wireless cards blocked
> +	 */
> +	if (dmi_check_system(bt_fwbug_list)) {
> +		if (pci_get_device(PCI_VENDOR_ID_INTEL, 0x24F3, NULL) || \

WTF if that \ ??

> +		    pci_get_device(PCI_VENDOR_ID_INTEL, 0x24FD, NULL) || \
> +		    pci_get_device(PCI_VENDOR_ID_INTEL, 0x2526, NULL))
> +			return 1;
> +		else
> +			return 0;
> +	} else {
> +			return 0;
> +	}
> +}

You don't need 'else' after a 'return'.
I'd also put the return nearer the test.

While the above could be written:
	return dmi_check_system(bt_fwbug_list) &&
		(pci_get_device(PCI_VENDOR_ID_INTEL, 0x24F3, NULL) ||
		pci_get_device(PCI_VENDOR_ID_INTEL, 0x24FD, NULL) ||
		pci_get_device(PCI_VENDOR_ID_INTEL, 0x2526, NULL));

I think I'd write:
	if (!dmi_check_system(bt_fwbug_list))
		return 0;
	return pci_get_device(PCI_VENDOR_ID_INTEL, 0x24F3, NULL) ||
		pci_get_device(PCI_VENDOR_ID_INTEL, 0x24FD, NULL) ||
		pci_get_device(PCI_VENDOR_ID_INTEL, 0x2526, NULL);

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ