All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Bluetooth: btmtk: fix handling of CONFIG_DEV_COREDUMP not being defined
@ 2023-07-02 20:26 ` Tom Rix
  0 siblings, 0 replies; 3+ messages in thread
From: Tom Rix @ 2023-07-02 20:26 UTC (permalink / raw)
  To: marcel, johan.hedberg, luiz.dentz, matthias.bgg,
	angelogioacchino.delregno, jing.cai, sean.wang, chris.lu
  Cc: linux-bluetooth, linux-kernel, linux-arm-kernel, linux-mediatek,
	Tom Rix

When CONFIG_DEV_COREDUMP is not defined, there is this error
drivers/bluetooth/btmtk.c: In function ‘btmtk_process_coredump’:
drivers/bluetooth/btmtk.c:386:44: error: ‘struct hci_dev’ has no member named ‘dump’
  386 |                 schedule_delayed_work(&hdev->dump.dump_timeout,
      |                                            ^~

The runtime IS_ENABLED(CONFIG_DEV_COREDUMP) is not enough to
prevent the compiletime error of accessing the dump element of hci_dev.
So switch to #ifdef.

Fixes: 872f8c253cb9 ("Bluetooth: btusb: mediatek: add MediaTek devcoredump support")
Signed-off-by: Tom Rix <trix@redhat.com>
---
 drivers/bluetooth/btmtk.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/bluetooth/btmtk.c b/drivers/bluetooth/btmtk.c
index 786f775196ae..12769e95bf55 100644
--- a/drivers/bluetooth/btmtk.c
+++ b/drivers/bluetooth/btmtk.c
@@ -369,11 +369,9 @@ EXPORT_SYMBOL_GPL(btmtk_register_coredump);
 
 int btmtk_process_coredump(struct hci_dev *hdev, struct sk_buff *skb)
 {
+	int err = 0;
+#ifdef CONFIG_DEV_COREDUMP
 	struct btmediatek_data *data = hci_get_priv(hdev);
-	int err;
-
-	if (!IS_ENABLED(CONFIG_DEV_COREDUMP))
-		return 0;
 
 	switch (data->cd_info.state) {
 	case HCI_DEVCOREDUMP_IDLE:
@@ -407,7 +405,7 @@ int btmtk_process_coredump(struct hci_dev *hdev, struct sk_buff *skb)
 
 	if (err < 0)
 		kfree_skb(skb);
-
+#endif
 	return err;
 }
 EXPORT_SYMBOL_GPL(btmtk_process_coredump);
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH] Bluetooth: btmtk: fix handling of CONFIG_DEV_COREDUMP not being defined
@ 2023-07-02 20:26 ` Tom Rix
  0 siblings, 0 replies; 3+ messages in thread
From: Tom Rix @ 2023-07-02 20:26 UTC (permalink / raw)
  To: marcel, johan.hedberg, luiz.dentz, matthias.bgg,
	angelogioacchino.delregno, jing.cai, sean.wang, chris.lu
  Cc: linux-bluetooth, linux-kernel, linux-arm-kernel, linux-mediatek,
	Tom Rix

When CONFIG_DEV_COREDUMP is not defined, there is this error
drivers/bluetooth/btmtk.c: In function ‘btmtk_process_coredump’:
drivers/bluetooth/btmtk.c:386:44: error: ‘struct hci_dev’ has no member named ‘dump’
  386 |                 schedule_delayed_work(&hdev->dump.dump_timeout,
      |                                            ^~

The runtime IS_ENABLED(CONFIG_DEV_COREDUMP) is not enough to
prevent the compiletime error of accessing the dump element of hci_dev.
So switch to #ifdef.

Fixes: 872f8c253cb9 ("Bluetooth: btusb: mediatek: add MediaTek devcoredump support")
Signed-off-by: Tom Rix <trix@redhat.com>
---
 drivers/bluetooth/btmtk.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/bluetooth/btmtk.c b/drivers/bluetooth/btmtk.c
index 786f775196ae..12769e95bf55 100644
--- a/drivers/bluetooth/btmtk.c
+++ b/drivers/bluetooth/btmtk.c
@@ -369,11 +369,9 @@ EXPORT_SYMBOL_GPL(btmtk_register_coredump);
 
 int btmtk_process_coredump(struct hci_dev *hdev, struct sk_buff *skb)
 {
+	int err = 0;
+#ifdef CONFIG_DEV_COREDUMP
 	struct btmediatek_data *data = hci_get_priv(hdev);
-	int err;
-
-	if (!IS_ENABLED(CONFIG_DEV_COREDUMP))
-		return 0;
 
 	switch (data->cd_info.state) {
 	case HCI_DEVCOREDUMP_IDLE:
@@ -407,7 +405,7 @@ int btmtk_process_coredump(struct hci_dev *hdev, struct sk_buff *skb)
 
 	if (err < 0)
 		kfree_skb(skb);
-
+#endif
 	return err;
 }
 EXPORT_SYMBOL_GPL(btmtk_process_coredump);
-- 
2.27.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* RE: Bluetooth: btmtk: fix handling of CONFIG_DEV_COREDUMP not being defined
  2023-07-02 20:26 ` Tom Rix
  (?)
@ 2023-07-02 20:57 ` bluez.test.bot
  -1 siblings, 0 replies; 3+ messages in thread
From: bluez.test.bot @ 2023-07-02 20:57 UTC (permalink / raw)
  To: linux-bluetooth, trix

[-- Attachment #1: Type: text/plain, Size: 2074 bytes --]

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=761864

---Test result---

Test Summary:
CheckPatch                    PASS      0.67 seconds
GitLint                       FAIL      0.57 seconds
SubjectPrefix                 PASS      0.11 seconds
BuildKernel                   PASS      32.07 seconds
CheckAllWarning               PASS      34.90 seconds
CheckSparse                   PASS      39.39 seconds
CheckSmatch                   PASS      110.87 seconds
BuildKernel32                 PASS      30.47 seconds
TestRunnerSetup               PASS      440.12 seconds
TestRunner_l2cap-tester       PASS      12.85 seconds
TestRunner_iso-tester         PASS      23.62 seconds
TestRunner_bnep-tester        PASS      5.48 seconds
TestRunner_mgmt-tester        PASS      129.83 seconds
TestRunner_rfcomm-tester      PASS      8.95 seconds
TestRunner_sco-tester         PASS      10.41 seconds
TestRunner_ioctl-tester       PASS      9.70 seconds
TestRunner_mesh-tester        PASS      7.01 seconds
TestRunner_smp-tester         PASS      8.15 seconds
TestRunner_userchan-tester    PASS      5.81 seconds
IncrementalBuild              PASS      28.73 seconds

Details
##############################
Test: GitLint - FAIL
Desc: Run gitlint
Output:
Bluetooth: btmtk: fix handling of CONFIG_DEV_COREDUMP not being defined

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
5: B1 Line exceeds max length (84>80): "drivers/bluetooth/btmtk.c:386:44: error: ‘struct hci_dev’ has no member named ‘dump’"


---
Regards,
Linux Bluetooth


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-07-02 20:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-02 20:26 [PATCH] Bluetooth: btmtk: fix handling of CONFIG_DEV_COREDUMP not being defined Tom Rix
2023-07-02 20:26 ` Tom Rix
2023-07-02 20:57 ` bluez.test.bot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.