* [bluetooth-next:master 83/84] drivers/bluetooth/btmtksdio.c:442:33: error: array type has incomplete element type 'struct h4_recv_pkt' @ 2025-08-29 20:34 kernel test robot 2025-08-30 0:50 ` [PATCH] Bluetooth: btmtksdio: Fix build after header cleanup Calvin Owens 0 siblings, 1 reply; 12+ messages in thread From: kernel test robot @ 2025-08-29 20:34 UTC (permalink / raw) To: Calvin Owens Cc: oe-kbuild-all, linux-bluetooth, Luiz Augusto von Dentz, Paul Menzel tree: https://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git master head: 02925b3b935e2203077ec974b93bf2d5f84ab754 commit: 0e272fc7e17d429b018d4f2d9c5cacab10f5fab5 [83/84] Bluetooth: remove duplicate h4_recv_buf() in header config: nios2-randconfig-002-20250830 (https://download.01.org/0day-ci/archive/20250830/202508300413.OnIedvRh-lkp@intel.com/config) compiler: nios2-linux-gcc (GCC) 8.5.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250830/202508300413.OnIedvRh-lkp@intel.com/reproduce) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot <lkp@intel.com> | Closes: https://lore.kernel.org/oe-kbuild-all/202508300413.OnIedvRh-lkp@intel.com/ All error/warnings (new ones prefixed by >>): >> drivers/bluetooth/btmtksdio.c:442:33: error: array type has incomplete element type 'struct h4_recv_pkt' static const struct h4_recv_pkt mtk_recv_pkts[] = { ^~~~~~~~~~~~~ >> drivers/bluetooth/btmtksdio.c:443:4: error: 'H4_RECV_ACL' undeclared here (not in a function); did you mean 'IP_RECVTTL'? { H4_RECV_ACL, .recv = btmtksdio_recv_acl }, ^~~~~~~~~~~ IP_RECVTTL >> drivers/bluetooth/btmtksdio.c:443:22: error: field name not in record or union initializer { H4_RECV_ACL, .recv = btmtksdio_recv_acl }, ^ drivers/bluetooth/btmtksdio.c:443:22: note: (near initialization for 'mtk_recv_pkts') >> drivers/bluetooth/btmtksdio.c:444:4: error: 'H4_RECV_SCO' undeclared here (not in a function) { H4_RECV_SCO, .recv = hci_recv_frame }, ^~~~~~~~~~~ drivers/bluetooth/btmtksdio.c:444:22: error: field name not in record or union initializer { H4_RECV_SCO, .recv = hci_recv_frame }, ^ drivers/bluetooth/btmtksdio.c:444:22: note: (near initialization for 'mtk_recv_pkts') >> drivers/bluetooth/btmtksdio.c:445:4: error: 'H4_RECV_EVENT' undeclared here (not in a function); did you mean 'BPF_PERF_EVENT'? { H4_RECV_EVENT, .recv = btmtksdio_recv_event }, ^~~~~~~~~~~~~ BPF_PERF_EVENT drivers/bluetooth/btmtksdio.c:445:22: error: field name not in record or union initializer { H4_RECV_EVENT, .recv = btmtksdio_recv_event }, ^ drivers/bluetooth/btmtksdio.c:445:22: note: (near initialization for 'mtk_recv_pkts') In file included from include/linux/cleanup.h:5, from include/linux/irqflags.h:17, from include/asm-generic/cmpxchg.h:15, from ./arch/nios2/include/generated/asm/cmpxchg.h:1, from include/asm-generic/atomic.h:12, from ./arch/nios2/include/generated/asm/atomic.h:1, from include/linux/atomic.h:7, from drivers/bluetooth/btmtksdio.c:14: drivers/bluetooth/btmtksdio.c: In function 'btmtksdio_rx_packet': include/linux/compiler.h:197:82: error: expression in static assertion is not an integer #define __BUILD_BUG_ON_ZERO_MSG(e, msg, ...) ((int)sizeof(struct {_Static_assert(!(e), msg);})) ^ include/linux/compiler.h:202:28: note: in expansion of macro '__BUILD_BUG_ON_ZERO_MSG' #define __must_be_array(a) __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \ ^~~~~~~~~~~~~~~~~~~~~~~ include/linux/array_size.h:11:59: note: in expansion of macro '__must_be_array' #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr)) ^~~~~~~~~~~~~~~ drivers/bluetooth/btmtksdio.c:451:19: note: in expansion of macro 'ARRAY_SIZE' int pkts_count = ARRAY_SIZE(mtk_recv_pkts); ^~~~~~~~~~ >> drivers/bluetooth/btmtksdio.c:493:34: error: invalid use of undefined type 'struct h4_recv_pkt' if (sdio_hdr->bt_type == (&pkts[i])->type) ^ >> drivers/bluetooth/btmtksdio.c:493:34: error: dereferencing pointer to incomplete type 'const struct h4_recv_pkt' drivers/bluetooth/btmtksdio.c:504:23: error: invalid use of undefined type 'struct h4_recv_pkt' if (skb->len < (&pkts[i])->hlen) { ^ drivers/bluetooth/btmtksdio.c:509:16: error: invalid use of undefined type 'struct h4_recv_pkt' switch ((&pkts[i])->lsize) { ^ drivers/bluetooth/btmtksdio.c:511:26: error: invalid use of undefined type 'struct h4_recv_pkt' dlen = skb->data[(&pkts[i])->loff]; ^ drivers/bluetooth/btmtksdio.c:515:15: error: invalid use of undefined type 'struct h4_recv_pkt' (&pkts[i])->loff); ^ drivers/bluetooth/btmtksdio.c:521:30: error: invalid use of undefined type 'struct h4_recv_pkt' pad_size = skb->len - (&pkts[i])->hlen - dlen; ^ drivers/bluetooth/btmtksdio.c:533:8: error: invalid use of undefined type 'struct h4_recv_pkt' (&pkts[i])->recv(bdev->hdev, skb); ^ At top level: >> drivers/bluetooth/btmtksdio.c:442:33: warning: 'mtk_recv_pkts' defined but not used [-Wunused-variable] static const struct h4_recv_pkt mtk_recv_pkts[] = { ^~~~~~~~~~~~~ vim +442 drivers/bluetooth/btmtksdio.c db57b625912abc Sean Wang 2021-11-20 441 9aebfd4a2200ab Sean Wang 2019-03-08 @442 static const struct h4_recv_pkt mtk_recv_pkts[] = { db57b625912abc Sean Wang 2021-11-20 @443 { H4_RECV_ACL, .recv = btmtksdio_recv_acl }, 9aebfd4a2200ab Sean Wang 2019-03-08 @444 { H4_RECV_SCO, .recv = hci_recv_frame }, 9aebfd4a2200ab Sean Wang 2019-03-08 @445 { H4_RECV_EVENT, .recv = btmtksdio_recv_event }, 9aebfd4a2200ab Sean Wang 2019-03-08 446 }; 9aebfd4a2200ab Sean Wang 2019-03-08 447 9aebfd4a2200ab Sean Wang 2019-03-08 448 static int btmtksdio_rx_packet(struct btmtksdio_dev *bdev, u16 rx_size) 9aebfd4a2200ab Sean Wang 2019-03-08 449 { 9aebfd4a2200ab Sean Wang 2019-03-08 450 const struct h4_recv_pkt *pkts = mtk_recv_pkts; 9aebfd4a2200ab Sean Wang 2019-03-08 451 int pkts_count = ARRAY_SIZE(mtk_recv_pkts); 9aebfd4a2200ab Sean Wang 2019-03-08 452 struct mtkbtsdio_hdr *sdio_hdr; 9aebfd4a2200ab Sean Wang 2019-03-08 453 int err, i, pad_size; 9aebfd4a2200ab Sean Wang 2019-03-08 454 struct sk_buff *skb; 9aebfd4a2200ab Sean Wang 2019-03-08 455 u16 dlen; 9aebfd4a2200ab Sean Wang 2019-03-08 456 9aebfd4a2200ab Sean Wang 2019-03-08 457 if (rx_size < sizeof(*sdio_hdr)) 9aebfd4a2200ab Sean Wang 2019-03-08 458 return -EILSEQ; 9aebfd4a2200ab Sean Wang 2019-03-08 459 9aebfd4a2200ab Sean Wang 2019-03-08 460 /* A SDIO packet is exactly containing a Bluetooth packet */ 9aebfd4a2200ab Sean Wang 2019-03-08 461 skb = bt_skb_alloc(rx_size, GFP_KERNEL); 9aebfd4a2200ab Sean Wang 2019-03-08 462 if (!skb) 9aebfd4a2200ab Sean Wang 2019-03-08 463 return -ENOMEM; 9aebfd4a2200ab Sean Wang 2019-03-08 464 9aebfd4a2200ab Sean Wang 2019-03-08 465 skb_put(skb, rx_size); 9aebfd4a2200ab Sean Wang 2019-03-08 466 9aebfd4a2200ab Sean Wang 2019-03-08 467 err = sdio_readsb(bdev->func, skb->data, MTK_REG_CRDR, rx_size); 9aebfd4a2200ab Sean Wang 2019-03-08 468 if (err < 0) 9aebfd4a2200ab Sean Wang 2019-03-08 469 goto err_kfree_skb; 9aebfd4a2200ab Sean Wang 2019-03-08 470 9aebfd4a2200ab Sean Wang 2019-03-08 471 sdio_hdr = (void *)skb->data; 9aebfd4a2200ab Sean Wang 2019-03-08 472 9aebfd4a2200ab Sean Wang 2019-03-08 473 /* We assume the default error as -EILSEQ simply to make the error path 9aebfd4a2200ab Sean Wang 2019-03-08 474 * be cleaner. 9aebfd4a2200ab Sean Wang 2019-03-08 475 */ 9aebfd4a2200ab Sean Wang 2019-03-08 476 err = -EILSEQ; 9aebfd4a2200ab Sean Wang 2019-03-08 477 9aebfd4a2200ab Sean Wang 2019-03-08 478 if (rx_size != le16_to_cpu(sdio_hdr->len)) { 9aebfd4a2200ab Sean Wang 2019-03-08 479 bt_dev_err(bdev->hdev, "Rx size in sdio header is mismatched "); 9aebfd4a2200ab Sean Wang 2019-03-08 480 goto err_kfree_skb; 9aebfd4a2200ab Sean Wang 2019-03-08 481 } 9aebfd4a2200ab Sean Wang 2019-03-08 482 9aebfd4a2200ab Sean Wang 2019-03-08 483 hci_skb_pkt_type(skb) = sdio_hdr->bt_type; 9aebfd4a2200ab Sean Wang 2019-03-08 484 9aebfd4a2200ab Sean Wang 2019-03-08 485 /* Remove MediaTek SDIO header */ 9aebfd4a2200ab Sean Wang 2019-03-08 486 skb_pull(skb, sizeof(*sdio_hdr)); 9aebfd4a2200ab Sean Wang 2019-03-08 487 9aebfd4a2200ab Sean Wang 2019-03-08 488 /* We have to dig into the packet to get payload size and then know how 9aebfd4a2200ab Sean Wang 2019-03-08 489 * many padding bytes at the tail, these padding bytes should be removed 9aebfd4a2200ab Sean Wang 2019-03-08 490 * before the packet is indicated to the core layer. 9aebfd4a2200ab Sean Wang 2019-03-08 491 */ 9aebfd4a2200ab Sean Wang 2019-03-08 492 for (i = 0; i < pkts_count; i++) { 9aebfd4a2200ab Sean Wang 2019-03-08 @493 if (sdio_hdr->bt_type == (&pkts[i])->type) 9aebfd4a2200ab Sean Wang 2019-03-08 494 break; 9aebfd4a2200ab Sean Wang 2019-03-08 495 } 9aebfd4a2200ab Sean Wang 2019-03-08 496 9aebfd4a2200ab Sean Wang 2019-03-08 497 if (i >= pkts_count) { 9aebfd4a2200ab Sean Wang 2019-03-08 498 bt_dev_err(bdev->hdev, "Invalid bt type 0x%02x", 9aebfd4a2200ab Sean Wang 2019-03-08 499 sdio_hdr->bt_type); 9aebfd4a2200ab Sean Wang 2019-03-08 500 goto err_kfree_skb; 9aebfd4a2200ab Sean Wang 2019-03-08 501 } 9aebfd4a2200ab Sean Wang 2019-03-08 502 9aebfd4a2200ab Sean Wang 2019-03-08 503 /* Remaining bytes cannot hold a header*/ 9aebfd4a2200ab Sean Wang 2019-03-08 504 if (skb->len < (&pkts[i])->hlen) { 9aebfd4a2200ab Sean Wang 2019-03-08 505 bt_dev_err(bdev->hdev, "The size of bt header is mismatched"); 9aebfd4a2200ab Sean Wang 2019-03-08 506 goto err_kfree_skb; 9aebfd4a2200ab Sean Wang 2019-03-08 507 } 9aebfd4a2200ab Sean Wang 2019-03-08 508 9aebfd4a2200ab Sean Wang 2019-03-08 509 switch ((&pkts[i])->lsize) { 9aebfd4a2200ab Sean Wang 2019-03-08 510 case 1: 9aebfd4a2200ab Sean Wang 2019-03-08 511 dlen = skb->data[(&pkts[i])->loff]; 9aebfd4a2200ab Sean Wang 2019-03-08 512 break; 9aebfd4a2200ab Sean Wang 2019-03-08 513 case 2: 9aebfd4a2200ab Sean Wang 2019-03-08 514 dlen = get_unaligned_le16(skb->data + 9aebfd4a2200ab Sean Wang 2019-03-08 515 (&pkts[i])->loff); 9aebfd4a2200ab Sean Wang 2019-03-08 516 break; 9aebfd4a2200ab Sean Wang 2019-03-08 517 default: 9aebfd4a2200ab Sean Wang 2019-03-08 518 goto err_kfree_skb; 9aebfd4a2200ab Sean Wang 2019-03-08 519 } 9aebfd4a2200ab Sean Wang 2019-03-08 520 9aebfd4a2200ab Sean Wang 2019-03-08 521 pad_size = skb->len - (&pkts[i])->hlen - dlen; 9aebfd4a2200ab Sean Wang 2019-03-08 522 9aebfd4a2200ab Sean Wang 2019-03-08 523 /* Remaining bytes cannot hold a payload */ 9aebfd4a2200ab Sean Wang 2019-03-08 524 if (pad_size < 0) { 9aebfd4a2200ab Sean Wang 2019-03-08 525 bt_dev_err(bdev->hdev, "The size of bt payload is mismatched"); 9aebfd4a2200ab Sean Wang 2019-03-08 526 goto err_kfree_skb; 9aebfd4a2200ab Sean Wang 2019-03-08 527 } 9aebfd4a2200ab Sean Wang 2019-03-08 528 9aebfd4a2200ab Sean Wang 2019-03-08 529 /* Remove padding bytes */ 9aebfd4a2200ab Sean Wang 2019-03-08 530 skb_trim(skb, skb->len - pad_size); 9aebfd4a2200ab Sean Wang 2019-03-08 531 9aebfd4a2200ab Sean Wang 2019-03-08 532 /* Complete frame */ 9aebfd4a2200ab Sean Wang 2019-03-08 533 (&pkts[i])->recv(bdev->hdev, skb); 9aebfd4a2200ab Sean Wang 2019-03-08 534 bcaa7d72dffddf Sean Wang 2019-04-18 535 bdev->hdev->stat.byte_rx += rx_size; bcaa7d72dffddf Sean Wang 2019-04-18 536 9aebfd4a2200ab Sean Wang 2019-03-08 537 return 0; 9aebfd4a2200ab Sean Wang 2019-03-08 538 9aebfd4a2200ab Sean Wang 2019-03-08 539 err_kfree_skb: 9aebfd4a2200ab Sean Wang 2019-03-08 540 kfree_skb(skb); 9aebfd4a2200ab Sean Wang 2019-03-08 541 9aebfd4a2200ab Sean Wang 2019-03-08 542 return err; 9aebfd4a2200ab Sean Wang 2019-03-08 543 } 9aebfd4a2200ab Sean Wang 2019-03-08 544 :::::: The code at line 442 was first introduced by commit :::::: 9aebfd4a2200ab8075e44379c758bccefdc589bb Bluetooth: mediatek: add support for MediaTek MT7663S and MT7668S SDIO devices :::::: TO: Sean Wang <sean.wang@mediatek.com> :::::: CC: Marcel Holtmann <marcel@holtmann.org> -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki ^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH] Bluetooth: btmtksdio: Fix build after header cleanup 2025-08-29 20:34 [bluetooth-next:master 83/84] drivers/bluetooth/btmtksdio.c:442:33: error: array type has incomplete element type 'struct h4_recv_pkt' kernel test robot @ 2025-08-30 0:50 ` Calvin Owens 2025-08-30 1:20 ` bluez.test.bot 2025-08-30 5:11 ` [PATCH] " Paul Menzel 0 siblings, 2 replies; 12+ messages in thread From: Calvin Owens @ 2025-08-30 0:50 UTC (permalink / raw) To: linux-kernel Cc: linux-bluetooth, Luiz Augusto von Dentz, Paul Menzel, oe-kbuild-all, Marcel Holtmann, Sean Wang, linux-mediatek Syzbot found a randconfig which fails after my recent patch: drivers/bluetooth/btmtksdio.c:442:33: error: array type has incomplete element type ‘struct h4_recv_pkt’ 442 | static const struct h4_recv_pkt mtk_recv_pkts[] = { | ^~~~~~~~~~~~~ drivers/bluetooth/btmtksdio.c:443:11: error: ‘H4_RECV_ACL’ undeclared here (not in a function) 443 | { H4_RECV_ACL, .recv = btmtksdio_recv_acl }, | ^~~~~~~~~~~ drivers/bluetooth/btmtksdio.c:444:11: error: ‘H4_RECV_SCO’ undeclared here (not in a function) 444 | { H4_RECV_SCO, .recv = hci_recv_frame }, | ^~~~~~~~~~~ drivers/bluetooth/btmtksdio.c:445:11: error: ‘H4_RECV_EVENT’ undeclared here (not in a function) 445 | { H4_RECV_EVENT, .recv = btmtksdio_recv_event }, ...because we can have BT_MTKSDIO=y with BT_HCIUART_H4=n, and the definitions used here are gated on BT_HCIUART_H4 in hci_uart.h. I think the simplest way to fix this is to remove the gate on the definitions in hci_uart.h. Since the constants are macros, there's no runtime cost to doing so, and nothing seems to rely on their absence in the BT_HCIUART_H4=n case. I let randconfig builds run for awhile in drivers/bluetooth/ and didn't hit anything else, so hopefully this was the only fallout. Fixes: 74bcec450eea ("Bluetooth: remove duplicate h4_recv_buf() in header") Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202508300413.OnIedvRh-lkp@intel.com/ Signed-off-by: Calvin Owens <calvin@wbinvd.org> --- drivers/bluetooth/hci_uart.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/bluetooth/hci_uart.h b/drivers/bluetooth/hci_uart.h index 5ea5dd80e297..fd0624988aba 100644 --- a/drivers/bluetooth/hci_uart.h +++ b/drivers/bluetooth/hci_uart.h @@ -121,7 +121,6 @@ void hci_uart_set_flow_control(struct hci_uart *hu, bool enable); void hci_uart_set_speeds(struct hci_uart *hu, unsigned int init_speed, unsigned int oper_speed); -#ifdef CONFIG_BT_HCIUART_H4 int h4_init(void); int h4_deinit(void); @@ -165,7 +164,6 @@ struct h4_recv_pkt { struct sk_buff *h4_recv_buf(struct hci_dev *hdev, struct sk_buff *skb, const unsigned char *buffer, int count, const struct h4_recv_pkt *pkts, int pkts_count); -#endif #ifdef CONFIG_BT_HCIUART_BCSP int bcsp_init(void); -- 2.49.1 ^ permalink raw reply related [flat|nested] 12+ messages in thread
* RE: Bluetooth: btmtksdio: Fix build after header cleanup 2025-08-30 0:50 ` [PATCH] Bluetooth: btmtksdio: Fix build after header cleanup Calvin Owens @ 2025-08-30 1:20 ` bluez.test.bot 2025-08-30 5:11 ` [PATCH] " Paul Menzel 1 sibling, 0 replies; 12+ messages in thread From: bluez.test.bot @ 2025-08-30 1:20 UTC (permalink / raw) To: linux-bluetooth, calvin [-- Attachment #1: Type: text/plain, Size: 2376 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=997085 ---Test result--- Test Summary: CheckPatch PENDING 0.40 seconds GitLint PENDING 0.28 seconds SubjectPrefix PASS 0.07 seconds BuildKernel PASS 24.20 seconds CheckAllWarning PASS 26.93 seconds CheckSparse PASS 29.87 seconds BuildKernel32 PASS 24.17 seconds TestRunnerSetup PASS 476.47 seconds TestRunner_l2cap-tester PASS 24.76 seconds TestRunner_iso-tester PASS 38.67 seconds TestRunner_bnep-tester PASS 5.90 seconds TestRunner_mgmt-tester FAIL 126.23 seconds TestRunner_rfcomm-tester PASS 9.26 seconds TestRunner_sco-tester PASS 14.81 seconds TestRunner_ioctl-tester PASS 10.05 seconds TestRunner_mesh-tester FAIL 11.43 seconds TestRunner_smp-tester PASS 8.55 seconds TestRunner_userchan-tester PASS 6.26 seconds IncrementalBuild PENDING 0.82 seconds Details ############################## Test: CheckPatch - PENDING Desc: Run checkpatch.pl script Output: ############################## Test: GitLint - PENDING Desc: Run gitlint Output: ############################## Test: TestRunner_mgmt-tester - FAIL Desc: Run mgmt-tester with test-runner Output: Total: 490, Passed: 484 (98.8%), Failed: 2, Not Run: 4 Failed Test Cases Read Exp Feature - Success Failed 0.106 seconds LL Privacy - Add Device 3 (AL is full) Failed 0.212 seconds ############################## Test: TestRunner_mesh-tester - FAIL Desc: Run mesh-tester with test-runner Output: Total: 10, Passed: 8 (80.0%), Failed: 2, Not Run: 0 Failed Test Cases Mesh - Send cancel - 1 Timed out 2.141 seconds Mesh - Send cancel - 2 Timed out 1.998 seconds ############################## Test: IncrementalBuild - PENDING Desc: Incremental build with the patches in the series Output: --- Regards, Linux Bluetooth ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] Bluetooth: btmtksdio: Fix build after header cleanup 2025-08-30 0:50 ` [PATCH] Bluetooth: btmtksdio: Fix build after header cleanup Calvin Owens 2025-08-30 1:20 ` bluez.test.bot @ 2025-08-30 5:11 ` Paul Menzel 2025-08-30 19:32 ` Calvin Owens 1 sibling, 1 reply; 12+ messages in thread From: Paul Menzel @ 2025-08-30 5:11 UTC (permalink / raw) To: Calvin Owens Cc: linux-kernel, linux-bluetooth, Luiz Augusto von Dentz, oe-kbuild-all, Marcel Holtmann, Sean Wang, linux-mediatek Dear Calvin, Thank you for your patch, and addressing the regression right away. Am 30.08.25 um 02:50 schrieb Calvin Owens: > Syzbot found a randconfig which fails after my recent patch: > > drivers/bluetooth/btmtksdio.c:442:33: error: array type has incomplete element type ‘struct h4_recv_pkt’ > 442 | static const struct h4_recv_pkt mtk_recv_pkts[] = { > | ^~~~~~~~~~~~~ > drivers/bluetooth/btmtksdio.c:443:11: error: ‘H4_RECV_ACL’ undeclared here (not in a function) > 443 | { H4_RECV_ACL, .recv = btmtksdio_recv_acl }, > | ^~~~~~~~~~~ > drivers/bluetooth/btmtksdio.c:444:11: error: ‘H4_RECV_SCO’ undeclared here (not in a function) > 444 | { H4_RECV_SCO, .recv = hci_recv_frame }, > | ^~~~~~~~~~~ > drivers/bluetooth/btmtksdio.c:445:11: error: ‘H4_RECV_EVENT’ undeclared here (not in a function) > 445 | { H4_RECV_EVENT, .recv = btmtksdio_recv_event }, > > ...because we can have BT_MTKSDIO=y with BT_HCIUART_H4=n, and the > definitions used here are gated on BT_HCIUART_H4 in hci_uart.h. The drivers below seem to be affected: drivers/bluetooth/bpa10x.c: { H4_RECV_EVENT, .recv = hci_recv_frame }, drivers/bluetooth/btmtksdio.c: { H4_RECV_EVENT, .recv = btmtksdio_recv_event }, drivers/bluetooth/btmtkuart.c: { H4_RECV_EVENT, .recv = btmtkuart_recv_event }, drivers/bluetooth/btnxpuart.c: { H4_RECV_EVENT, .recv = hci_recv_frame }, > I think the simplest way to fix this is to remove the gate on the > definitions in hci_uart.h. Since the constants are macros, there's no > runtime cost to doing so, and nothing seems to rely on their absence in > the BT_HCIUART_H4=n case. Looking at the implementation, it looks like they only work with the H4 protocol? So maybe, that should be denoted in the Kconfig files? > I let randconfig builds run for awhile in drivers/bluetooth/ and didn't > hit anything else, so hopefully this was the only fallout. > > Fixes: 74bcec450eea ("Bluetooth: remove duplicate h4_recv_buf() in header") > Reported-by: kernel test robot <lkp@intel.com> > Closes: https://lore.kernel.org/oe-kbuild-all/202508300413.OnIedvRh-lkp@intel.com/ > Signed-off-by: Calvin Owens <calvin@wbinvd.org> > --- > drivers/bluetooth/hci_uart.h | 2 -- > 1 file changed, 2 deletions(-) > > diff --git a/drivers/bluetooth/hci_uart.h b/drivers/bluetooth/hci_uart.h > index 5ea5dd80e297..fd0624988aba 100644 > --- a/drivers/bluetooth/hci_uart.h > +++ b/drivers/bluetooth/hci_uart.h > @@ -121,7 +121,6 @@ void hci_uart_set_flow_control(struct hci_uart *hu, bool enable); > void hci_uart_set_speeds(struct hci_uart *hu, unsigned int init_speed, > unsigned int oper_speed); > > -#ifdef CONFIG_BT_HCIUART_H4 > int h4_init(void); > int h4_deinit(void); > > @@ -165,7 +164,6 @@ struct h4_recv_pkt { > struct sk_buff *h4_recv_buf(struct hci_dev *hdev, struct sk_buff *skb, > const unsigned char *buffer, int count, > const struct h4_recv_pkt *pkts, int pkts_count); > -#endif > > #ifdef CONFIG_BT_HCIUART_BCSP > int bcsp_init(void); It’s a valid fix. Reviewed-by: Paul Menzel <pmenzel@molgen.mpg.de> Kind regards, Paul ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] Bluetooth: btmtksdio: Fix build after header cleanup 2025-08-30 5:11 ` [PATCH] " Paul Menzel @ 2025-08-30 19:32 ` Calvin Owens 2025-09-02 15:29 ` Luiz Augusto von Dentz 0 siblings, 1 reply; 12+ messages in thread From: Calvin Owens @ 2025-08-30 19:32 UTC (permalink / raw) To: Paul Menzel Cc: linux-kernel, linux-bluetooth, Luiz Augusto von Dentz, oe-kbuild-all, Marcel Holtmann, Sean Wang, linux-mediatek On Saturday 08/30 at 07:11 +0200, Paul Menzel wrote: > Dear Calvin, > > > Thank you for your patch, and addressing the regression right away. > > Am 30.08.25 um 02:50 schrieb Calvin Owens: > > Syzbot found a randconfig which fails after my recent patch: > > > > drivers/bluetooth/btmtksdio.c:442:33: error: array type has incomplete element type ‘struct h4_recv_pkt’ > > 442 | static const struct h4_recv_pkt mtk_recv_pkts[] = { > > | ^~~~~~~~~~~~~ > > drivers/bluetooth/btmtksdio.c:443:11: error: ‘H4_RECV_ACL’ undeclared here (not in a function) > > 443 | { H4_RECV_ACL, .recv = btmtksdio_recv_acl }, > > | ^~~~~~~~~~~ > > drivers/bluetooth/btmtksdio.c:444:11: error: ‘H4_RECV_SCO’ undeclared here (not in a function) > > 444 | { H4_RECV_SCO, .recv = hci_recv_frame }, > > | ^~~~~~~~~~~ > > drivers/bluetooth/btmtksdio.c:445:11: error: ‘H4_RECV_EVENT’ undeclared here (not in a function) > > 445 | { H4_RECV_EVENT, .recv = btmtksdio_recv_event }, > > > > ...because we can have BT_MTKSDIO=y with BT_HCIUART_H4=n, and the > > definitions used here are gated on BT_HCIUART_H4 in hci_uart.h. > > The drivers below seem to be affected: > > drivers/bluetooth/bpa10x.c: { H4_RECV_EVENT, .recv = > hci_recv_frame }, > drivers/bluetooth/btmtksdio.c: { H4_RECV_EVENT, .recv = > btmtksdio_recv_event }, > drivers/bluetooth/btmtkuart.c: { H4_RECV_EVENT, .recv = > btmtkuart_recv_event }, > drivers/bluetooth/btnxpuart.c: { H4_RECV_EVENT, .recv = > hci_recv_frame }, > > > I think the simplest way to fix this is to remove the gate on the > > definitions in hci_uart.h. Since the constants are macros, there's no > > runtime cost to doing so, and nothing seems to rely on their absence in > > the BT_HCIUART_H4=n case. > > Looking at the implementation, it looks like they only work with the H4 > protocol? So maybe, that should be denoted in the Kconfig files? Thanks for looking Paul. Yes, my fix will cause a link error with other randconfigs, which my 'make randconfig drivers/bluetooth/' test loop missed after I made the function prototype always defined, whoops. We do need the dependencies here, as you note. The btmtksdio case syzbot found is the odd one out because it only uses the constants, and doesn't call h4_recv_buf(). Hopefully this gets it all: -----8<----- From: Calvin Owens <calvin@wbinvd.org> Subject: [PATCH v2] Bluetooth: Fix build after header cleanup Some Kconfig dependencies are needed after my recent cleanup, since the core code has its own option. Since btmtksdio does not actually call h4_recv_buf(), move the definitions it uses outside the BT_HCIUART_H4 gate in hci_uart.h to avoid adding a dependency for btmtksdio. The rest I touched (bpa10x, btmtkuart, and btnxpuart) do really call h4_recv_buf(), so the dependency is required, add it for them. Fixes: 74bcec450eea ("Bluetooth: remove duplicate h4_recv_buf() in header") Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202508300413.OnIedvRh-lkp@intel.com/ Signed-off-by: Calvin Owens <calvin@wbinvd.org> --- drivers/bluetooth/Kconfig | 6 ++++++ drivers/bluetooth/hci_uart.h | 8 ++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/bluetooth/Kconfig b/drivers/bluetooth/Kconfig index 4ab32abf0f48..7df69ccb6600 100644 --- a/drivers/bluetooth/Kconfig +++ b/drivers/bluetooth/Kconfig @@ -312,7 +312,9 @@ config BT_HCIBCM4377 config BT_HCIBPA10X tristate "HCI BPA10x USB driver" + depends on BT_HCIUART depends on USB + select BT_HCIUART_H4 help Bluetooth HCI BPA10x USB driver. This driver provides support for the Digianswer BPA 100/105 Bluetooth @@ -437,8 +439,10 @@ config BT_MTKSDIO config BT_MTKUART tristate "MediaTek HCI UART driver" + depends on BT_HCIUART depends on SERIAL_DEV_BUS depends on USB || !BT_HCIBTUSB_MTK + select BT_HCIUART_H4 select BT_MTK help MediaTek Bluetooth HCI UART driver. @@ -483,7 +487,9 @@ config BT_VIRTIO config BT_NXPUART tristate "NXP protocol support" + depends on BT_HCIUART depends on SERIAL_DEV_BUS + select BT_HCIUART_H4 select CRC32 select CRC8 help diff --git a/drivers/bluetooth/hci_uart.h b/drivers/bluetooth/hci_uart.h index 5ea5dd80e297..cbbe79b241ce 100644 --- a/drivers/bluetooth/hci_uart.h +++ b/drivers/bluetooth/hci_uart.h @@ -121,10 +121,6 @@ void hci_uart_set_flow_control(struct hci_uart *hu, bool enable); void hci_uart_set_speeds(struct hci_uart *hu, unsigned int init_speed, unsigned int oper_speed); -#ifdef CONFIG_BT_HCIUART_H4 -int h4_init(void); -int h4_deinit(void); - struct h4_recv_pkt { u8 type; /* Packet type */ u8 hlen; /* Header length */ @@ -162,6 +158,10 @@ struct h4_recv_pkt { .lsize = 2, \ .maxlen = HCI_MAX_FRAME_SIZE \ +#ifdef CONFIG_BT_HCIUART_H4 +int h4_init(void); +int h4_deinit(void); + struct sk_buff *h4_recv_buf(struct hci_dev *hdev, struct sk_buff *skb, const unsigned char *buffer, int count, const struct h4_recv_pkt *pkts, int pkts_count); -- 2.47.2 ^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH] Bluetooth: btmtksdio: Fix build after header cleanup 2025-08-30 19:32 ` Calvin Owens @ 2025-09-02 15:29 ` Luiz Augusto von Dentz 2025-09-02 15:43 ` [PATCH v2] Bluetooth: " Calvin Owens 0 siblings, 1 reply; 12+ messages in thread From: Luiz Augusto von Dentz @ 2025-09-02 15:29 UTC (permalink / raw) To: Calvin Owens Cc: Paul Menzel, linux-kernel, linux-bluetooth, Luiz Augusto von Dentz, oe-kbuild-all, Marcel Holtmann, Sean Wang, linux-mediatek Hi Calvin, On Sat, Aug 30, 2025 at 3:32 PM Calvin Owens <calvin@wbinvd.org> wrote: > > On Saturday 08/30 at 07:11 +0200, Paul Menzel wrote: > > Dear Calvin, > > > > > > Thank you for your patch, and addressing the regression right away. > > > > Am 30.08.25 um 02:50 schrieb Calvin Owens: > > > Syzbot found a randconfig which fails after my recent patch: > > > > > > drivers/bluetooth/btmtksdio.c:442:33: error: array type has incomplete element type ‘struct h4_recv_pkt’ > > > 442 | static const struct h4_recv_pkt mtk_recv_pkts[] = { > > > | ^~~~~~~~~~~~~ > > > drivers/bluetooth/btmtksdio.c:443:11: error: ‘H4_RECV_ACL’ undeclared here (not in a function) > > > 443 | { H4_RECV_ACL, .recv = btmtksdio_recv_acl }, > > > | ^~~~~~~~~~~ > > > drivers/bluetooth/btmtksdio.c:444:11: error: ‘H4_RECV_SCO’ undeclared here (not in a function) > > > 444 | { H4_RECV_SCO, .recv = hci_recv_frame }, > > > | ^~~~~~~~~~~ > > > drivers/bluetooth/btmtksdio.c:445:11: error: ‘H4_RECV_EVENT’ undeclared here (not in a function) > > > 445 | { H4_RECV_EVENT, .recv = btmtksdio_recv_event }, > > > > > > ...because we can have BT_MTKSDIO=y with BT_HCIUART_H4=n, and the > > > definitions used here are gated on BT_HCIUART_H4 in hci_uart.h. > > > > The drivers below seem to be affected: > > > > drivers/bluetooth/bpa10x.c: { H4_RECV_EVENT, .recv = > > hci_recv_frame }, > > drivers/bluetooth/btmtksdio.c: { H4_RECV_EVENT, .recv = > > btmtksdio_recv_event }, > > drivers/bluetooth/btmtkuart.c: { H4_RECV_EVENT, .recv = > > btmtkuart_recv_event }, > > drivers/bluetooth/btnxpuart.c: { H4_RECV_EVENT, .recv = > > hci_recv_frame }, > > > > > I think the simplest way to fix this is to remove the gate on the > > > definitions in hci_uart.h. Since the constants are macros, there's no > > > runtime cost to doing so, and nothing seems to rely on their absence in > > > the BT_HCIUART_H4=n case. > > > > Looking at the implementation, it looks like they only work with the H4 > > protocol? So maybe, that should be denoted in the Kconfig files? > > Thanks for looking Paul. > > Yes, my fix will cause a link error with other randconfigs, which my > 'make randconfig drivers/bluetooth/' test loop missed after I made the > function prototype always defined, whoops. > > We do need the dependencies here, as you note. The btmtksdio case syzbot > found is the odd one out because it only uses the constants, and doesn't > call h4_recv_buf(). > > Hopefully this gets it all: > > -----8<----- > From: Calvin Owens <calvin@wbinvd.org> > Subject: [PATCH v2] Bluetooth: Fix build after header cleanup > > Some Kconfig dependencies are needed after my recent cleanup, since > the core code has its own option. > > Since btmtksdio does not actually call h4_recv_buf(), move the > definitions it uses outside the BT_HCIUART_H4 gate in hci_uart.h to > avoid adding a dependency for btmtksdio. > > The rest I touched (bpa10x, btmtkuart, and btnxpuart) do really call > h4_recv_buf(), so the dependency is required, add it for them. > > Fixes: 74bcec450eea ("Bluetooth: remove duplicate h4_recv_buf() in header") > Reported-by: kernel test robot <lkp@intel.com> > Closes: https://lore.kernel.org/oe-kbuild-all/202508300413.OnIedvRh-lkp@intel.com/ > Signed-off-by: Calvin Owens <calvin@wbinvd.org> > --- > drivers/bluetooth/Kconfig | 6 ++++++ > drivers/bluetooth/hci_uart.h | 8 ++++---- > 2 files changed, 10 insertions(+), 4 deletions(-) > > diff --git a/drivers/bluetooth/Kconfig b/drivers/bluetooth/Kconfig > index 4ab32abf0f48..7df69ccb6600 100644 > --- a/drivers/bluetooth/Kconfig > +++ b/drivers/bluetooth/Kconfig > @@ -312,7 +312,9 @@ config BT_HCIBCM4377 > > config BT_HCIBPA10X > tristate "HCI BPA10x USB driver" > + depends on BT_HCIUART > depends on USB > + select BT_HCIUART_H4 > help > Bluetooth HCI BPA10x USB driver. > This driver provides support for the Digianswer BPA 100/105 Bluetooth > @@ -437,8 +439,10 @@ config BT_MTKSDIO > > config BT_MTKUART > tristate "MediaTek HCI UART driver" > + depends on BT_HCIUART > depends on SERIAL_DEV_BUS > depends on USB || !BT_HCIBTUSB_MTK > + select BT_HCIUART_H4 > select BT_MTK > help > MediaTek Bluetooth HCI UART driver. > @@ -483,7 +487,9 @@ config BT_VIRTIO > > config BT_NXPUART > tristate "NXP protocol support" > + depends on BT_HCIUART > depends on SERIAL_DEV_BUS > + select BT_HCIUART_H4 > select CRC32 > select CRC8 > help > diff --git a/drivers/bluetooth/hci_uart.h b/drivers/bluetooth/hci_uart.h > index 5ea5dd80e297..cbbe79b241ce 100644 > --- a/drivers/bluetooth/hci_uart.h > +++ b/drivers/bluetooth/hci_uart.h > @@ -121,10 +121,6 @@ void hci_uart_set_flow_control(struct hci_uart *hu, bool enable); > void hci_uart_set_speeds(struct hci_uart *hu, unsigned int init_speed, > unsigned int oper_speed); > > -#ifdef CONFIG_BT_HCIUART_H4 > -int h4_init(void); > -int h4_deinit(void); > - > struct h4_recv_pkt { > u8 type; /* Packet type */ > u8 hlen; /* Header length */ > @@ -162,6 +158,10 @@ struct h4_recv_pkt { > .lsize = 2, \ > .maxlen = HCI_MAX_FRAME_SIZE \ > > +#ifdef CONFIG_BT_HCIUART_H4 > +int h4_init(void); > +int h4_deinit(void); > + > struct sk_buff *h4_recv_buf(struct hci_dev *hdev, struct sk_buff *skb, > const unsigned char *buffer, int count, > const struct h4_recv_pkt *pkts, int pkts_count); > -- > 2.47.2 Please send a v2 then otherwise this is no pickup by the likes of CI and patchwork. > -- Luiz Augusto von Dentz ^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH v2] Bluetooth: Fix build after header cleanup 2025-09-02 15:29 ` Luiz Augusto von Dentz @ 2025-09-02 15:43 ` Calvin Owens 2025-09-02 16:20 ` patchwork-bot+bluetooth 2025-09-03 14:04 ` Calvin Owens 0 siblings, 2 replies; 12+ messages in thread From: Calvin Owens @ 2025-09-02 15:43 UTC (permalink / raw) To: Luiz Augusto von Dentz Cc: Paul Menzel, linux-kernel, linux-bluetooth, Luiz Augusto von Dentz, oe-kbuild-all, Marcel Holtmann, Sean Wang, linux-mediatek, naresh.kamboju Some Kconfig dependencies are needed after my recent cleanup, since the core code has its own option. Since btmtksdio does not actually call h4_recv_buf(), move the definitions it uses outside the BT_HCIUART_H4 gate in hci_uart.h to avoid adding a dependency for btmtksdio. The rest I touched (bpa10x, btmtkuart, and btnxpuart) do really call h4_recv_buf(), so the dependency is required, add it for them. Fixes: 74bcec450eea ("Bluetooth: remove duplicate h4_recv_buf() in header") Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202508300413.OnIedvRh-lkp@intel.com/ Signed-off-by: Calvin Owens <calvin@wbinvd.org> --- drivers/bluetooth/Kconfig | 6 ++++++ drivers/bluetooth/hci_uart.h | 8 ++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/bluetooth/Kconfig b/drivers/bluetooth/Kconfig index 4ab32abf0f48..7df69ccb6600 100644 --- a/drivers/bluetooth/Kconfig +++ b/drivers/bluetooth/Kconfig @@ -312,7 +312,9 @@ config BT_HCIBCM4377 config BT_HCIBPA10X tristate "HCI BPA10x USB driver" + depends on BT_HCIUART depends on USB + select BT_HCIUART_H4 help Bluetooth HCI BPA10x USB driver. This driver provides support for the Digianswer BPA 100/105 Bluetooth @@ -437,8 +439,10 @@ config BT_MTKSDIO config BT_MTKUART tristate "MediaTek HCI UART driver" + depends on BT_HCIUART depends on SERIAL_DEV_BUS depends on USB || !BT_HCIBTUSB_MTK + select BT_HCIUART_H4 select BT_MTK help MediaTek Bluetooth HCI UART driver. @@ -483,7 +487,9 @@ config BT_VIRTIO config BT_NXPUART tristate "NXP protocol support" + depends on BT_HCIUART depends on SERIAL_DEV_BUS + select BT_HCIUART_H4 select CRC32 select CRC8 help diff --git a/drivers/bluetooth/hci_uart.h b/drivers/bluetooth/hci_uart.h index 5ea5dd80e297..cbbe79b241ce 100644 --- a/drivers/bluetooth/hci_uart.h +++ b/drivers/bluetooth/hci_uart.h @@ -121,10 +121,6 @@ void hci_uart_set_flow_control(struct hci_uart *hu, bool enable); void hci_uart_set_speeds(struct hci_uart *hu, unsigned int init_speed, unsigned int oper_speed); -#ifdef CONFIG_BT_HCIUART_H4 -int h4_init(void); -int h4_deinit(void); - struct h4_recv_pkt { u8 type; /* Packet type */ u8 hlen; /* Header length */ @@ -162,6 +158,10 @@ struct h4_recv_pkt { .lsize = 2, \ .maxlen = HCI_MAX_FRAME_SIZE \ +#ifdef CONFIG_BT_HCIUART_H4 +int h4_init(void); +int h4_deinit(void); + struct sk_buff *h4_recv_buf(struct hci_dev *hdev, struct sk_buff *skb, const unsigned char *buffer, int count, const struct h4_recv_pkt *pkts, int pkts_count); -- 2.47.2 ^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH v2] Bluetooth: Fix build after header cleanup 2025-09-02 15:43 ` [PATCH v2] Bluetooth: " Calvin Owens @ 2025-09-02 16:20 ` patchwork-bot+bluetooth 2025-09-03 14:04 ` Calvin Owens 1 sibling, 0 replies; 12+ messages in thread From: patchwork-bot+bluetooth @ 2025-09-02 16:20 UTC (permalink / raw) To: Calvin Owens Cc: luiz.dentz, pmenzel, linux-kernel, linux-bluetooth, luiz.von.dentz, oe-kbuild-all, marcel, sean.wang, linux-mediatek, naresh.kamboju Hello: This patch was applied to bluetooth/bluetooth-next.git (master) by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>: On Tue, 2 Sep 2025 08:43:44 -0700 you wrote: > Some Kconfig dependencies are needed after my recent cleanup, since > the core code has its own option. > > Since btmtksdio does not actually call h4_recv_buf(), move the > definitions it uses outside the BT_HCIUART_H4 gate in hci_uart.h to > avoid adding a dependency for btmtksdio. > > [...] Here is the summary with links: - [v2] Bluetooth: Fix build after header cleanup https://git.kernel.org/bluetooth/bluetooth-next/c/16ebf6c26de5 You are awesome, thank you! -- Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v2] Bluetooth: Fix build after header cleanup 2025-09-02 15:43 ` [PATCH v2] Bluetooth: " Calvin Owens 2025-09-02 16:20 ` patchwork-bot+bluetooth @ 2025-09-03 14:04 ` Calvin Owens 2025-09-03 14:06 ` [PATCH v3] " Calvin Owens 1 sibling, 1 reply; 12+ messages in thread From: Calvin Owens @ 2025-09-03 14:04 UTC (permalink / raw) To: Luiz Augusto von Dentz Cc: Paul Menzel, linux-kernel, linux-bluetooth, Luiz Augusto von Dentz, oe-kbuild-all, Marcel Holtmann, Sean Wang, linux-mediatek, naresh.kamboju On Tuesday 09/02 at 08:43 -0700, Calvin Owens wrote: > Some Kconfig dependencies are needed after my recent cleanup, since > the core code has its own option. > > Since btmtksdio does not actually call h4_recv_buf(), move the > definitions it uses outside the BT_HCIUART_H4 gate in hci_uart.h to > avoid adding a dependency for btmtksdio. > > The rest I touched (bpa10x, btmtkuart, and btnxpuart) do really call > h4_recv_buf(), so the dependency is required, add it for them. > > Fixes: 74bcec450eea ("Bluetooth: remove duplicate h4_recv_buf() in header") Hi all, My fixes tag was wrong and Stephen's automation caught it in linux-next. I'll send a v3 in response to this with a correct tag, it should be: Fixes: 0e272fc7e17d ("Bluetooth: remove duplicate h4_recv_buf() in header") Thanks, Calvin > Reported-by: kernel test robot <lkp@intel.com> > Closes: https://lore.kernel.org/oe-kbuild-all/202508300413.OnIedvRh-lkp@intel.com/ > Signed-off-by: Calvin Owens <calvin@wbinvd.org> > --- > drivers/bluetooth/Kconfig | 6 ++++++ > drivers/bluetooth/hci_uart.h | 8 ++++---- > 2 files changed, 10 insertions(+), 4 deletions(-) > > diff --git a/drivers/bluetooth/Kconfig b/drivers/bluetooth/Kconfig > index 4ab32abf0f48..7df69ccb6600 100644 > --- a/drivers/bluetooth/Kconfig > +++ b/drivers/bluetooth/Kconfig > @@ -312,7 +312,9 @@ config BT_HCIBCM4377 > > config BT_HCIBPA10X > tristate "HCI BPA10x USB driver" > + depends on BT_HCIUART > depends on USB > + select BT_HCIUART_H4 > help > Bluetooth HCI BPA10x USB driver. > This driver provides support for the Digianswer BPA 100/105 Bluetooth > @@ -437,8 +439,10 @@ config BT_MTKSDIO > > config BT_MTKUART > tristate "MediaTek HCI UART driver" > + depends on BT_HCIUART > depends on SERIAL_DEV_BUS > depends on USB || !BT_HCIBTUSB_MTK > + select BT_HCIUART_H4 > select BT_MTK > help > MediaTek Bluetooth HCI UART driver. > @@ -483,7 +487,9 @@ config BT_VIRTIO > > config BT_NXPUART > tristate "NXP protocol support" > + depends on BT_HCIUART > depends on SERIAL_DEV_BUS > + select BT_HCIUART_H4 > select CRC32 > select CRC8 > help > diff --git a/drivers/bluetooth/hci_uart.h b/drivers/bluetooth/hci_uart.h > index 5ea5dd80e297..cbbe79b241ce 100644 > --- a/drivers/bluetooth/hci_uart.h > +++ b/drivers/bluetooth/hci_uart.h > @@ -121,10 +121,6 @@ void hci_uart_set_flow_control(struct hci_uart *hu, bool enable); > void hci_uart_set_speeds(struct hci_uart *hu, unsigned int init_speed, > unsigned int oper_speed); > > -#ifdef CONFIG_BT_HCIUART_H4 > -int h4_init(void); > -int h4_deinit(void); > - > struct h4_recv_pkt { > u8 type; /* Packet type */ > u8 hlen; /* Header length */ > @@ -162,6 +158,10 @@ struct h4_recv_pkt { > .lsize = 2, \ > .maxlen = HCI_MAX_FRAME_SIZE \ > > +#ifdef CONFIG_BT_HCIUART_H4 > +int h4_init(void); > +int h4_deinit(void); > + > struct sk_buff *h4_recv_buf(struct hci_dev *hdev, struct sk_buff *skb, > const unsigned char *buffer, int count, > const struct h4_recv_pkt *pkts, int pkts_count); > -- > 2.47.2 > ^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH v3] Bluetooth: Fix build after header cleanup 2025-09-03 14:04 ` Calvin Owens @ 2025-09-03 14:06 ` Calvin Owens 2025-09-03 14:17 ` [v3] " bluez.test.bot 2025-09-03 15:29 ` [PATCH v3] " Paul Menzel 0 siblings, 2 replies; 12+ messages in thread From: Calvin Owens @ 2025-09-03 14:06 UTC (permalink / raw) To: Luiz Augusto von Dentz Cc: Paul Menzel, linux-kernel, linux-bluetooth, Luiz Augusto von Dentz, oe-kbuild-all, Marcel Holtmann, Sean Wang, linux-mediatek, naresh.kamboju Some Kconfig dependencies are needed after my recent cleanup, since the core code has its own option. Since btmtksdio does not actually call h4_recv_buf(), move the definitions it uses outside the BT_HCIUART_H4 gate in hci_uart.h to avoid adding a dependency for btmtksdio. The rest I touched (bpa10x, btmtkuart, and btnxpuart) do really call h4_recv_buf(), so the dependency is required, add it for them. Fixes: 0e272fc7e17d ("Bluetooth: remove duplicate h4_recv_buf() in header") Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202508300413.OnIedvRh-lkp@intel.com/ Signed-off-by: Calvin Owens <calvin@wbinvd.org> --- drivers/bluetooth/Kconfig | 6 ++++++ drivers/bluetooth/hci_uart.h | 8 ++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/bluetooth/Kconfig b/drivers/bluetooth/Kconfig index 4ab32abf0f48..7df69ccb6600 100644 --- a/drivers/bluetooth/Kconfig +++ b/drivers/bluetooth/Kconfig @@ -312,7 +312,9 @@ config BT_HCIBCM4377 config BT_HCIBPA10X tristate "HCI BPA10x USB driver" + depends on BT_HCIUART depends on USB + select BT_HCIUART_H4 help Bluetooth HCI BPA10x USB driver. This driver provides support for the Digianswer BPA 100/105 Bluetooth @@ -437,8 +439,10 @@ config BT_MTKSDIO config BT_MTKUART tristate "MediaTek HCI UART driver" + depends on BT_HCIUART depends on SERIAL_DEV_BUS depends on USB || !BT_HCIBTUSB_MTK + select BT_HCIUART_H4 select BT_MTK help MediaTek Bluetooth HCI UART driver. @@ -483,7 +487,9 @@ config BT_VIRTIO config BT_NXPUART tristate "NXP protocol support" + depends on BT_HCIUART depends on SERIAL_DEV_BUS + select BT_HCIUART_H4 select CRC32 select CRC8 help diff --git a/drivers/bluetooth/hci_uart.h b/drivers/bluetooth/hci_uart.h index 5ea5dd80e297..cbbe79b241ce 100644 --- a/drivers/bluetooth/hci_uart.h +++ b/drivers/bluetooth/hci_uart.h @@ -121,10 +121,6 @@ void hci_uart_set_flow_control(struct hci_uart *hu, bool enable); void hci_uart_set_speeds(struct hci_uart *hu, unsigned int init_speed, unsigned int oper_speed); -#ifdef CONFIG_BT_HCIUART_H4 -int h4_init(void); -int h4_deinit(void); - struct h4_recv_pkt { u8 type; /* Packet type */ u8 hlen; /* Header length */ @@ -162,6 +158,10 @@ struct h4_recv_pkt { .lsize = 2, \ .maxlen = HCI_MAX_FRAME_SIZE \ +#ifdef CONFIG_BT_HCIUART_H4 +int h4_init(void); +int h4_deinit(void); + struct sk_buff *h4_recv_buf(struct hci_dev *hdev, struct sk_buff *skb, const unsigned char *buffer, int count, const struct h4_recv_pkt *pkts, int pkts_count); -- 2.47.2 ^ permalink raw reply related [flat|nested] 12+ messages in thread
* RE: [v3] Bluetooth: Fix build after header cleanup 2025-09-03 14:06 ` [PATCH v3] " Calvin Owens @ 2025-09-03 14:17 ` bluez.test.bot 2025-09-03 15:29 ` [PATCH v3] " Paul Menzel 1 sibling, 0 replies; 12+ messages in thread From: bluez.test.bot @ 2025-09-03 14:17 UTC (permalink / raw) To: linux-bluetooth, calvin [-- Attachment #1: Type: text/plain, Size: 664 bytes --] This is an automated email and please do not reply to this email. Dear Submitter, Thank you for submitting the patches to the linux bluetooth mailing list. While preparing the CI tests, the patches you submitted couldn't be applied to the current HEAD of the repository. ----- Output ----- error: patch failed: drivers/bluetooth/Kconfig:312 error: drivers/bluetooth/Kconfig: patch does not apply error: patch failed: drivers/bluetooth/hci_uart.h:121 error: drivers/bluetooth/hci_uart.h: patch does not apply hint: Use 'git am --show-current-patch' to see the failed patch Please resolve the issue and submit the patches again. --- Regards, Linux Bluetooth ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v3] Bluetooth: Fix build after header cleanup 2025-09-03 14:06 ` [PATCH v3] " Calvin Owens 2025-09-03 14:17 ` [v3] " bluez.test.bot @ 2025-09-03 15:29 ` Paul Menzel 1 sibling, 0 replies; 12+ messages in thread From: Paul Menzel @ 2025-09-03 15:29 UTC (permalink / raw) To: Calvin Owens Cc: Luiz Augusto von Dentz, linux-kernel, linux-bluetooth, Luiz Augusto von Dentz, oe-kbuild-all, Marcel Holtmann, Sean Wang, linux-mediatek, naresh.kamboju Dear Calvin, Thank you for the patch. Am 03.09.25 um 16:06 schrieb Calvin Owens: > Some Kconfig dependencies are needed after my recent cleanup, since > the core code has its own option. > > Since btmtksdio does not actually call h4_recv_buf(), move the > definitions it uses outside the BT_HCIUART_H4 gate in hci_uart.h to > avoid adding a dependency for btmtksdio. > > The rest I touched (bpa10x, btmtkuart, and btnxpuart) do really call > h4_recv_buf(), so the dependency is required, add it for them. > > Fixes: 0e272fc7e17d ("Bluetooth: remove duplicate h4_recv_buf() in header") > Reported-by: kernel test robot <lkp@intel.com> > Closes: https://lore.kernel.org/oe-kbuild-all/202508300413.OnIedvRh-lkp@intel.com/ > Signed-off-by: Calvin Owens <calvin@wbinvd.org> > --- > drivers/bluetooth/Kconfig | 6 ++++++ > drivers/bluetooth/hci_uart.h | 8 ++++---- > 2 files changed, 10 insertions(+), 4 deletions(-) > > diff --git a/drivers/bluetooth/Kconfig b/drivers/bluetooth/Kconfig > index 4ab32abf0f48..7df69ccb6600 100644 > --- a/drivers/bluetooth/Kconfig > +++ b/drivers/bluetooth/Kconfig > @@ -312,7 +312,9 @@ config BT_HCIBCM4377 > > config BT_HCIBPA10X > tristate "HCI BPA10x USB driver" > + depends on BT_HCIUART > depends on USB > + select BT_HCIUART_H4 > help > Bluetooth HCI BPA10x USB driver. > This driver provides support for the Digianswer BPA 100/105 Bluetooth > @@ -437,8 +439,10 @@ config BT_MTKSDIO > > config BT_MTKUART > tristate "MediaTek HCI UART driver" > + depends on BT_HCIUART > depends on SERIAL_DEV_BUS > depends on USB || !BT_HCIBTUSB_MTK > + select BT_HCIUART_H4 > select BT_MTK > help > MediaTek Bluetooth HCI UART driver. > @@ -483,7 +487,9 @@ config BT_VIRTIO > > config BT_NXPUART > tristate "NXP protocol support" > + depends on BT_HCIUART > depends on SERIAL_DEV_BUS > + select BT_HCIUART_H4 > select CRC32 > select CRC8 > help > diff --git a/drivers/bluetooth/hci_uart.h b/drivers/bluetooth/hci_uart.h > index 5ea5dd80e297..cbbe79b241ce 100644 > --- a/drivers/bluetooth/hci_uart.h > +++ b/drivers/bluetooth/hci_uart.h > @@ -121,10 +121,6 @@ void hci_uart_set_flow_control(struct hci_uart *hu, bool enable); > void hci_uart_set_speeds(struct hci_uart *hu, unsigned int init_speed, > unsigned int oper_speed); > > -#ifdef CONFIG_BT_HCIUART_H4 > -int h4_init(void); > -int h4_deinit(void); > - > struct h4_recv_pkt { > u8 type; /* Packet type */ > u8 hlen; /* Header length */ > @@ -162,6 +158,10 @@ struct h4_recv_pkt { > .lsize = 2, \ > .maxlen = HCI_MAX_FRAME_SIZE \ > > +#ifdef CONFIG_BT_HCIUART_H4 > +int h4_init(void); > +int h4_deinit(void); > + > struct sk_buff *h4_recv_buf(struct hci_dev *hdev, struct sk_buff *skb, > const unsigned char *buffer, int count, > const struct h4_recv_pkt *pkts, int pkts_count); Reviewed-by: Paul Menzel <pmenzel@molgen.mpg.de> Kind regards, Paul ^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2025-09-03 15:30 UTC | newest] Thread overview: 12+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2025-08-29 20:34 [bluetooth-next:master 83/84] drivers/bluetooth/btmtksdio.c:442:33: error: array type has incomplete element type 'struct h4_recv_pkt' kernel test robot 2025-08-30 0:50 ` [PATCH] Bluetooth: btmtksdio: Fix build after header cleanup Calvin Owens 2025-08-30 1:20 ` bluez.test.bot 2025-08-30 5:11 ` [PATCH] " Paul Menzel 2025-08-30 19:32 ` Calvin Owens 2025-09-02 15:29 ` Luiz Augusto von Dentz 2025-09-02 15:43 ` [PATCH v2] Bluetooth: " Calvin Owens 2025-09-02 16:20 ` patchwork-bot+bluetooth 2025-09-03 14:04 ` Calvin Owens 2025-09-03 14:06 ` [PATCH v3] " Calvin Owens 2025-09-03 14:17 ` [v3] " bluez.test.bot 2025-09-03 15:29 ` [PATCH v3] " Paul Menzel
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).