From patchwork Mon Aug 13 22:04:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 144054 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp3574972ljj; Mon, 13 Aug 2018 15:04:32 -0700 (PDT) X-Google-Smtp-Source: AA+uWPzw/x+VIkUJs2i8oQg1/uctjJDz+gYrAh+oybeodJuVu1BKn4ykqn+cB69o0O3U4bOESNja X-Received: by 2002:a17:902:2f43:: with SMTP id s61-v6mr17843162plb.176.1534197872709; Mon, 13 Aug 2018 15:04:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534197872; cv=none; d=google.com; s=arc-20160816; b=APcMHBv1TRu5thOERt6Xnb1w483mABZCjh5WBi9ySVtTTbt9ou6LE0yY5xg58nyQ17 weoENm5kbIDFAuM4fu3KslcD1te6jrt9+5hTtYaEPvnfUYPhliAd8vICJg0E9ItLsRyb tnYyHW3ALpXZRJMwVU5Hh+hzyAWq6yQEtL8JQptY/kb3dxx+HDZxREF2HOM08vgkOtnD tkYU/qL7P4zHmvBrZ63xlRIFTH9MVmVzmJ9W7LctG1Gkx9AueAq+1ujFDQeL72dq5GQH waF9HtAj7sxD0wafDci2MIgbJ7tvg6SuY4H/U8o3oJH4w1ojLg22IfaKCaI10yKU50Z6 fFQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=tLe7HMPJY8e6JSbk/SC3gMvrqMqcAI3pRMn59GrvPT8=; b=OUolBoKtxHkZMbKoXqVrFiLDQ6+ElclBRRx6iSLVGQb3g3GRHRpDlTqdZJw7YBPuSw HhLw0Db/W0UKmpCH82tGwxSLIjJEbokDcluFuTmW3hwjqOtJgmof7Hy5AhhvB/cO+6Yg Za64qMKPoJkm9sSH2BkS6UwFTtpzqWOvksdY85caD6q86MGWVF8q5SoMSHjSKjzVfYb+ W0/qca8U7KVzXUtJMJSRVe6wEz20J5XWtmRpCYvSQCVLFSSAnTP1Bt3HxowQp6tmshac pnDJP84QD4bTsOfDvgl0J+jHc1vXJAlxeFv7gDZ9qJpob/Bxi3UQLAsvU67ulz0l6zO1 damQ== 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 x127-v6si18006340pgb.618.2018.08.13.15.04.32; Mon, 13 Aug 2018 15:04:32 -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 S1731575AbeHNAsh (ORCPT + 31 others); Mon, 13 Aug 2018 20:48:37 -0400 Received: from mout.kundenserver.de ([212.227.126.187]:54598 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730121AbeHNAsh (ORCPT ); Mon, 13 Aug 2018 20:48:37 -0400 Received: from wuerfel.lan ([109.193.40.16]) by mrelayeu.kundenserver.de (mreue002 [212.227.15.129]) with ESMTPA (Nemesis) id 0MVVCo-1fNQKY3i3i-00YfOv; Tue, 14 Aug 2018 00:04:21 +0200 From: Arnd Bergmann To: Marcel Holtmann , Johan Hedberg Cc: Arnd Bergmann , Hans de Goede , Jeremy Cline , Kees Cook , linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] bluetooth: hci_h5: avoid unused variable warnings Date: Tue, 14 Aug 2018 00:04:13 +0200 Message-Id: <20180813220419.4168133-1-arnd@arndb.de> X-Mailer: git-send-email 2.18.0 X-Provags-ID: V03:K1:8xLmc/XImooT8UUp+5ub3w2ddoGDcCp6RfI+gHJVs7fYu0Aks2E O3gqX4pZBRwgZh5j0JAJFwMw0aouFKFXhDw9dxlSBRzqldVFGl6PWbdm9t4ged40PbgNNyD wsoAOwkns3A0jmnIiVLf+Ck/sLGvzMkgaTlYQ59aUFFBzkckDGAFT+EpKZZajJ80vZ2vrmZ ayq5zK/7N7YWCEBfYEOvA== X-UI-Out-Filterresults: notjunk:1; V01:K0:LuFrXdvL3pU=:PhXi+3Aw0y+PJ8OfHZrnPK uGaC0+FdxvKyf8GW6+hkxWhlFZ5DbBhRJdq8g1WQQ5YqzK3nitVVPdF8kXWsLulqpEPaxzDgI u4VmFnfkDWoM5ionn/TfnVFGcM23h8DUBi1ztnLCp+H1JeYqSxg8hCjeuS3anCtfaTxP+Gx0g MSBck6A5vKt0lT4wj+52rDnH4De4NagRBYqcjXynodKvRXg7nbN8dQqAYVUhVPQ/oSyramG31 EOpHTeUrjerui2OtiTj30nhHK6jyUq5LqZYXS7MNS0aO4v1DlT097tXfF0TkgzVthyqPkb39o aSbIa66EIMqsgIhuLB7ZOkz/Ls+uczjOh33UWYS2STAlp0n7fOdtj16faAkCQ/lKG91Hn3x3i W4dpUb0+R9y1cGq12CLcI3YOhTXFeyvk2FglziyOfxOJsKRL44JyRU/OIlsgoAKa8K7ReDaSO 1PVD8Y3WPxRs0f/G6ucJHRuqZrbPXURZN73BPYF67wHy1p+DCB80xbu+0twBgV4K8g49XIDSs /pr6HmClHbwfkHrHHaMo9IIgd4BbNUX9C2rXAPkHVMyaRyGf1vwJtEAAim5qvYZHcG2/NqQo7 rh9eVT/jTiyZ7F36/CS6EquBWazOAibLXcvnv+KoshPZJVNeMyVg4LbZnO+zq0Mbmss4tgJfv uiqCwTSJcX3vU25lYcQXNUTNmmtqA4K4Qugm316RNCIvtjD5XrXQOhwf/k/tmuoamsCE= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When CONFIG_BT_HCIUART_RTL is disabled, the hci_h5 driver produces a build warning because of an incorrect set of #ifdef guards: drivers/bluetooth/hci_h5.c:920:22: error: 'rtl_vnd' defined but not used [-Werror=unused-variable] Replacing the #ifdef with an IS_ENABLED() check shuts up the error and simplifies the logic. Signed-off-by: Arnd Bergmann --- drivers/bluetooth/hci_h5.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) -- 2.18.0 diff --git a/drivers/bluetooth/hci_h5.c b/drivers/bluetooth/hci_h5.c index 8eede1197cd2..b10e64ba0ff4 100644 --- a/drivers/bluetooth/hci_h5.c +++ b/drivers/bluetooth/hci_h5.c @@ -841,7 +841,6 @@ static void h5_serdev_remove(struct serdev_device *serdev) hci_uart_unregister_device(&h5->serdev_hu); } -#ifdef CONFIG_BT_HCIUART_RTL static int h5_btrtl_setup(struct h5 *h5) { struct btrtl_device_info *btrtl_dev; @@ -923,24 +922,21 @@ static struct h5_vnd rtl_vnd = { .close = h5_btrtl_close, .acpi_gpio_map = acpi_btrtl_gpios, }; -#endif -#ifdef CONFIG_ACPI static const struct acpi_device_id h5_acpi_match[] = { -#ifdef CONFIG_BT_HCIUART_RTL { "OBDA8723", (kernel_ulong_t)&rtl_vnd }, -#endif { }, }; MODULE_DEVICE_TABLE(acpi, h5_acpi_match); -#endif static struct serdev_device_driver h5_serdev_driver = { .probe = h5_serdev_probe, .remove = h5_serdev_remove, .driver = { .name = "hci_uart_h5", - .acpi_match_table = ACPI_PTR(h5_acpi_match), + .acpi_match_table = (IS_ENABLED(CONFIG_BT_HCIUART_RTL) && + IS_ENABLED(CONFIG_ACPI)) ? + h5_acpi_match : 0, }, };