lkml.org 
[lkml]   [2019]   [Mar]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH] platform/x86: thinkpad_acpi: disable bluetooth for some machines
Date
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)

\
 
 \ /
  Last update: 2019-03-07 18:00    [W:0.091 / U:0.376 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site