Skip to content

Commit

Permalink
Bluetooth: btmtk: Mark all stub functions as inline
Browse files Browse the repository at this point in the history
Several recent patches added static stubs to btmtk.h without the inline
keyword, which causes instances of -Wunused-function when those stubs
are not used anywhere in a file that includes the header:

  In file included from drivers/bluetooth/btusb.c:28:
  drivers/bluetooth/btmtk.h:254:13: warning: 'btmtk_fw_get_filename' defined but not used [-Wunused-function]
    254 | static void btmtk_fw_get_filename(char *buf, size_t size, u32 dev_id,
        |             ^~~~~~~~~~~~~~~~~~~~~
  drivers/bluetooth/btmtk.h:249:12: warning: 'btmtk_process_coredump' defined but not used [-Wunused-function]
    249 | static int btmtk_process_coredump(struct hci_dev *hdev, struct sk_buff *skb)
        |            ^~~~~~~~~~~~~~~~~~~~~~
  drivers/bluetooth/btmtk.h:243:12: warning: 'btmtk_register_coredump' defined but not used [-Wunused-function]
    243 | static int btmtk_register_coredump(struct hci_dev *hdev, const char *name,
        |            ^~~~~~~~~~~~~~~~~~~~~~~
  drivers/bluetooth/btmtk.h:233:12: warning: 'btmtk_setup_firmware' defined but not used [-Wunused-function]
    233 | static int btmtk_setup_firmware(struct hci_dev *hdev, const char *fwname,
        |            ^~~~~~~~~~~~~~~~~~~~
  drivers/bluetooth/btmtk.h:227:12: warning: 'btmtk_setup_firmware_79xx' defined but not used [-Wunused-function]
    227 | static int btmtk_setup_firmware_79xx(struct hci_dev *hdev, const char *fwname,
        |            ^~~~~~~~~~~~~~~~~~~~~~~~~

Add inline to all the stubs in btmtk.h (even ones that do not currently
have any warnings associated with them) to ensure there are never unused
function warnings from these stubs, as is customary for the kernel.

Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
  • Loading branch information
nathanchance authored and Vudentz committed Jul 15, 2024
1 parent 84f9288 commit 23e8845
Showing 1 changed file with 21 additions and 18 deletions.
39 changes: 21 additions & 18 deletions drivers/bluetooth/btmtk.h
Original file line number Diff line number Diff line change
Expand Up @@ -224,70 +224,73 @@ static inline int btmtk_set_bdaddr(struct hci_dev *hdev,
return -EOPNOTSUPP;
}

static int btmtk_setup_firmware_79xx(struct hci_dev *hdev, const char *fwname,
wmt_cmd_sync_func_t wmt_cmd_sync)
static inline int btmtk_setup_firmware_79xx(struct hci_dev *hdev,
const char *fwname,
wmt_cmd_sync_func_t wmt_cmd_sync)
{
return -EOPNOTSUPP;
}

static int btmtk_setup_firmware(struct hci_dev *hdev, const char *fwname,
wmt_cmd_sync_func_t wmt_cmd_sync)
static inline int btmtk_setup_firmware(struct hci_dev *hdev, const char *fwname,
wmt_cmd_sync_func_t wmt_cmd_sync)
{
return -EOPNOTSUPP;
}

static void btmtk_reset_sync(struct hci_dev *hdev)
static inline void btmtk_reset_sync(struct hci_dev *hdev)
{
}

static int btmtk_register_coredump(struct hci_dev *hdev, const char *name,
u32 fw_version)
static inline int btmtk_register_coredump(struct hci_dev *hdev,
const char *name, u32 fw_version)
{
return -EOPNOTSUPP;
}

static int btmtk_process_coredump(struct hci_dev *hdev, struct sk_buff *skb)
static inline int btmtk_process_coredump(struct hci_dev *hdev,
struct sk_buff *skb)
{
return -EOPNOTSUPP;
}

static void btmtk_fw_get_filename(char *buf, size_t size, u32 dev_id,
u32 fw_ver, u32 fw_flavor)
static inline void btmtk_fw_get_filename(char *buf, size_t size, u32 dev_id,
u32 fw_ver, u32 fw_flavor)
{
}

static int btmtk_usb_subsys_reset(struct hci_dev *hdev, u32 dev_id)
static inline int btmtk_usb_subsys_reset(struct hci_dev *hdev, u32 dev_id)
{
return -EOPNOTSUPP;
}

static int btmtk_usb_recv_acl(struct hci_dev *hdev, struct sk_buff *skb)
static inline int btmtk_usb_recv_acl(struct hci_dev *hdev, struct sk_buff *skb)
{
return -EOPNOTSUPP;
}

static struct urb *alloc_mtk_intr_urb(struct hci_dev *hdev, struct sk_buff *skb,
usb_complete_t tx_complete)
static inline struct urb *alloc_mtk_intr_urb(struct hci_dev *hdev,
struct sk_buff *skb,
usb_complete_t tx_complete)
{
return ERR_PTR(-EOPNOTSUPP);
}

static int btmtk_usb_resume(struct hci_dev *hdev)
static inline int btmtk_usb_resume(struct hci_dev *hdev)
{
return -EOPNOTSUPP;
}

static int btmtk_usb_suspend(struct hci_dev *hdev)
static inline int btmtk_usb_suspend(struct hci_dev *hdev)
{
return -EOPNOTSUPP;
}

static int btmtk_usb_setup(struct hci_dev *hdev)
static inline int btmtk_usb_setup(struct hci_dev *hdev)
{
return -EOPNOTSUPP;
}

static int btmtk_usb_shutdown(struct hci_dev *hdev)
static inline int btmtk_usb_shutdown(struct hci_dev *hdev)
{
return -EOPNOTSUPP;
}
Expand Down

0 comments on commit 23e8845

Please sign in to comment.