From patchwork Wed Sep 18 19:59:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 174006 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp102452ill; Wed, 18 Sep 2019 12:59:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqyKOPEE8dI95zi6kX+c9yphCewdrrC4UsUBPXYiKmOWurIAoTJCaqiV85GOIJfBisKVPxZP X-Received: by 2002:a17:906:7705:: with SMTP id q5mr11031952ejm.172.1568836785972; Wed, 18 Sep 2019 12:59:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568836785; cv=none; d=google.com; s=arc-20160816; b=R93AOHYD/tVYTs5UNQ6M7UTf/3d6pi/nqGvubxEuEXaKPo30t2+UoDA1pXR0SUuOSg bfGDQVo76gK7qOdr2tU4OJEuVc5J2tM4MlfNbvYkLcxldMeB4IflTzyp8X10fPJ/C6KW 3XcfPoMhw57z1RGxuhvkCnyyZ+cKYxNJQFcnreCG+IKbtGcee4ux4vYM0Kcgup+PG2I5 KtCU3APiQZ/AKQRBnhtRB6O0+KK64ONL+aullCn3pesAvWyRTcMzdlG2JQjy8QBPkoPU QD7G/fhylvzXSo/QqFtf97cXXueb3GouFHbyPOs5MliwAE8Dgex2jVF8yTpEyaHgcalb QDBw== 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 :message-id:date:subject:cc:to:from; bh=thfGAsxTPLfmPalcf15qucJNJzYXwsxVM0SdnxNe57I=; b=TvJoTMCLHO6CjGIxzJeYtY9q6vzCq0oc8QkTE+18mMBaHb4m9QfkOM8nJWiN+eGkMd C8c1X7EE6/REtJaHmJKIumgH4Ps1S9REnl6VyLnsYCoZu7AzZUbLHZt8zk3CHeOdt3Uk q/BzdK79sUBVPgOJBTwYP6YENePGSXDnHeRY6sMXk/N4FftD8Tocwj8ZShmoJx3xRatm tD9uk6cpn5lFYFMSOjjpRqsl18AOhR+EPbEMceJhaXgVieK3+kVZsbjyNr3SukciKWde P5W+89VZDtlP5rKOabUPMxNA+LB+SFG7z5kwyNhIA03/z0NvoNh+iqH1d71GqkmwTpk2 5kcg== 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 b3si4081278ede.118.2019.09.18.12.59.45; Wed, 18 Sep 2019 12:59:45 -0700 (PDT) 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 S2389203AbfIRT7n (ORCPT + 26 others); Wed, 18 Sep 2019 15:59:43 -0400 Received: from mout.kundenserver.de ([212.227.17.13]:34911 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389179AbfIRT7m (ORCPT ); Wed, 18 Sep 2019 15:59:42 -0400 Received: from threadripper.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue109 [212.227.15.145]) with ESMTPA (Nemesis) id 1Mn2eH-1hl04i4Alz-00k3oy; Wed, 18 Sep 2019 21:59:24 +0200 From: Arnd Bergmann To: Marcel Holtmann , Johan Hedberg Cc: Arnd Bergmann , Alex Lu , Matthias Kaehlcke , Rajat Jain , Raghuram Hegde , linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] Bluetooth: btusb: avoid unused function warning Date: Wed, 18 Sep 2019 21:59:02 +0200 Message-Id: <20190918195918.2190556-1-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 MIME-Version: 1.0 X-Provags-ID: V03:K1:V9UkgJWPr+oQDUKlZDpC/V5IuPfRkDiGAUbYndfxVz2FSuR/60M AOmNix9PbnZdckGDpVOk+MA6SjDiLwv8rFSfPx/KjN2lgpK+fVbCTi1l/5C1PtSPO/rj15F YrEtNgJxsOgW6GHrcId568mc2JglzR/EhDgBEha1+uYg95WjEDJ4r0N6JeU6tODxJg6Ay/m 16LCKM+tJjGlw6ux1TO5Q== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1; V03:K0:XGM5hiqQ4oQ=:McT85o77EouwbgvZ4DbKlb BArsKptu4Hav7SUMtrGjZpi/3qIAze3LYNXi+sT/JDUdnlZ86uqRt+XtGjRbFFMfpdS2VLOUa ofqiQIQJvjvxnO+dF5gLNLpYxq8/A2u+nKltCRfIhloFoOjcp62jxE5bVGNXrKlLvMi/74jti mhFqr7wIpsGyQwatY73Igd3XbmmwdeKJq8gNItFJ50Kdi6UgBrcb5hrHVbTp5IdEy85qgrBLO bxjNqWAIzAK1OUX00GKRuOoR4oioe/49y13aR6d6Wq3ueJ0ANAMUE4IvQnTwo+kNDc9FTkWoc i8T4xze7NeWt2ASNHBshd8I6q2JhJrmCYcscBpinjm8L772MhDSLtZt4J4beOFTEpqo2NO3I4 FffGroBAmN89M+d8a3jJB6DF6vHvtdcabs2Khl3am8l55WW28UX5R8vFhSzeZ//SLW/hhI9Rp 3Su+1IVK2dMVoAv8Q19S/djclNQwUaeZpZmNx29oSYXzvhwVsMzyY9EEHk7dDQG1dzPiEqBzZ TqGDjP3CNocq1SLwukaaiBP/Ks2kWKWQ5Z6tvcnRJ5a2uqw86ilCXzOL/4qktXoUeTany053S eSqFD44NCGz1rcyXprL+87qTGUSx60raizAX8F5AUeDMtTK0GOeFVnaepL7YZr57yAhQzoUh3 fZMObq1ZtF3HiV9wJHCFXjjXf7xyUjQM0McnH0dn9w0yP274ayn1cwv6DBBtJ4/yCZ3TdX6Fn Af+g/0fAlLqtBUKMVTmzWTNr05dGNXc6nNkGJCq5VZS+H386kdS+/Sax1IOfl6DRltDBUjUk4 ilULa3rqOfk4iwkzhiAsxolZBubiDnghG9nHvfbtJrOZFOwAFtogIo6oWa3+wAxJ0vnGTYNCx oFRE/tYwe7nEYMegqNhg== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The btusb_rtl_cmd_timeout() function is used inside of an ifdef, leading to a warning when this part is hidden from the compiler: drivers/bluetooth/btusb.c:530:13: error: unused function 'btusb_rtl_cmd_timeout' [-Werror,-Wunused-function] Use an IS_ENABLED() check instead so the compiler can see the code and then discard it silently. Fixes: d7ef0d1e3968 ("Bluetooth: btusb: Use cmd_timeout to reset Realtek device") Signed-off-by: Arnd Bergmann --- drivers/bluetooth/btusb.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) -- 2.20.0 diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c index a9c35ebb30f8..23e606aaaea4 100644 --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c @@ -3807,8 +3807,8 @@ static int btusb_probe(struct usb_interface *intf, btusb_check_needs_reset_resume(intf); } -#ifdef CONFIG_BT_HCIBTUSB_RTL - if (id->driver_info & BTUSB_REALTEK) { + if (IS_ENABLED(CONFIG_BT_HCIBTUSB_RTL) && + (id->driver_info & BTUSB_REALTEK)) { hdev->setup = btrtl_setup_realtek; hdev->shutdown = btrtl_shutdown_realtek; hdev->cmd_timeout = btusb_rtl_cmd_timeout; @@ -3819,7 +3819,6 @@ static int btusb_probe(struct usb_interface *intf, */ set_bit(BTUSB_WAKEUP_DISABLE, &data->flags); } -#endif if (id->driver_info & BTUSB_AMP) { /* AMP controllers do not support SCO packets */