From: David Laight <David.Laight@ACULAB.COM>
To: 'Jiaxun Yang' <jiaxun.yang@flygoat.com>,
"ibm-acpi@hmh.eng.br" <ibm-acpi@hmh.eng.br>
Cc: "dvhart@infradead.org" <dvhart@infradead.org>,
"andy@infradead.org" <andy@infradead.org>,
"ibm-acpi-devel@lists.sourceforge.net"
<ibm-acpi-devel@lists.sourceforge.net>,
"platform-driver-x86@vger.kernel.org"
<platform-driver-x86@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"stable@vger.kernel.org" <stable@vger.kernel.org>
Subject: RE: [PATCH] platform/x86: thinkpad_acpi: disable bluetooth for some machines
Date: Thu, 7 Mar 2019 17:00:35 +0000 [thread overview]
Message-ID: <4801d0ea91ac46888b11d924b9508d1e@AcuMS.aculab.com> (raw)
In-Reply-To: <20190307080820.9723-1-jiaxun.yang@flygoat.com>
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)
next prev parent reply other threads:[~2019-03-07 16:59 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-07 8:08 Jiaxun Yang
2019-03-07 8:23 ` Andy Shevchenko
2019-03-07 9:37 ` [PATCH v2] " Jiaxun Yang
2019-03-07 11:20 ` [PATCH] " Greg KH
2019-03-07 12:30 ` Jiaxun Yang
2019-03-07 12:41 ` Andy Shevchenko
2019-03-07 17:00 ` David Laight [this message]
2019-03-07 23:14 ` Mario.Limonciello
2019-03-08 1:14 ` Jiaxun Yang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4801d0ea91ac46888b11d924b9508d1e@AcuMS.aculab.com \
--to=david.laight@aculab.com \
--cc=andy@infradead.org \
--cc=dvhart@infradead.org \
--cc=ibm-acpi-devel@lists.sourceforge.net \
--cc=ibm-acpi@hmh.eng.br \
--cc=jiaxun.yang@flygoat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=platform-driver-x86@vger.kernel.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome