Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp5159186imb; Thu, 7 Mar 2019 09:02:01 -0800 (PST) X-Google-Smtp-Source: APXvYqyk36W2XGMW+nrZNxI6Eumk+5TdoR5XH3LYrFBU8dxD9ONJr1JWeQkU1WwOsen9PeGEhCP6 X-Received: by 2002:a17:902:2989:: with SMTP id h9mr14015063plb.26.1551978120901; Thu, 07 Mar 2019 09:02:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551978120; cv=none; d=google.com; s=arc-20160816; b=SDPERJYULHijdAqcbdBPfB2W5IGoMWHi5HT/sAcMYkMBMhVANr7DMdKhZz3XrWWx5U njTyT1SMbAqBY9yLtCN/K/AutodsGHGuqdatIffhCayBuMLjo9ElGZxgC/12U4Ny8N0j rqziTbCr+fBUnBw5n8bM28DJiCKDlTzXEWDtH65tjLlklya0DJ0WvEE29toKmR7koDkS sxr5ur7y+BF0LkStRivnMhODk+3zqR92B5xJkcZOGqq3n1i1jvAWoWnnBHXsAXOEWhVp tJWxFGW6WYSZ7z4XpIgDFUroA1sDJlweEj4iDfNsLeJkLZJLNmNFIzsEs3JkA0uE9yX+ qfQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from; bh=ZX9yd8gGhTtEAUXkXP4Nka2g66xyw1pwHQxUgSmEo0Q=; b=VaktlkE3uUPyrCN55a5OYDousczHv6UykidghMuxQV2NcdKWwfexDK9qix+I8T0ID1 rC0mtuz7ywHMDzHHt2CnK3bomrX7aKdxY9dTbwsHgjFbGB5Hcb4jokHYIPzRPWji8cH9 Kf4QLF8Aw/PIptL3QQsXNbzduQo9RHut+2SRMNoUGCBVe+xO3PkLVpkzv0zut6PLVOTd +fSG/esEmR8Ses7EhVVd0cQFa4kah/1aU7+kvqpwEcTfcXGlFZsvF5JExqzuzI7htTLT qFaWvtJMN4kWaorJ1Nm4SVAa0cnU545bIECePwzn+QJs8xIP7Lj063zUMJuTKo8fnb/D DrSA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e9si4690090plb.99.2019.03.07.09.01.44; Thu, 07 Mar 2019 09:02:00 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726357AbfCGQ7y convert rfc822-to-8bit (ORCPT + 99 others); Thu, 7 Mar 2019 11:59:54 -0500 Received: from eu-smtp-delivery-151.mimecast.com ([207.82.80.151]:34412 "EHLO eu-smtp-delivery-151.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726224AbfCGQ7x (ORCPT ); Thu, 7 Mar 2019 11:59:53 -0500 Received: from AcuMS.aculab.com (156.67.243.126 [156.67.243.126]) (Using TLS) by relay.mimecast.com with ESMTP id uk-mta-162-fxZsAPfkMhuUi9vIaV79pg-1; Thu, 07 Mar 2019 16:59:50 +0000 Received: from AcuMS.Aculab.com (fd9f:af1c:a25b::d117) by AcuMS.aculab.com (fd9f:af1c:a25b::d117) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Thu, 7 Mar 2019 17:00:35 +0000 Received: from AcuMS.Aculab.com ([fe80::43c:695e:880f:8750]) by AcuMS.aculab.com ([fe80::43c:695e:880f:8750%12]) with mapi id 15.00.1347.000; Thu, 7 Mar 2019 17:00:35 +0000 From: David Laight To: 'Jiaxun Yang' , "ibm-acpi@hmh.eng.br" CC: "dvhart@infradead.org" , "andy@infradead.org" , "ibm-acpi-devel@lists.sourceforge.net" , "platform-driver-x86@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" Subject: RE: [PATCH] platform/x86: thinkpad_acpi: disable bluetooth for some machines Thread-Topic: [PATCH] platform/x86: thinkpad_acpi: disable bluetooth for some machines Thread-Index: AQHU1L0maNvBcxqlI0i0JUFS+mPQBaYAY76w Date: Thu, 7 Mar 2019 17:00:35 +0000 Message-ID: <4801d0ea91ac46888b11d924b9508d1e@AcuMS.aculab.com> References: <20190307080820.9723-1-jiaxun.yang@flygoat.com> In-Reply-To: <20190307080820.9723-1-jiaxun.yang@flygoat.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 X-MC-Unique: fxZsAPfkMhuUi9vIaV79pg-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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)