diff mbox series

[bluetooth-next] Bluetooth: btmtk: Mark all stub functions as inline

Message ID 20240710-btmtk-add-missing-inline-to-stubs-v1-1-ba33143ee148@kernel.org (mailing list archive)
State Accepted
Commit cebba8aa58ab1221f41937610e0d0741c01877f9
Headers show
Series [bluetooth-next] Bluetooth: btmtk: Mark all stub functions as inline | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
tedd_an/CheckPatch warning WARNING: Prefer a maximum 75 chars per line (possible unwrapped commit description?) #79: 254 | static void btmtk_fw_get_filename(char *buf, size_t size, u32 dev_id, total: 0 errors, 1 warnings, 91 lines checked NOTE: For some of the reported defects, checkpatch may be able to mechanically convert to the typical style using --fix or --fix-inplace. /github/workspace/src/src/13729552.patch has style problems, please review. NOTE: Ignored message types: UNKNOWN_COMMIT_ID NOTE: If any of the errors are false positives, please report them to the maintainer, see CHECKPATCH in MAINTAINERS.
tedd_an/GitLint fail WARNING: I3 - ignore-body-lines: gitlint will be switching from using Python regex 'match' (match beginning) to 'search' (match anywhere) semantics. Please review your ignore-body-lines.regex option accordingly. To remove this warning, set general.regex-style-search=True. More details: https://jorisroovers.github.io/gitlint/configuration/#regex-style-search 8: B1 Line exceeds max length (109>80): " drivers/bluetooth/btmtk.h:254:13: warning: 'btmtk_fw_get_filename' defined but not used [-Wunused-function]" 11: B1 Line exceeds max length (110>80): " drivers/bluetooth/btmtk.h:249:12: warning: 'btmtk_process_coredump' defined but not used [-Wunused-function]" 12: B1 Line exceeds max length (86>80): " 249 | static int btmtk_process_coredump(struct hci_dev *hdev, struct sk_buff *skb)" 14: B1 Line exceeds max length (111>80): " drivers/bluetooth/btmtk.h:243:12: warning: 'btmtk_register_coredump' defined but not used [-Wunused-function]" 15: B1 Line exceeds max length (84>80): " 243 | static int btmtk_register_coredump(struct hci_dev *hdev, const char *name," 17: B1 Line exceeds max length (108>80): " drivers/bluetooth/btmtk.h:233:12: warning: 'btmtk_setup_firmware' defined but not used [-Wunused-function]" 18: B1 Line exceeds max length (83>80): " 233 | static int btmtk_setup_firmware(struct hci_dev *hdev, const char *fwname," 20: B1 Line exceeds max length (113>80): " drivers/bluetooth/btmtk.h:227:12: warning: 'btmtk_setup_firmware_79xx' defined but not used [-Wunused-function]" 21: B1 Line exceeds max length (88>80): " 227 | static int btmtk_setup_firmware_79xx(struct hci_dev *hdev, const char *fwname,"
tedd_an/SubjectPrefix success Gitlint PASS
tedd_an/BuildKernel success BuildKernel PASS
tedd_an/CheckAllWarning success CheckAllWarning PASS
tedd_an/CheckSparse success CheckSparse PASS
tedd_an/CheckSmatch success CheckSparse PASS
tedd_an/BuildKernel32 success BuildKernel32 PASS
tedd_an/TestRunnerSetup success TestRunnerSetup PASS
tedd_an/TestRunner_l2cap-tester success TestRunner PASS
tedd_an/TestRunner_iso-tester success TestRunner PASS
tedd_an/TestRunner_bnep-tester success TestRunner PASS
tedd_an/TestRunner_mgmt-tester success TestRunner PASS
tedd_an/TestRunner_rfcomm-tester success TestRunner PASS
tedd_an/TestRunner_sco-tester success TestRunner PASS
tedd_an/TestRunner_ioctl-tester success TestRunner PASS
tedd_an/TestRunner_mesh-tester success TestRunner PASS
tedd_an/TestRunner_smp-tester success TestRunner PASS
tedd_an/TestRunner_userchan-tester success TestRunner PASS
tedd_an/IncrementalBuild success Incremental Build PASS

Commit Message

Nathan Chancellor July 10, 2024, 5:56 p.m. UTC
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>
---
I omitted a fixes tag because it seems like this was done over several
changes and I think breaking this up is not really necessary but I am
happy to do so if so desired.
---
 drivers/bluetooth/btmtk.h | 39 +++++++++++++++++++++------------------
 1 file changed, 21 insertions(+), 18 deletions(-)


---
base-commit: c60d1a6e1dae1623169d0d97bfd3e50003072eae
change-id: 20240710-btmtk-add-missing-inline-to-stubs-f3636bcda67e

Best regards,

Comments

