[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4801d0ea91ac46888b11d924b9508d1e@AcuMS.aculab.com>
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