]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
Bluetooth: btusb: avoid unused function warning
authorArnd Bergmann <arnd@arndb.de>
Wed, 18 Sep 2019 19:59:02 +0000 (21:59 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 31 Dec 2019 15:44:08 +0000 (16:44 +0100)
[ Upstream commit 42d22098127d6384f789107f59caae87d7520fc4 ]

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 <arnd@arndb.de>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/bluetooth/btusb.c

index a9c35ebb30f86963009cbf76b30d6582215a15a0..23e606aaaea49f2ae947f23fd62cca49461e5395 100644 (file)
@@ -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 */