bluez.test.bot@gmail.com July 10, 2024, 6:39 p.m. UTC | #1
This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=870196

---Test result---

Test Summary:
CheckPatch                    FAIL      0.94 seconds
GitLint                       FAIL      0.51 seconds
SubjectPrefix                 PASS      0.13 seconds
BuildKernel                   PASS      29.74 seconds
CheckAllWarning               PASS      32.05 seconds
CheckSparse                   PASS      37.44 seconds
CheckSmatch                   PASS      102.44 seconds
BuildKernel32                 PASS      28.64 seconds
TestRunnerSetup               PASS      523.92 seconds
TestRunner_l2cap-tester       PASS      23.87 seconds
TestRunner_iso-tester         PASS      30.35 seconds
TestRunner_bnep-tester        PASS      4.75 seconds
TestRunner_mgmt-tester        PASS      112.49 seconds
TestRunner_rfcomm-tester      PASS      7.41 seconds
TestRunner_sco-tester         PASS      17.03 seconds
TestRunner_ioctl-tester       PASS      7.83 seconds
TestRunner_mesh-tester        PASS      5.94 seconds
TestRunner_smp-tester         PASS      6.91 seconds
TestRunner_userchan-tester    PASS      5.17 seconds
IncrementalBuild              PASS      27.66 seconds

Details
##############################
Test: CheckPatch - FAIL
Desc: Run checkpatch.pl script
Output:
[bluetooth-next] Bluetooth: btmtk: Mark all stub functions as inline
WARNING: Prefer a maximum 75 chars per line (possible unwrapped commit description?)
#79: 
    254 | static void btmtk_fw_get_filename(char *buf, size_t size, u32 dev_id,

total: 0 errors, 1 warnings, 91 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

/github/workspace/src/src/13729552.patch has style problems, please review.

NOTE: Ignored message types: UNKNOWN_COMMIT_ID

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.


##############################
Test: GitLint - FAIL
Desc: Run gitlint
Output:
[bluetooth-next] Bluetooth: btmtk: Mark all stub functions as inline

WARNING: I3 - ignore-body-lines: gitlint will be switching from using Python regex 'match' (match beginning) to 'search' (match anywhere) semantics. Please review your ignore-body-lines.regex option accordingly. To remove this warning, set general.regex-style-search=True. More details: https://jorisroovers.github.io/gitlint/configuration/#regex-style-search
8: B1 Line exceeds max length (109>80): "  drivers/bluetooth/btmtk.h:254:13: warning: 'btmtk_fw_get_filename' defined but not used [-Wunused-function]"
11: B1 Line exceeds max length (110>80): "  drivers/bluetooth/btmtk.h:249:12: warning: 'btmtk_process_coredump' defined but not used [-Wunused-function]"
12: B1 Line exceeds max length (86>80): "    249 | static int btmtk_process_coredump(struct hci_dev *hdev, struct sk_buff *skb)"
14: B1 Line exceeds max length (111>80): "  drivers/bluetooth/btmtk.h:243:12: warning: 'btmtk_register_coredump' defined but not used [-Wunused-function]"
15: B1 Line exceeds max length (84>80): "    243 | static int btmtk_register_coredump(struct hci_dev *hdev, const char *name,"
17: B1 Line exceeds max length (108>80): "  drivers/bluetooth/btmtk.h:233:12: warning: 'btmtk_setup_firmware' defined but not used [-Wunused-function]"
18: B1 Line exceeds max length (83>80): "    233 | static int btmtk_setup_firmware(struct hci_dev *hdev, const char *fwname,"
20: B1 Line exceeds max length (113>80): "  drivers/bluetooth/btmtk.h:227:12: warning: 'btmtk_setup_firmware_79xx' defined but not used [-Wunused-function]"
21: B1 Line exceeds max length (88>80): "    227 | static int btmtk_setup_firmware_79xx(struct hci_dev *hdev, const char *fwname,"


---
Regards,
Linux Bluetooth
patchwork-bot+bluetooth@kernel.org July 15, 2024, 1:30 a.m. UTC | #2
Hello:

This patch was applied to bluetooth/bluetooth-next.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:

On Wed, 10 Jul 2024 10:56:24 -0700 you wrote:
> 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,
>         |            ^~~~~~~~~~~~~~~~~~~~~~~~~
> 
> [...]

Here is the summary with links:
  - [bluetooth-next] Bluetooth: btmtk: Mark all stub functions as inline
    https://git.kernel.org/bluetooth/bluetooth-next/c/cebba8aa58ab

You are awesome, thank you!
diff mbox series

Patch

diff --git a/drivers/bluetooth/btmtk.h b/drivers/bluetooth/btmtk.h
index 453ed5131a37..5df7c3296624 100644
--- a/drivers/bluetooth/btmtk.h
+++ b/drivers/bluetooth/btmtk.h
@@ -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;
 }