public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
From: Chris Lu <chris.lu@mediatek.com>
To: Marcel Holtmann <marcel@holtmann.org>,
	Johan Hedberg <johan.hedberg@gmail.com>,
	Luiz Von Dentz <luiz.dentz@gmail.com>
Cc: Sean Wang <sean.wang@mediatek.com>,
	Aaron Hou <aaron.hou@mediatek.com>,
	Steve Lee <steve.lee@mediatek.com>,
	linux-bluetooth <linux-bluetooth@vger.kernel.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	linux-mediatek <linux-mediatek@lists.infradead.org>,
	Chris Lu <chris.lu@mediatek.com>
Subject: [PATCH] Bluetooth: btmtk: Fix function-declaration build error
Date: Mon, 22 Jul 2024 14:22:16 +0800	[thread overview]
Message-ID: <20240722062216.16090-1-chris.lu@mediatek.com> (raw)

Separate out the declaration of usb related function into another
if/else condition in btmtk.h, avoiding function-declaration issue
happened when CONFIG_BT_HCIBTUSB was defined but CONFIG_BT_HCIBTUSB_MTK
wasn't.

'btmtk_usb_subsys_reset';
ISO C99 and later do not support implicit
function declarations [-Wimplicit-function-declaration]
'alloc_mtk_intr_urb';
ISO C99 and later do not support implicit
function declarations [-Wimplicit-function-declaration]
'btmtk_usb_setup';
ISO C99 and later do not support implicit
function declarations [-Wimplicit-function-declaration]
'btmtk_usb_shutdown';ISO C99 and later do not support
implicit function declarations [-Wimplicit-function-declaration]

Fixes: 52828ea60dfd ("Bluetooth: btmtk: Fix btmtk.c undefined reference build error")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202407200904.hRqT3JKD-lkp@intel.com/
Signed-off-by: Chris Lu <chris.lu@mediatek.com>
---
 drivers/bluetooth/btmtk.h | 35 ++++++++++++++++++-----------------
 1 file changed, 18 insertions(+), 17 deletions(-)

diff --git a/drivers/bluetooth/btmtk.h b/drivers/bluetooth/btmtk.h
index 6fc69cd8636b..fcc44800cf29 100644
--- a/drivers/bluetooth/btmtk.h
+++ b/drivers/bluetooth/btmtk.h
@@ -201,23 +201,6 @@ int btmtk_process_coredump(struct hci_dev *hdev, struct sk_buff *skb);
 
 void btmtk_fw_get_filename(char *buf, size_t size, u32 dev_id, u32 fw_ver,
 			   u32 fw_flavor);
-
-#if IS_ENABLED(CONFIG_BT_HCIBTUSB_MTK)
-int btmtk_usb_subsys_reset(struct hci_dev *hdev, u32 dev_id);
-
-int btmtk_usb_recv_acl(struct hci_dev *hdev, struct sk_buff *skb);
-
-struct urb *alloc_mtk_intr_urb(struct hci_dev *hdev, struct sk_buff *skb,
-			       usb_complete_t tx_complete);
-
-int btmtk_usb_resume(struct hci_dev *hdev);
-
-int btmtk_usb_suspend(struct hci_dev *hdev);
-
-int btmtk_usb_setup(struct hci_dev *hdev);
-
-int btmtk_usb_shutdown(struct hci_dev *hdev);
-#endif
 #else
 
 static inline int btmtk_set_bdaddr(struct hci_dev *hdev,
@@ -259,7 +242,25 @@ static inline void btmtk_fw_get_filename(char *buf, size_t size, u32 dev_id,
 					 u32 fw_ver, u32 fw_flavor)
 {
 }
+#endif
+
+/* USB interface related functions */
+#if IS_ENABLED(CONFIG_BT_HCIBTUSB_MTK)
+int btmtk_usb_subsys_reset(struct hci_dev *hdev, u32 dev_id);
+
+int btmtk_usb_recv_acl(struct hci_dev *hdev, struct sk_buff *skb);
+
+struct urb *alloc_mtk_intr_urb(struct hci_dev *hdev, struct sk_buff *skb,
+			       usb_complete_t tx_complete);
 
+int btmtk_usb_resume(struct hci_dev *hdev);
+
+int btmtk_usb_suspend(struct hci_dev *hdev);
+
+int btmtk_usb_setup(struct hci_dev *hdev);
+
+int btmtk_usb_shutdown(struct hci_dev *hdev);
+#else
 static inline int btmtk_usb_subsys_reset(struct hci_dev *hdev, u32 dev_id)
 {
 	return -EOPNOTSUPP;
-- 
2.18.0


             reply	other threads:[~2024-07-22  6:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-22  6:22 Chris Lu [this message]
2024-07-22  7:03 ` Bluetooth: btmtk: Fix function-declaration build error bluez.test.bot
2024-07-22 14:46   ` Luiz Augusto von Dentz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240722062216.16090-1-chris.lu@mediatek.com \
    --to=chris.lu@mediatek.com \
    --cc=aaron.hou@mediatek.com \
    --cc=johan.hedberg@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=luiz.dentz@gmail.com \
    --cc=marcel@holtmann.org \
    --cc=sean.wang@mediatek.com \
    --cc=steve.lee@mediatek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox