All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Bluetooth: hci-core: fix "declaration does not declare anything" error
@ 2026-08-14  5:10 David Marlin
  2026-08-14  5:46 ` bluez.test.bot
  2026-08-21  2:08 ` [PATCH] " kernel test robot
  0 siblings, 2 replies; 3+ messages in thread
From: David Marlin @ 2026-08-14  5:10 UTC (permalink / raw)
  To: linux-bluetooth, Luiz Augusto von Dentz
  Cc: Gustavo A . R . Silva, David Marlin, Bastien Nocera

A recent build attempt, using gcc-14.4 on RHEL-10, produced the
following errors:

In file included from ./include/net/bluetooth/hci_core.h:35,
                 from net/bluetooth/hci_core.c:39:
./include/net/bluetooth/hci.h:1476:34: error: declaration does not
declare anything [-Werror]
  1476 |         struct hci_std_codecs_hdr;
       |                                  ^
./include/net/bluetooth/hci.h:1477:17: error: flexible array member in a
struct with no named members
  1477 |         __u8    codec[];
       |                 ^~~~~

./include/net/bluetooth/hci.h:1516:37: error: declaration does not
declare anything [-Werror]
  1516 |         struct hci_std_codecs_v2_hdr;
       |                                     ^
./include/net/bluetooth/hci.h:1517:33: error: flexible array member in a
struct with no named members
  1517 |         struct hci_std_codec_v2 codec[];
       |                                 ^~~~~

cc1: all warnings being treated as errors

Adding a variable name (e.g., 'num') to each of the above struct definitions
avoids the error without changing the layout of the struct.

Fixes: a0cff16d0f6e ("Bluetooth: hci.h: Avoid a couple -Wflex-array-member-not-at-end warnings")

Reviewed-by: Bastien Nocera <hadess@hadess.net>
Signed-off-by: David Marlin <dmarlin@redhat.com>
---
 include/net/bluetooth/hci.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
index 1641d879dbda..5ccc4545e380 100644
--- a/include/net/bluetooth/hci.h
+++ b/include/net/bluetooth/hci.h
@@ -1472,7 +1472,7 @@ struct hci_std_codecs_hdr {
 } __packed;
 
 struct hci_std_codecs {
-	struct hci_std_codecs_hdr;
+	struct hci_std_codecs_hdr num;
 	__u8	codec[];
 } __packed;
 
@@ -1512,7 +1512,7 @@ struct hci_std_codecs_v2_hdr {
 } __packed;
 
 struct hci_std_codecs_v2 {
-	struct hci_std_codecs_v2_hdr;
+	struct hci_std_codecs_v2_hdr num;
 	struct hci_std_codec_v2 codec[];
 } __packed;
 
-- 
2.55.0


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

* RE: Bluetooth: hci-core: fix "declaration does not declare anything" error
  2026-08-14  5:10 [PATCH] Bluetooth: hci-core: fix "declaration does not declare anything" error David Marlin
@ 2026-08-14  5:46 ` bluez.test.bot
  2026-08-21  2:08 ` [PATCH] " kernel test robot
  1 sibling, 0 replies; 3+ messages in thread
From: bluez.test.bot @ 2026-08-14  5:46 UTC (permalink / raw)
  To: linux-bluetooth, dmarlin

[-- Attachment #1: Type: text/plain, Size: 69449 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=1145827

---Test result---

Test Summary:
CheckPatch                    FAIL      0.57 seconds
VerifyFixes                   PASS      0.10 seconds
VerifySignedoff               PASS      0.08 seconds
GitLint                       PASS      0.21 seconds
SubjectPrefix                 PASS      0.07 seconds
BuildKernel                   FAIL      24.93 seconds
CheckAllWarning               FAIL      27.58 seconds
CheckSparse                   FAIL      26.43 seconds
BuildKernel32                 FAIL      23.99 seconds
CheckKernelLLVM               SKIP      0.00 seconds
TestRunnerSetup               FAIL      489.84 seconds
TestRunner_l2cap-tester       FAIL      0.07 seconds
TestRunner_iso-tester         FAIL      0.07 seconds
TestRunner_bnep-tester        FAIL      0.07 seconds
TestRunner_mgmt-tester        FAIL      0.08 seconds
TestRunner_rfcomm-tester      FAIL      0.07 seconds
TestRunner_sco-tester         FAIL      0.16 seconds
TestRunner_ioctl-tester       FAIL      0.07 seconds
TestRunner_mesh-tester        FAIL      0.07 seconds
TestRunner_smp-tester         FAIL      0.08 seconds
TestRunner_userchan-tester    FAIL      0.07 seconds
TestRunner_6lowpan-tester     FAIL      0.07 seconds
IncrementalBuild              FAIL      23.24 seconds

Details
##############################
Test: CheckPatch - FAIL
Desc: Run checkpatch.pl script
Output:
Bluetooth: hci-core: fix "declaration does not declare anything" error
WARNING: Prefer a maximum 75 chars per line (possible unwrapped commit description?)
#107: 
Adding a variable name (e.g., 'num') to each of the above struct definitions

total: 0 errors, 1 warnings, 16 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/patch/14749535.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: BuildKernel - FAIL
Desc: Build Kernel for Bluetooth
Output:

net/bluetooth/hci_codec.c: In function ‘hci_read_supported_codecs’:
net/bluetooth/hci_codec.c:151:2: error: aggregate value used where an integer was expected
  151 |  if (skb->len < flex_array_size(std_codecs, codec, std_codecs->num)
      |  ^~
In file included from ./include/linux/bits.h:32,
                 from ./include/linux/ratelimit_types.h:5,
                 from ./include/linux/printk.h:9,
                 from ./include/asm-generic/bug.h:31,
                 from ./arch/x86/include/asm/bug.h:195,
                 from ./include/linux/ktime.h:24,
                 from ./include/linux/poll.h:7,
                 from ./include/net/bluetooth/bluetooth.h:26,
                 from net/bluetooth/hci_codec.c:5:
./include/linux/overflow.h:420:11: error: invalid operands to binary * (have ‘struct hci_std_codecs_hdr’ and ‘long unsigned int’)
  420 |   (count) * sizeof(*(p)->member) + __must_be_array((p)->member), \
      |   ~~~~~~~ ^
net/bluetooth/hci_codec.c:151:17: note: in expansion of macro ‘flex_array_size’
  151 |  if (skb->len < flex_array_size(std_codecs, codec, std_codecs->num)
      |                 ^~~~~~~~~~~~~~~
net/bluetooth/hci_codec.c:151:62: error: incompatible type for argument 1 of ‘size_mul’
  151 |  if (skb->len < flex_array_size(std_codecs, codec, std_codecs->num)
      |                                                    ~~~~~~~~~~^~~~~
      |                                                              |
      |                                                              struct hci_std_codecs_hdr
./include/linux/overflow.h:421:12: note: in definition of macro ‘flex_array_size’
  421 |   size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member)))
      |            ^~~~~
./include/linux/overflow.h:330:60: note: expected ‘size_t’ {aka ‘long unsigned int’} but argument is of type ‘struct hci_std_codecs_hdr’
  330 | static __always_inline size_t __must_check size_mul(size_t factor1, size_t factor2)
      |                                                     ~~~~~~~^~~~~~~
net/bluetooth/hci_codec.c:157:16: error: invalid operands to binary < (have ‘int’ and ‘struct hci_std_codecs_hdr’)
  157 |  for (i = 0; i < std_codecs->num; i++) {
      |                ^ ~~~~~~~~~~~~~~~
      |                            |
      |                            struct hci_std_codecs_hdr
net/bluetooth/hci_codec.c:164:2: error: aggregate value used where an integer was expected
  164 |  skb_pull(skb, flex_array_size(std_codecs, codec, std_codecs->num)
      |  ^~~~~~~~
In file included from ./include/linux/bits.h:32,
                 from ./include/linux/ratelimit_types.h:5,
                 from ./include/linux/printk.h:9,
                 from ./include/asm-generic/bug.h:31,
                 from ./arch/x86/include/asm/bug.h:195,
                 from ./include/linux/ktime.h:24,
                 from ./include/linux/poll.h:7,
                 from ./include/net/bluetooth/bluetooth.h:26,
                 from net/bluetooth/hci_codec.c:5:
./include/linux/overflow.h:420:11: error: invalid operands to binary * (have ‘struct hci_std_codecs_hdr’ and ‘long unsigned int’)
  420 |   (count) * sizeof(*(p)->member) + __must_be_array((p)->member), \
      |   ~~~~~~~ ^
net/bluetooth/hci_codec.c:164:16: note: in expansion of macro ‘flex_array_size’
  164 |  skb_pull(skb, flex_array_size(std_codecs, codec, std_codecs->num)
      |                ^~~~~~~~~~~~~~~
net/bluetooth/hci_codec.c:164:61: error: incompatible type for argument 1 of ‘size_mul’
  164 |  skb_pull(skb, flex_array_size(std_codecs, codec, std_codecs->num)
      |                                                   ~~~~~~~~~~^~~~~
      |                                                             |
      |                                                             struct hci_std_codecs_hdr
./include/linux/overflow.h:421:12: note: in definition of macro ‘flex_array_size’
  421 |   size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member)))
      |            ^~~~~
./include/linux/overflow.h:330:60: note: expected ‘size_t’ {aka ‘long unsigned int’} but argument is of type ‘struct hci_std_codecs_hdr’
  330 | static __always_inline size_t __must_check size_mul(size_t factor1, size_t factor2)
      |                                                     ~~~~~~~^~~~~~~
net/bluetooth/hci_codec.c: In function ‘hci_read_supported_codecs_v2’:
net/bluetooth/hci_codec.c:220:2: error: aggregate value used where an integer was expected
  220 |  if (skb->len < flex_array_size(std_codecs, codec, std_codecs->num)
      |  ^~
In file included from ./include/linux/bits.h:32,
                 from ./include/linux/ratelimit_types.h:5,
                 from ./include/linux/printk.h:9,
                 from ./include/asm-generic/bug.h:31,
                 from ./arch/x86/include/asm/bug.h:195,
                 from ./include/linux/ktime.h:24,
                 from ./include/linux/poll.h:7,
                 from ./include/net/bluetooth/bluetooth.h:26,
                 from net/bluetooth/hci_codec.c:5:
./include/linux/overflow.h:420:11: error: invalid operands to binary * (have ‘struct hci_std_codecs_v2_hdr’ and ‘long unsigned int’)
  420 |   (count) * sizeof(*(p)->member) + __must_be_array((p)->member), \
      |   ~~~~~~~ ^
net/bluetooth/hci_codec.c:220:17: note: in expansion of macro ‘flex_array_size’
  220 |  if (skb->len < flex_array_size(std_codecs, codec, std_codecs->num)
      |                 ^~~~~~~~~~~~~~~
net/bluetooth/hci_codec.c:220:62: error: incompatible type for argument 1 of ‘size_mul’
  220 |  if (skb->len < flex_array_size(std_codecs, codec, std_codecs->num)
      |                                                    ~~~~~~~~~~^~~~~
      |                                                              |
      |                                                              struct hci_std_codecs_v2_hdr
./include/linux/overflow.h:421:12: note: in definition of macro ‘flex_array_size’
  421 |   size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member)))
      |            ^~~~~
./include/linux/overflow.h:330:60: note: expected ‘size_t’ {aka ‘long unsigned int’} but argument is of type ‘struct hci_std_codecs_v2_hdr’
  330 | static __always_inline size_t __must_check size_mul(size_t factor1, size_t factor2)
      |                                                     ~~~~~~~^~~~~~~
net/bluetooth/hci_codec.c:226:16: error: invalid operands to binary < (have ‘int’ and ‘struct hci_std_codecs_v2_hdr’)
  226 |  for (i = 0; i < std_codecs->num; i++) {
      |                ^ ~~~~~~~~~~~~~~~
      |                            |
      |                            struct hci_std_codecs_v2_hdr
net/bluetooth/hci_codec.c:232:2: error: aggregate value used where an integer was expected
  232 |  skb_pull(skb, flex_array_size(std_codecs, codec, std_codecs->num)
      |  ^~~~~~~~
In file included from ./include/linux/bits.h:32,
                 from ./include/linux/ratelimit_types.h:5,
                 from ./include/linux/printk.h:9,
                 from ./include/asm-generic/bug.h:31,
                 from ./arch/x86/include/asm/bug.h:195,
                 from ./include/linux/ktime.h:24,
                 from ./include/linux/poll.h:7,
                 from ./include/net/bluetooth/bluetooth.h:26,
                 from net/bluetooth/hci_codec.c:5:
./include/linux/overflow.h:420:11: error: invalid operands to binary * (have ‘struct hci_std_codecs_v2_hdr’ and ‘long unsigned int’)
  420 |   (count) * sizeof(*(p)->member) + __must_be_array((p)->member), \
      |   ~~~~~~~ ^
net/bluetooth/hci_codec.c:232:16: note: in expansion of macro ‘flex_array_size’
  232 |  skb_pull(skb, flex_array_size(std_codecs, codec, std_codecs->num)
      |                ^~~~~~~~~~~~~~~
net/bluetooth/hci_codec.c:232:61: error: incompatible type for argument 1 of ‘size_mul’
  232 |  skb_pull(skb, flex_array_size(std_codecs, codec, std_codecs->num)
      |                                                   ~~~~~~~~~~^~~~~
      |                                                             |
      |                                                             struct hci_std_codecs_v2_hdr
./include/linux/overflow.h:421:12: note: in definition of macro ‘flex_array_size’
  421 |   size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member)))
      |            ^~~~~
./include/linux/overflow.h:330:60: note: expected ‘size_t’ {aka ‘long unsigned int’} but argument is of type ‘struct hci_std_codecs_v2_hdr’
  330 | static __always_inline size_t __must_check size_mul(size_t factor1, size_t factor2)
      |                                                     ~~~~~~~^~~~~~~
make[4]: *** [scripts/Makefile.build:289: net/bluetooth/hci_codec.o] Error 1
make[4]: *** Waiting for unfinished jobs....
make[3]: *** [scripts/Makefile.build:549: net/bluetooth] Error 2
make[2]: *** [scripts/Makefile.build:549: net] Error 2
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [/github/workspace/src/src/Makefile:2187: .] Error 2
make: *** [Makefile:248: __sub-make] Error 2
##############################
Test: CheckAllWarning - FAIL
Desc: Run linux kernel with all warning enabled
Output:

net/bluetooth/hci_codec.c: In function ‘hci_read_supported_codecs’:
net/bluetooth/hci_codec.c:151:2: error: aggregate value used where an integer was expected
  151 |  if (skb->len < flex_array_size(std_codecs, codec, std_codecs->num)
      |  ^~
In file included from ./include/linux/bits.h:32,
                 from ./include/linux/ratelimit_types.h:5,
                 from ./include/linux/printk.h:9,
                 from ./include/asm-generic/bug.h:31,
                 from ./arch/x86/include/asm/bug.h:195,
                 from ./include/linux/ktime.h:24,
                 from ./include/linux/poll.h:7,
                 from ./include/net/bluetooth/bluetooth.h:26,
                 from net/bluetooth/hci_codec.c:5:
./include/linux/overflow.h:420:11: error: invalid operands to binary * (have ‘struct hci_std_codecs_hdr’ and ‘long unsigned int’)
  420 |   (count) * sizeof(*(p)->member) + __must_be_array((p)->member), \
      |   ~~~~~~~ ^
net/bluetooth/hci_codec.c:151:17: note: in expansion of macro ‘flex_array_size’
  151 |  if (skb->len < flex_array_size(std_codecs, codec, std_codecs->num)
      |                 ^~~~~~~~~~~~~~~
net/bluetooth/hci_codec.c:151:62: error: incompatible type for argument 1 of ‘size_mul’
  151 |  if (skb->len < flex_array_size(std_codecs, codec, std_codecs->num)
      |                                                    ~~~~~~~~~~^~~~~
      |                                                              |
      |                                                              struct hci_std_codecs_hdr
./include/linux/overflow.h:421:12: note: in definition of macro ‘flex_array_size’
  421 |   size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member)))
      |            ^~~~~
./include/linux/overflow.h:330:60: note: expected ‘size_t’ {aka ‘long unsigned int’} but argument is of type ‘struct hci_std_codecs_hdr’
  330 | static __always_inline size_t __must_check size_mul(size_t factor1, size_t factor2)
      |                                                     ~~~~~~~^~~~~~~
net/bluetooth/hci_codec.c:157:16: error: invalid operands to binary < (have ‘int’ and ‘struct hci_std_codecs_hdr’)
  157 |  for (i = 0; i < std_codecs->num; i++) {
      |                ^ ~~~~~~~~~~~~~~~
      |                            |
      |                            struct hci_std_codecs_hdr
net/bluetooth/hci_codec.c:164:2: error: aggregate value used where an integer was expected
  164 |  skb_pull(skb, flex_array_size(std_codecs, codec, std_codecs->num)
      |  ^~~~~~~~
In file included from ./include/linux/bits.h:32,
                 from ./include/linux/ratelimit_types.h:5,
                 from ./include/linux/printk.h:9,
                 from ./include/asm-generic/bug.h:31,
                 from ./arch/x86/include/asm/bug.h:195,
                 from ./include/linux/ktime.h:24,
                 from ./include/linux/poll.h:7,
                 from ./include/net/bluetooth/bluetooth.h:26,
                 from net/bluetooth/hci_codec.c:5:
./include/linux/overflow.h:420:11: error: invalid operands to binary * (have ‘struct hci_std_codecs_hdr’ and ‘long unsigned int’)
  420 |   (count) * sizeof(*(p)->member) + __must_be_array((p)->member), \
      |   ~~~~~~~ ^
net/bluetooth/hci_codec.c:164:16: note: in expansion of macro ‘flex_array_size’
  164 |  skb_pull(skb, flex_array_size(std_codecs, codec, std_codecs->num)
      |                ^~~~~~~~~~~~~~~
net/bluetooth/hci_codec.c:164:61: error: incompatible type for argument 1 of ‘size_mul’
  164 |  skb_pull(skb, flex_array_size(std_codecs, codec, std_codecs->num)
      |                                                   ~~~~~~~~~~^~~~~
      |                                                             |
      |                                                             struct hci_std_codecs_hdr
./include/linux/overflow.h:421:12: note: in definition of macro ‘flex_array_size’
  421 |   size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member)))
      |            ^~~~~
./include/linux/overflow.h:330:60: note: expected ‘size_t’ {aka ‘long unsigned int’} but argument is of type ‘struct hci_std_codecs_hdr’
  330 | static __always_inline size_t __must_check size_mul(size_t factor1, size_t factor2)
      |                                                     ~~~~~~~^~~~~~~
net/bluetooth/hci_codec.c: In function ‘hci_read_supported_codecs_v2’:
net/bluetooth/hci_codec.c:220:2: error: aggregate value used where an integer was expected
  220 |  if (skb->len < flex_array_size(std_codecs, codec, std_codecs->num)
      |  ^~
In file included from ./include/linux/bits.h:32,
                 from ./include/linux/ratelimit_types.h:5,
                 from ./include/linux/printk.h:9,
                 from ./include/asm-generic/bug.h:31,
                 from ./arch/x86/include/asm/bug.h:195,
                 from ./include/linux/ktime.h:24,
                 from ./include/linux/poll.h:7,
                 from ./include/net/bluetooth/bluetooth.h:26,
                 from net/bluetooth/hci_codec.c:5:
./include/linux/overflow.h:420:11: error: invalid operands to binary * (have ‘struct hci_std_codecs_v2_hdr’ and ‘long unsigned int’)
  420 |   (count) * sizeof(*(p)->member) + __must_be_array((p)->member), \
      |   ~~~~~~~ ^
net/bluetooth/hci_codec.c:220:17: note: in expansion of macro ‘flex_array_size’
  220 |  if (skb->len < flex_array_size(std_codecs, codec, std_codecs->num)
      |                 ^~~~~~~~~~~~~~~
net/bluetooth/hci_codec.c:220:62: error: incompatible type for argument 1 of ‘size_mul’
  220 |  if (skb->len < flex_array_size(std_codecs, codec, std_codecs->num)
      |                                                    ~~~~~~~~~~^~~~~
      |                                                              |
      |                                                              struct hci_std_codecs_v2_hdr
./include/linux/overflow.h:421:12: note: in definition of macro ‘flex_array_size’
  421 |   size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member)))
      |            ^~~~~
./include/linux/overflow.h:330:60: note: expected ‘size_t’ {aka ‘long unsigned int’} but argument is of type ‘struct hci_std_codecs_v2_hdr’
  330 | static __always_inline size_t __must_check size_mul(size_t factor1, size_t factor2)
      |                                                     ~~~~~~~^~~~~~~
net/bluetooth/hci_codec.c:226:16: error: invalid operands to binary < (have ‘int’ and ‘struct hci_std_codecs_v2_hdr’)
  226 |  for (i = 0; i < std_codecs->num; i++) {
      |                ^ ~~~~~~~~~~~~~~~
      |                            |
      |                            struct hci_std_codecs_v2_hdr
net/bluetooth/hci_codec.c:232:2: error: aggregate value used where an integer was expected
  232 |  skb_pull(skb, flex_array_size(std_codecs, codec, std_codecs->num)
      |  ^~~~~~~~
In file included from ./include/linux/bits.h:32,
                 from ./include/linux/ratelimit_types.h:5,
                 from ./include/linux/printk.h:9,
                 from ./include/asm-generic/bug.h:31,
                 from ./arch/x86/include/asm/bug.h:195,
                 from ./include/linux/ktime.h:24,
                 from ./include/linux/poll.h:7,
                 from ./include/net/bluetooth/bluetooth.h:26,
                 from net/bluetooth/hci_codec.c:5:
./include/linux/overflow.h:420:11: error: invalid operands to binary * (have ‘struct hci_std_codecs_v2_hdr’ and ‘long unsigned int’)
  420 |   (count) * sizeof(*(p)->member) + __must_be_array((p)->member), \
      |   ~~~~~~~ ^
net/bluetooth/hci_codec.c:232:16: note: in expansion of macro ‘flex_array_size’
  232 |  skb_pull(skb, flex_array_size(std_codecs, codec, std_codecs->num)
      |                ^~~~~~~~~~~~~~~
net/bluetooth/hci_codec.c:232:61: error: incompatible type for argument 1 of ‘size_mul’
  232 |  skb_pull(skb, flex_array_size(std_codecs, codec, std_codecs->num)
      |                                                   ~~~~~~~~~~^~~~~
      |                                                             |
      |                                                             struct hci_std_codecs_v2_hdr
./include/linux/overflow.h:421:12: note: in definition of macro ‘flex_array_size’
  421 |   size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member)))
      |            ^~~~~
./include/linux/overflow.h:330:60: note: expected ‘size_t’ {aka ‘long unsigned int’} but argument is of type ‘struct hci_std_codecs_v2_hdr’
  330 | static __always_inline size_t __must_check size_mul(size_t factor1, size_t factor2)
      |                                                     ~~~~~~~^~~~~~~
make[4]: *** [scripts/Makefile.build:289: net/bluetooth/hci_codec.o] Error 1
make[4]: *** Waiting for unfinished jobs....
make[3]: *** [scripts/Makefile.build:549: net/bluetooth] Error 2
make[2]: *** [scripts/Makefile.build:549: net] Error 2
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [/github/workspace/src/src/Makefile:2187: .] Error 2
make: *** [Makefile:248: __sub-make] Error 2
##############################
Test: CheckSparse - FAIL
Desc: Run sparse tool with linux kernel
Output:

/github/workspace/src/src/Makefile:1283: C=1 specified, but sparse is not available or not up to date
/github/workspace/src/src/Makefile:1283: C=1 specified, but sparse is not available or not up to date
net/bluetooth/hci_codec.c: In function ‘hci_read_supported_codecs’:
net/bluetooth/hci_codec.c:151:2: error: aggregate value used where an integer was expected
  151 |  if (skb->len < flex_array_size(std_codecs, codec, std_codecs->num)
      |  ^~
In file included from ./include/linux/bits.h:32,
                 from ./include/linux/ratelimit_types.h:5,
                 from ./include/linux/printk.h:9,
                 from ./include/asm-generic/bug.h:31,
                 from ./arch/x86/include/asm/bug.h:195,
                 from ./include/linux/ktime.h:24,
                 from ./include/linux/poll.h:7,
                 from ./include/net/bluetooth/bluetooth.h:26,
                 from net/bluetooth/hci_codec.c:5:
./include/linux/overflow.h:420:11: error: invalid operands to binary * (have ‘struct hci_std_codecs_hdr’ and ‘long unsigned int’)
  420 |   (count) * sizeof(*(p)->member) + __must_be_array((p)->member), \
      |   ~~~~~~~ ^
net/bluetooth/hci_codec.c:151:17: note: in expansion of macro ‘flex_array_size’
  151 |  if (skb->len < flex_array_size(std_codecs, codec, std_codecs->num)
      |                 ^~~~~~~~~~~~~~~
net/bluetooth/hci_codec.c:151:62: error: incompatible type for argument 1 of ‘size_mul’
  151 |  if (skb->len < flex_array_size(std_codecs, codec, std_codecs->num)
      |                                                    ~~~~~~~~~~^~~~~
      |                                                              |
      |                                                              struct hci_std_codecs_hdr
./include/linux/overflow.h:421:12: note: in definition of macro ‘flex_array_size’
  421 |   size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member)))
      |            ^~~~~
./include/linux/overflow.h:330:60: note: expected ‘size_t’ {aka ‘long unsigned int’} but argument is of type ‘struct hci_std_codecs_hdr’
  330 | static __always_inline size_t __must_check size_mul(size_t factor1, size_t factor2)
      |                                                     ~~~~~~~^~~~~~~
net/bluetooth/hci_codec.c:157:16: error: invalid operands to binary < (have ‘int’ and ‘struct hci_std_codecs_hdr’)
  157 |  for (i = 0; i < std_codecs->num; i++) {
      |                ^ ~~~~~~~~~~~~~~~
      |                            |
      |                            struct hci_std_codecs_hdr
net/bluetooth/hci_codec.c:164:2: error: aggregate value used where an integer was expected
  164 |  skb_pull(skb, flex_array_size(std_codecs, codec, std_codecs->num)
      |  ^~~~~~~~
In file included from ./include/linux/bits.h:32,
                 from ./include/linux/ratelimit_types.h:5,
                 from ./include/linux/printk.h:9,
                 from ./include/asm-generic/bug.h:31,
                 from ./arch/x86/include/asm/bug.h:195,
                 from ./include/linux/ktime.h:24,
                 from ./include/linux/poll.h:7,
                 from ./include/net/bluetooth/bluetooth.h:26,
                 from net/bluetooth/hci_codec.c:5:
./include/linux/overflow.h:420:11: error: invalid operands to binary * (have ‘struct hci_std_codecs_hdr’ and ‘long unsigned int’)
  420 |   (count) * sizeof(*(p)->member) + __must_be_array((p)->member), \
      |   ~~~~~~~ ^
net/bluetooth/hci_codec.c:164:16: note: in expansion of macro ‘flex_array_size’
  164 |  skb_pull(skb, flex_array_size(std_codecs, codec, std_codecs->num)
      |                ^~~~~~~~~~~~~~~
net/bluetooth/hci_codec.c:164:61: error: incompatible type for argument 1 of ‘size_mul’
  164 |  skb_pull(skb, flex_array_size(std_codecs, codec, std_codecs->num)
      |                                                   ~~~~~~~~~~^~~~~
      |                                                             |
      |                                                             struct hci_std_codecs_hdr
./include/linux/overflow.h:421:12: note: in definition of macro ‘flex_array_size’
  421 |   size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member)))
      |            ^~~~~
./include/linux/overflow.h:330:60: note: expected ‘size_t’ {aka ‘long unsigned int’} but argument is of type ‘struct hci_std_codecs_hdr’
  330 | static __always_inline size_t __must_check size_mul(size_t factor1, size_t factor2)
      |                                                     ~~~~~~~^~~~~~~
net/bluetooth/hci_codec.c: In function ‘hci_read_supported_codecs_v2’:
net/bluetooth/hci_codec.c:220:2: error: aggregate value used where an integer was expected
  220 |  if (skb->len < flex_array_size(std_codecs, codec, std_codecs->num)
      |  ^~
In file included from ./include/linux/bits.h:32,
                 from ./include/linux/ratelimit_types.h:5,
                 from ./include/linux/printk.h:9,
                 from ./include/asm-generic/bug.h:31,
                 from ./arch/x86/include/asm/bug.h:195,
                 from ./include/linux/ktime.h:24,
                 from ./include/linux/poll.h:7,
                 from ./include/net/bluetooth/bluetooth.h:26,
                 from net/bluetooth/hci_codec.c:5:
./include/linux/overflow.h:420:11: error: invalid operands to binary * (have ‘struct hci_std_codecs_v2_hdr’ and ‘long unsigned int’)
  420 |   (count) * sizeof(*(p)->member) + __must_be_array((p)->member), \
      |   ~~~~~~~ ^
net/bluetooth/hci_codec.c:220:17: note: in expansion of macro ‘flex_array_size’
  220 |  if (skb->len < flex_array_size(std_codecs, codec, std_codecs->num)
      |                 ^~~~~~~~~~~~~~~
net/bluetooth/hci_codec.c:220:62: error: incompatible type for argument 1 of ‘size_mul’
  220 |  if (skb->len < flex_array_size(std_codecs, codec, std_codecs->num)
      |                                                    ~~~~~~~~~~^~~~~
      |                                                              |
      |                                                              struct hci_std_codecs_v2_hdr
./include/linux/overflow.h:421:12: note: in definition of macro ‘flex_array_size’
  421 |   size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member)))
      |            ^~~~~
./include/linux/overflow.h:330:60: note: expected ‘size_t’ {aka ‘long unsigned int’} but argument is of type ‘struct hci_std_codecs_v2_hdr’
  330 | static __always_inline size_t __must_check size_mul(size_t factor1, size_t factor2)
      |                                                     ~~~~~~~^~~~~~~
net/bluetooth/hci_codec.c:226:16: error: invalid operands to binary < (have ‘int’ and ‘struct hci_std_codecs_v2_hdr’)
  226 |  for (i = 0; i < std_codecs->num; i++) {
      |                ^ ~~~~~~~~~~~~~~~
      |                            |
      |                            struct hci_std_codecs_v2_hdr
net/bluetooth/hci_codec.c:232:2: error: aggregate value used where an integer was expected
  232 |  skb_pull(skb, flex_array_size(std_codecs, codec, std_codecs->num)
      |  ^~~~~~~~
In file included from ./include/linux/bits.h:32,
                 from ./include/linux/ratelimit_types.h:5,
                 from ./include/linux/printk.h:9,
                 from ./include/asm-generic/bug.h:31,
                 from ./arch/x86/include/asm/bug.h:195,
                 from ./include/linux/ktime.h:24,
                 from ./include/linux/poll.h:7,
                 from ./include/net/bluetooth/bluetooth.h:26,
                 from net/bluetooth/hci_codec.c:5:
./include/linux/overflow.h:420:11: error: invalid operands to binary * (have ‘struct hci_std_codecs_v2_hdr’ and ‘long unsigned int’)
  420 |   (count) * sizeof(*(p)->member) + __must_be_array((p)->member), \
      |   ~~~~~~~ ^
net/bluetooth/hci_codec.c:232:16: note: in expansion of macro ‘flex_array_size’
  232 |  skb_pull(skb, flex_array_size(std_codecs, codec, std_codecs->num)
      |                ^~~~~~~~~~~~~~~
net/bluetooth/hci_codec.c:232:61: error: incompatible type for argument 1 of ‘size_mul’
  232 |  skb_pull(skb, flex_array_size(std_codecs, codec, std_codecs->num)
      |                                                   ~~~~~~~~~~^~~~~
      |                                                             |
      |                                                             struct hci_std_codecs_v2_hdr
./include/linux/overflow.h:421:12: note: in definition of macro ‘flex_array_size’
  421 |   size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member)))
      |            ^~~~~
./include/linux/overflow.h:330:60: note: expected ‘size_t’ {aka ‘long unsigned int’} but argument is of type ‘struct hci_std_codecs_v2_hdr’
  330 | static __always_inline size_t __must_check size_mul(size_t factor1, size_t factor2)
      |                                                     ~~~~~~~^~~~~~~
make[4]: *** [scripts/Makefile.build:289: net/bluetooth/hci_codec.o] Error 1
make[4]: *** Waiting for unfinished jobs....
make[3]: *** [scripts/Makefile.build:549: net/bluetooth] Error 2
make[2]: *** [scripts/Makefile.build:549: net] Error 2
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [/github/workspace/src/src/Makefile:2187: .] Error 2
make: *** [Makefile:248: __sub-make] Error 2
##############################
Test: BuildKernel32 - FAIL
Desc: Build 32bit Kernel for Bluetooth
Output:

net/bluetooth/hci_codec.c: In function ‘hci_read_supported_codecs’:
net/bluetooth/hci_codec.c:151:2: error: aggregate value used where an integer was expected
  151 |  if (skb->len < flex_array_size(std_codecs, codec, std_codecs->num)
      |  ^~
In file included from ./include/linux/bits.h:32,
                 from ./include/linux/ratelimit_types.h:5,
                 from ./include/linux/printk.h:9,
                 from ./include/asm-generic/bug.h:31,
                 from ./arch/x86/include/asm/bug.h:195,
                 from ./include/linux/ktime.h:24,
                 from ./include/linux/poll.h:7,
                 from ./include/net/bluetooth/bluetooth.h:26,
                 from net/bluetooth/hci_codec.c:5:
./include/linux/overflow.h:420:11: error: invalid operands to binary * (have ‘struct hci_std_codecs_hdr’ and ‘unsigned int’)
  420 |   (count) * sizeof(*(p)->member) + __must_be_array((p)->member), \
      |   ~~~~~~~ ^
net/bluetooth/hci_codec.c:151:17: note: in expansion of macro ‘flex_array_size’
  151 |  if (skb->len < flex_array_size(std_codecs, codec, std_codecs->num)
      |                 ^~~~~~~~~~~~~~~
net/bluetooth/hci_codec.c:151:62: error: incompatible type for argument 1 of ‘size_mul’
  151 |  if (skb->len < flex_array_size(std_codecs, codec, std_codecs->num)
      |                                                    ~~~~~~~~~~^~~~~
      |                                                              |
      |                                                              struct hci_std_codecs_hdr
./include/linux/overflow.h:421:12: note: in definition of macro ‘flex_array_size’
  421 |   size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member)))
      |            ^~~~~
./include/linux/overflow.h:330:60: note: expected ‘size_t’ {aka ‘unsigned int’} but argument is of type ‘struct hci_std_codecs_hdr’
  330 | static __always_inline size_t __must_check size_mul(size_t factor1, size_t factor2)
      |                                                     ~~~~~~~^~~~~~~
net/bluetooth/hci_codec.c:157:16: error: invalid operands to binary < (have ‘int’ and ‘struct hci_std_codecs_hdr’)
  157 |  for (i = 0; i < std_codecs->num; i++) {
      |                ^ ~~~~~~~~~~~~~~~
      |                            |
      |                            struct hci_std_codecs_hdr
net/bluetooth/hci_codec.c:164:2: error: aggregate value used where an integer was expected
  164 |  skb_pull(skb, flex_array_size(std_codecs, codec, std_codecs->num)
      |  ^~~~~~~~
In file included from ./include/linux/bits.h:32,
                 from ./include/linux/ratelimit_types.h:5,
                 from ./include/linux/printk.h:9,
                 from ./include/asm-generic/bug.h:31,
                 from ./arch/x86/include/asm/bug.h:195,
                 from ./include/linux/ktime.h:24,
                 from ./include/linux/poll.h:7,
                 from ./include/net/bluetooth/bluetooth.h:26,
                 from net/bluetooth/hci_codec.c:5:
./include/linux/overflow.h:420:11: error: invalid operands to binary * (have ‘struct hci_std_codecs_hdr’ and ‘unsigned int’)
  420 |   (count) * sizeof(*(p)->member) + __must_be_array((p)->member), \
      |   ~~~~~~~ ^
net/bluetooth/hci_codec.c:164:16: note: in expansion of macro ‘flex_array_size’
  164 |  skb_pull(skb, flex_array_size(std_codecs, codec, std_codecs->num)
      |                ^~~~~~~~~~~~~~~
net/bluetooth/hci_codec.c:164:61: error: incompatible type for argument 1 of ‘size_mul’
  164 |  skb_pull(skb, flex_array_size(std_codecs, codec, std_codecs->num)
      |                                                   ~~~~~~~~~~^~~~~
      |                                                             |
      |                                                             struct hci_std_codecs_hdr
./include/linux/overflow.h:421:12: note: in definition of macro ‘flex_array_size’
  421 |   size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member)))
      |            ^~~~~
./include/linux/overflow.h:330:60: note: expected ‘size_t’ {aka ‘unsigned int’} but argument is of type ‘struct hci_std_codecs_hdr’
  330 | static __always_inline size_t __must_check size_mul(size_t factor1, size_t factor2)
      |                                                     ~~~~~~~^~~~~~~
net/bluetooth/hci_codec.c: In function ‘hci_read_supported_codecs_v2’:
net/bluetooth/hci_codec.c:220:2: error: aggregate value used where an integer was expected
  220 |  if (skb->len < flex_array_size(std_codecs, codec, std_codecs->num)
      |  ^~
In file included from ./include/linux/bits.h:32,
                 from ./include/linux/ratelimit_types.h:5,
                 from ./include/linux/printk.h:9,
                 from ./include/asm-generic/bug.h:31,
                 from ./arch/x86/include/asm/bug.h:195,
                 from ./include/linux/ktime.h:24,
                 from ./include/linux/poll.h:7,
                 from ./include/net/bluetooth/bluetooth.h:26,
                 from net/bluetooth/hci_codec.c:5:
./include/linux/overflow.h:420:11: error: invalid operands to binary * (have ‘struct hci_std_codecs_v2_hdr’ and ‘unsigned int’)
  420 |   (count) * sizeof(*(p)->member) + __must_be_array((p)->member), \
      |   ~~~~~~~ ^
net/bluetooth/hci_codec.c:220:17: note: in expansion of macro ‘flex_array_size’
  220 |  if (skb->len < flex_array_size(std_codecs, codec, std_codecs->num)
      |                 ^~~~~~~~~~~~~~~
net/bluetooth/hci_codec.c:220:62: error: incompatible type for argument 1 of ‘size_mul’
  220 |  if (skb->len < flex_array_size(std_codecs, codec, std_codecs->num)
      |                                                    ~~~~~~~~~~^~~~~
      |                                                              |
      |                                                              struct hci_std_codecs_v2_hdr
./include/linux/overflow.h:421:12: note: in definition of macro ‘flex_array_size’
  421 |   size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member)))
      |            ^~~~~
./include/linux/overflow.h:330:60: note: expected ‘size_t’ {aka ‘unsigned int’} but argument is of type ‘struct hci_std_codecs_v2_hdr’
  330 | static __always_inline size_t __must_check size_mul(size_t factor1, size_t factor2)
      |                                                     ~~~~~~~^~~~~~~
net/bluetooth/hci_codec.c:226:16: error: invalid operands to binary < (have ‘int’ and ‘struct hci_std_codecs_v2_hdr’)
  226 |  for (i = 0; i < std_codecs->num; i++) {
      |                ^ ~~~~~~~~~~~~~~~
      |                            |
      |                            struct hci_std_codecs_v2_hdr
net/bluetooth/hci_codec.c:232:2: error: aggregate value used where an integer was expected
  232 |  skb_pull(skb, flex_array_size(std_codecs, codec, std_codecs->num)
      |  ^~~~~~~~
In file included from ./include/linux/bits.h:32,
                 from ./include/linux/ratelimit_types.h:5,
                 from ./include/linux/printk.h:9,
                 from ./include/asm-generic/bug.h:31,
                 from ./arch/x86/include/asm/bug.h:195,
                 from ./include/linux/ktime.h:24,
                 from ./include/linux/poll.h:7,
                 from ./include/net/bluetooth/bluetooth.h:26,
                 from net/bluetooth/hci_codec.c:5:
./include/linux/overflow.h:420:11: error: invalid operands to binary * (have ‘struct hci_std_codecs_v2_hdr’ and ‘unsigned int’)
  420 |   (count) * sizeof(*(p)->member) + __must_be_array((p)->member), \
      |   ~~~~~~~ ^
net/bluetooth/hci_codec.c:232:16: note: in expansion of macro ‘flex_array_size’
  232 |  skb_pull(skb, flex_array_size(std_codecs, codec, std_codecs->num)
      |                ^~~~~~~~~~~~~~~
net/bluetooth/hci_codec.c:232:61: error: incompatible type for argument 1 of ‘size_mul’
  232 |  skb_pull(skb, flex_array_size(std_codecs, codec, std_codecs->num)
      |                                                   ~~~~~~~~~~^~~~~
      |                                                             |
      |                                                             struct hci_std_codecs_v2_hdr
./include/linux/overflow.h:421:12: note: in definition of macro ‘flex_array_size’
  421 |   size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member)))
      |            ^~~~~
./include/linux/overflow.h:330:60: note: expected ‘size_t’ {aka ‘unsigned int’} but argument is of type ‘struct hci_std_codecs_v2_hdr’
  330 | static __always_inline size_t __must_check size_mul(size_t factor1, size_t factor2)
      |                                                     ~~~~~~~^~~~~~~
make[4]: *** [scripts/Makefile.build:289: net/bluetooth/hci_codec.o] Error 1
make[3]: *** [scripts/Makefile.build:549: net/bluetooth] Error 2
make[2]: *** [scripts/Makefile.build:549: net] Error 2
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [/github/workspace/src/src/Makefile:2187: .] Error 2
make: *** [Makefile:248: __sub-make] Error 2
##############################
Test: CheckKernelLLVM - SKIP
Desc: Build kernel with LLVM + context analysis
Output:
Clang not found
##############################
Test: TestRunnerSetup - FAIL
Desc: Setup kernel and bluez for test-runner
Output:
Kernel: 
net/bluetooth/hci_codec.c: In function ‘hci_read_supported_codecs’:
net/bluetooth/hci_codec.c:151:2: error: aggregate value used where an integer was expected
  151 |  if (skb->len < flex_array_size(std_codecs, codec, std_codecs->num)
      |  ^~
In file included from ./include/linux/bits.h:32,
                 from ./include/linux/ratelimit_types.h:5,
                 from ./include/linux/printk.h:9,
                 from ./include/asm-generic/bug.h:31,
                 from ./arch/x86/include/asm/bug.h:195,
                 from ./include/linux/ktime.h:24,
                 from ./include/linux/poll.h:7,
                 from ./include/net/bluetooth/bluetooth.h:26,
                 from net/bluetooth/hci_codec.c:5:
./include/linux/overflow.h:420:11: error: invalid operands to binary * (have ‘struct hci_std_codecs_hdr’ and ‘long unsigned int’)
  420 |   (count) * sizeof(*(p)->member) + __must_be_array((p)->member), \
      |   ~~~~~~~ ^
net/bluetooth/hci_codec.c:151:17: note: in expansion of macro ‘flex_array_size’
  151 |  if (skb->len < flex_array_size(std_codecs, codec, std_codecs->num)
      |                 ^~~~~~~~~~~~~~~
net/bluetooth/hci_codec.c:151:62: error: incompatible type for argument 1 of ‘size_mul’
  151 |  if (skb->len < flex_array_size(std_codecs, codec, std_codecs->num)
      |                                                    ~~~~~~~~~~^~~~~
      |                                                              |
      |                                                              struct hci_std_codecs_hdr
./include/linux/overflow.h:421:12: note: in definition of macro ‘flex_array_size’
  421 |   size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member)))
      |            ^~~~~
./include/linux/overflow.h:330:60: note: expected ‘size_t’ {aka ‘long unsigned int’} but argument is of type ‘struct hci_std_codecs_hdr’
  330 | static __always_inline size_t __must_check size_mul(size_t factor1, size_t factor2)
      |                                                     ~~~~~~~^~~~~~~
net/bluetooth/hci_codec.c:157:16: error: invalid operands to binary < (have ‘int’ and ‘struct hci_std_codecs_hdr’)
  157 |  for (i = 0; i < std_codecs->num; i++) {
      |                ^ ~~~~~~~~~~~~~~~
      |                            |
      |                            struct hci_std_codecs_hdr
net/bluetooth/hci_codec.c:164:2: error: aggregate value used where an integer was expected
  164 |  skb_pull(skb, flex_array_size(std_codecs, codec, std_codecs->num)
      |  ^~~~~~~~
In file included from ./include/linux/bits.h:32,
                 from ./include/linux/ratelimit_types.h:5,
                 from ./include/linux/printk.h:9,
                 from ./include/asm-generic/bug.h:31,
                 from ./arch/x86/include/asm/bug.h:195,
                 from ./include/linux/ktime.h:24,
                 from ./include/linux/poll.h:7,
                 from ./include/net/bluetooth/bluetooth.h:26,
                 from net/bluetooth/hci_codec.c:5:
./include/linux/overflow.h:420:11: error: invalid operands to binary * (have ‘struct hci_std_codecs_hdr’ and ‘long unsigned int’)
  420 |   (count) * sizeof(*(p)->member) + __must_be_array((p)->member), \
      |   ~~~~~~~ ^
net/bluetooth/hci_codec.c:164:16: note: in expansion of macro ‘flex_array_size’
  164 |  skb_pull(skb, flex_array_size(std_codecs, codec, std_codecs->num)
      |                ^~~~~~~~~~~~~~~
net/bluetooth/hci_codec.c:164:61: error: incompatible type for argument 1 of ‘size_mul’
  164 |  skb_pull(skb, flex_array_size(std_codecs, codec, std_codecs->num)
      |                                                   ~~~~~~~~~~^~~~~
      |                                                             |
      |                                                             struct hci_std_codecs_hdr
./include/linux/overflow.h:421:12: note: in definition of macro ‘flex_array_size’
  421 |   size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member)))
      |            ^~~~~
./include/linux/overflow.h:330:60: note: expected ‘size_t’ {aka ‘long unsigned int’} but argument is of type ‘struct hci_std_codecs_hdr’
  330 | static __always_inline size_t __must_check size_mul(size_t factor1, size_t factor2)
      |                                                     ~~~~~~~^~~~~~~
net/bluetooth/hci_codec.c: In function ‘hci_read_supported_codecs_v2’:
net/bluetooth/hci_codec.c:220:2: error: aggregate value used where an integer was expected
  220 |  if (skb->len < flex_array_size(std_codecs, codec, std_codecs->num)
      |  ^~
In file included from ./include/linux/bits.h:32,
                 from ./include/linux/ratelimit_types.h:5,
                 from ./include/linux/printk.h:9,
                 from ./include/asm-generic/bug.h:31,
                 from ./arch/x86/include/asm/bug.h:195,
                 from ./include/linux/ktime.h:24,
                 from ./include/linux/poll.h:7,
                 from ./include/net/bluetooth/bluetooth.h:26,
                 from net/bluetooth/hci_codec.c:5:
./include/linux/overflow.h:420:11: error: invalid operands to binary * (have ‘struct hci_std_codecs_v2_hdr’ and ‘long unsigned int’)
  420 |   (count) * sizeof(*(p)->member) + __must_be_array((p)->member), \
      |   ~~~~~~~ ^
net/bluetooth/hci_codec.c:220:17: note: in expansion of macro ‘flex_array_size’
  220 |  if (skb->len < flex_array_size(std_codecs, codec, std_codecs->num)
      |                 ^~~~~~~~~~~~~~~
net/bluetooth/hci_codec.c:220:62: error: incompatible type for argument 1 of ‘size_mul’
  220 |  if (skb->len < flex_array_size(std_codecs, codec, std_codecs->num)
      |                                                    ~~~~~~~~~~^~~~~
      |                                                              |
      |                                                              struct hci_std_codecs_v2_hdr
./include/linux/overflow.h:421:12: note: in definition of macro ‘flex_array_size’
  421 |   size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member)))
      |            ^~~~~
./include/linux/overflow.h:330:60: note: expected ‘size_t’ {aka ‘long unsigned int’} but argument is of type ‘struct hci_std_codecs_v2_hdr’
  330 | static __always_inline size_t __must_check size_mul(size_t factor1, size_t factor2)
      |                                                     ~~~~~~~^~~~~~~
net/bluetooth/hci_codec.c:226:16: error: invalid operands to binary < (have ‘int’ and ‘struct hci_std_codecs_v2_hdr’)
  226 |  for (i = 0; i < std_codecs->num; i++) {
      |                ^ ~~~~~~~~~~~~~~~
      |                            |
      |                            struct hci_std_codecs_v2_hdr
net/bluetooth/hci_codec.c:232:2: error: aggregate value used where an integer was expected
  232 |  skb_pull(skb, flex_array_size(std_codecs, codec, std_codecs->num)
      |  ^~~~~~~~
In file included from ./include/linux/bits.h:32,
                 from ./include/linux/ratelimit_types.h:5,
                 from ./include/linux/printk.h:9,
                 from ./include/asm-generic/bug.h:31,
                 from ./arch/x86/include/asm/bug.h:195,
                 from ./include/linux/ktime.h:24,
                 from ./include/linux/poll.h:7,
                 from ./include/net/bluetooth/bluetooth.h:26,
                 from net/bluetooth/hci_codec.c:5:
./include/linux/overflow.h:420:11: error: invalid operands to binary * (have ‘struct hci_std_codecs_v2_hdr’ and ‘long unsigned int’)
  420 |   (count) * sizeof(*(p)->member) + __must_be_array((p)->member), \
      |   ~~~~~~~ ^
net/bluetooth/hci_codec.c:232:16: note: in expansion of macro ‘flex_array_size’
  232 |  skb_pull(skb, flex_array_size(std_codecs, codec, std_codecs->num)
      |                ^~~~~~~~~~~~~~~
net/bluetooth/hci_codec.c:232:61: error: incompatible type for argument 1 of ‘size_mul’
  232 |  skb_pull(skb, flex_array_size(std_codecs, codec, std_codecs->num)
      |                                                   ~~~~~~~~~~^~~~~
      |                                                             |
      |                                                             struct hci_std_codecs_v2_hdr
./include/linux/overflow.h:421:12: note: in definition of macro ‘flex_array_size’
  421 |   size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member)))
      |            ^~~~~
./include/linux/overflow.h:330:60: note: expected ‘size_t’ {aka ‘long unsigned int’} but argument is of type ‘struct hci_std_codecs_v2_hdr’
  330 | static __always_inline size_t __must_check size_mul(size_t factor1, size_t factor2)
      |                                                     ~~~~~~~^~~~~~~
make[4]: *** [scripts/Makefile.build:289: net/bluetooth/hci_codec.o] Error 1
make[3]: *** [scripts/Makefile.build:549: net/bluetooth] Error 2
make[3]: *** Waiting for unfinished jobs....
make[2]: *** [scripts/Makefile.build:549: net] Error 2
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [/github/workspace/src/src/Makefile:2187: .] Error 2
make: *** [Makefile:248: __sub-make] Error 2
##############################
Test: TestRunner_l2cap-tester - FAIL
Desc: Run l2cap-tester with test-runner
Output:

No kernel image found
##############################
Test: TestRunner_iso-tester - FAIL
Desc: Run iso-tester with test-runner
Output:

No kernel image found
##############################
Test: TestRunner_bnep-tester - FAIL
Desc: Run bnep-tester with test-runner
Output:

No kernel image found
##############################
Test: TestRunner_mgmt-tester - FAIL
Desc: Run mgmt-tester with test-runner
Output:

No kernel image found
##############################
Test: TestRunner_rfcomm-tester - FAIL
Desc: Run rfcomm-tester with test-runner
Output:

No kernel image found
##############################
Test: TestRunner_sco-tester - FAIL
Desc: Run sco-tester with test-runner
Output:

No kernel image found
##############################
Test: TestRunner_ioctl-tester - FAIL
Desc: Run ioctl-tester with test-runner
Output:

No kernel image found
##############################
Test: TestRunner_mesh-tester - FAIL
Desc: Run mesh-tester with test-runner
Output:

No kernel image found
##############################
Test: TestRunner_smp-tester - FAIL
Desc: Run smp-tester with test-runner
Output:

No kernel image found
##############################
Test: TestRunner_userchan-tester - FAIL
Desc: Run userchan-tester with test-runner
Output:

No kernel image found
##############################
Test: TestRunner_6lowpan-tester - FAIL
Desc: Run 6lowpan-tester with test-runner
Output:

No kernel image found
##############################
Test: IncrementalBuild - FAIL
Desc: Incremental build with the patches in the series
Output:

net/bluetooth/hci_codec.c: In function ‘hci_read_supported_codecs’:
net/bluetooth/hci_codec.c:151:2: error: aggregate value used where an integer was expected
  151 |  if (skb->len < flex_array_size(std_codecs, codec, std_codecs->num)
      |  ^~
In file included from ./include/linux/bits.h:32,
                 from ./include/linux/ratelimit_types.h:5,
                 from ./include/linux/printk.h:9,
                 from ./include/asm-generic/bug.h:31,
                 from ./arch/x86/include/asm/bug.h:195,
                 from ./include/linux/ktime.h:24,
                 from ./include/linux/poll.h:7,
                 from ./include/net/bluetooth/bluetooth.h:26,
                 from net/bluetooth/hci_codec.c:5:
./include/linux/overflow.h:420:11: error: invalid operands to binary * (have ‘struct hci_std_codecs_hdr’ and ‘long unsigned int’)
  420 |   (count) * sizeof(*(p)->member) + __must_be_array((p)->member), \
      |   ~~~~~~~ ^
net/bluetooth/hci_codec.c:151:17: note: in expansion of macro ‘flex_array_size’
  151 |  if (skb->len < flex_array_size(std_codecs, codec, std_codecs->num)
      |                 ^~~~~~~~~~~~~~~
net/bluetooth/hci_codec.c:151:62: error: incompatible type for argument 1 of ‘size_mul’
  151 |  if (skb->len < flex_array_size(std_codecs, codec, std_codecs->num)
      |                                                    ~~~~~~~~~~^~~~~
      |                                                              |
      |                                                              struct hci_std_codecs_hdr
./include/linux/overflow.h:421:12: note: in definition of macro ‘flex_array_size’
  421 |   size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member)))
      |            ^~~~~
./include/linux/overflow.h:330:60: note: expected ‘size_t’ {aka ‘long unsigned int’} but argument is of type ‘struct hci_std_codecs_hdr’
  330 | static __always_inline size_t __must_check size_mul(size_t factor1, size_t factor2)
      |                                                     ~~~~~~~^~~~~~~
net/bluetooth/hci_codec.c:157:16: error: invalid operands to binary < (have ‘int’ and ‘struct hci_std_codecs_hdr’)
  157 |  for (i = 0; i < std_codecs->num; i++) {
      |                ^ ~~~~~~~~~~~~~~~
      |                            |
      |                            struct hci_std_codecs_hdr
net/bluetooth/hci_codec.c:164:2: error: aggregate value used where an integer was expected
  164 |  skb_pull(skb, flex_array_size(std_codecs, codec, std_codecs->num)
      |  ^~~~~~~~
In file included from ./include/linux/bits.h:32,
                 from ./include/linux/ratelimit_types.h:5,
                 from ./include/linux/printk.h:9,
                 from ./include/asm-generic/bug.h:31,
                 from ./arch/x86/include/asm/bug.h:195,
                 from ./include/linux/ktime.h:24,
                 from ./include/linux/poll.h:7,
                 from ./include/net/bluetooth/bluetooth.h:26,
                 from net/bluetooth/hci_codec.c:5:
./include/linux/overflow.h:420:11: error: invalid operands to binary * (have ‘struct hci_std_codecs_hdr’ and ‘long unsigned int’)
  420 |   (count) * sizeof(*(p)->member) + __must_be_array((p)->member), \
      |   ~~~~~~~ ^
net/bluetooth/hci_codec.c:164:16: note: in expansion of macro ‘flex_array_size’
  164 |  skb_pull(skb, flex_array_size(std_codecs, codec, std_codecs->num)
      |                ^~~~~~~~~~~~~~~
net/bluetooth/hci_codec.c:164:61: error: incompatible type for argument 1 of ‘size_mul’
  164 |  skb_pull(skb, flex_array_size(std_codecs, codec, std_codecs->num)
      |                                                   ~~~~~~~~~~^~~~~
      |                                                             |
      |                                                             struct hci_std_codecs_hdr
./include/linux/overflow.h:421:12: note: in definition of macro ‘flex_array_size’
  421 |   size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member)))
      |            ^~~~~
./include/linux/overflow.h:330:60: note: expected ‘size_t’ {aka ‘long unsigned int’} but argument is of type ‘struct hci_std_codecs_hdr’
  330 | static __always_inline size_t __must_check size_mul(size_t factor1, size_t factor2)
      |                                                     ~~~~~~~^~~~~~~
net/bluetooth/hci_codec.c: In function ‘hci_read_supported_codecs_v2’:
net/bluetooth/hci_codec.c:220:2: error: aggregate value used where an integer was expected
  220 |  if (skb->len < flex_array_size(std_codecs, codec, std_codecs->num)
      |  ^~
In file included from ./include/linux/bits.h:32,
                 from ./include/linux/ratelimit_types.h:5,
                 from ./include/linux/printk.h:9,
                 from ./include/asm-generic/bug.h:31,
                 from ./arch/x86/include/asm/bug.h:195,
                 from ./include/linux/ktime.h:24,
                 from ./include/linux/poll.h:7,
                 from ./include/net/bluetooth/bluetooth.h:26,
                 from net/bluetooth/hci_codec.c:5:
./include/linux/overflow.h:420:11: error: invalid operands to binary * (have ‘struct hci_std_codecs_v2_hdr’ and ‘long unsigned int’)
  420 |   (count) * sizeof(*(p)->member) + __must_be_array((p)->member), \
      |   ~~~~~~~ ^
net/bluetooth/hci_codec.c:220:17: note: in expansion of macro ‘flex_array_size’
  220 |  if (skb->len < flex_array_size(std_codecs, codec, std_codecs->num)
      |                 ^~~~~~~~~~~~~~~
net/bluetooth/hci_codec.c:220:62: error: incompatible type for argument 1 of ‘size_mul’
  220 |  if (skb->len < flex_array_size(std_codecs, codec, std_codecs->num)
      |                                                    ~~~~~~~~~~^~~~~
      |                                                              |
      |                                                              struct hci_std_codecs_v2_hdr
./include/linux/overflow.h:421:12: note: in definition of macro ‘flex_array_size’
  421 |   size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member)))
      |            ^~~~~
./include/linux/overflow.h:330:60: note: expected ‘size_t’ {aka ‘long unsigned int’} but argument is of type ‘struct hci_std_codecs_v2_hdr’
  330 | static __always_inline size_t __must_check size_mul(size_t factor1, size_t factor2)
      |                                                     ~~~~~~~^~~~~~~
net/bluetooth/hci_codec.c:226:16: error: invalid operands to binary < (have ‘int’ and ‘struct hci_std_codecs_v2_hdr’)
  226 |  for (i = 0; i < std_codecs->num; i++) {
      |                ^ ~~~~~~~~~~~~~~~
      |                            |
      |                            struct hci_std_codecs_v2_hdr
net/bluetooth/hci_codec.c:232:2: error: aggregate value used where an integer was expected
  232 |  skb_pull(skb, flex_array_size(std_codecs, codec, std_codecs->num)
      |  ^~~~~~~~
In file included from ./include/linux/bits.h:32,
                 from ./include/linux/ratelimit_types.h:5,
                 from ./include/linux/printk.h:9,
                 from ./include/asm-generic/bug.h:31,
                 from ./arch/x86/include/asm/bug.h:195,
                 from ./include/linux/ktime.h:24,
                 from ./include/linux/poll.h:7,
                 from ./include/net/bluetooth/bluetooth.h:26,
                 from net/bluetooth/hci_codec.c:5:
./include/linux/overflow.h:420:11: error: invalid operands to binary * (have ‘struct hci_std_codecs_v2_hdr’ and ‘long unsigned int’)
  420 |   (count) * sizeof(*(p)->member) + __must_be_array((p)->member), \
      |   ~~~~~~~ ^
net/bluetooth/hci_codec.c:232:16: note: in expansion of macro ‘flex_array_size’
  232 |  skb_pull(skb, flex_array_size(std_codecs, codec, std_codecs->num)
      |                ^~~~~~~~~~~~~~~
net/bluetooth/hci_codec.c:232:61: error: incompatible type for argument 1 of ‘size_mul’
  232 |  skb_pull(skb, flex_array_size(std_codecs, codec, std_codecs->num)
      |                                                   ~~~~~~~~~~^~~~~
      |                                                             |
      |                                                             struct hci_std_codecs_v2_hdr
./include/linux/overflow.h:421:12: note: in definition of macro ‘flex_array_size’
  421 |   size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member)))
      |            ^~~~~
./include/linux/overflow.h:330:60: note: expected ‘size_t’ {aka ‘long unsigned int’} but argument is of type ‘struct hci_std_codecs_v2_hdr’
  330 | static __always_inline size_t __must_check size_mul(size_t factor1, size_t factor2)
      |                                                     ~~~~~~~^~~~~~~
make[4]: *** [scripts/Makefile.build:289: net/bluetooth/hci_codec.o] Error 1
make[4]: *** Waiting for unfinished jobs....
make[3]: *** [scripts/Makefile.build:549: net/bluetooth] Error 2
make[2]: *** [scripts/Makefile.build:549: net] Error 2
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [/github/workspace/src/src/Makefile:2187: .] Error 2
make: *** [Makefile:248: __sub-make] Error 2
Bluetooth: hci-core: fix "declaration does not declare anything" error

net/bluetooth/hci_codec.c: In function ‘hci_read_supported_codecs’:
net/bluetooth/hci_codec.c:151:2: error: aggregate value used where an integer was expected
  151 |  if (skb->len < flex_array_size(std_codecs, codec, std_codecs->num)
      |  ^~
In file included from ./include/linux/bits.h:32,
                 from ./include/linux/ratelimit_types.h:5,
                 from ./include/linux/printk.h:9,
                 from ./include/asm-generic/bug.h:31,
                 from ./arch/x86/include/asm/bug.h:195,
                 from ./include/linux/ktime.h:24,
                 from ./include/linux/poll.h:7,
                 from ./include/net/bluetooth/bluetooth.h:26,
                 from net/bluetooth/hci_codec.c:5:
./include/linux/overflow.h:420:11: error: invalid operands to binary * (have ‘struct hci_std_codecs_hdr’ and ‘long unsigned int’)
  420 |   (count) * sizeof(*(p)->member) + __must_be_array((p)->member), \
      |   ~~~~~~~ ^
net/bluetooth/hci_codec.c:151:17: note: in expansion of macro ‘flex_array_size’
  151 |  if (skb->len < flex_array_size(std_codecs, codec, std_codecs->num)
      |                 ^~~~~~~~~~~~~~~
net/bluetooth/hci_codec.c:151:62: error: incompatible type for argument 1 of ‘size_mul’
  151 |  if (skb->len < flex_array_size(std_codecs, codec, std_codecs->num)
      |                                                    ~~~~~~~~~~^~~~~
      |                                                              |
      |                                                              struct hci_std_codecs_hdr
./include/linux/overflow.h:421:12: note: in definition of macro ‘flex_array_size’
  421 |   size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member)))
      |            ^~~~~
./include/linux/overflow.h:330:60: note: expected ‘size_t’ {aka ‘long unsigned int’} but argument is of type ‘struct hci_std_codecs_hdr’
  330 | static __always_inline size_t __must_check size_mul(size_t factor1, size_t factor2)
      |                                                     ~~~~~~~^~~~~~~
net/bluetooth/hci_codec.c:157:16: error: invalid operands to binary < (have ‘int’ and ‘struct hci_std_codecs_hdr’)
  157 |  for (i = 0; i < std_codecs->num; i++) {
      |                ^ ~~~~~~~~~~~~~~~
      |                            |
      |                            struct hci_std_codecs_hdr
net/bluetooth/hci_codec.c:164:2: error: aggregate value used where an integer was expected
  164 |  skb_pull(skb, flex_array_size(std_codecs, codec, std_codecs->num)
      |  ^~~~~~~~
In file included from ./include/linux/bits.h:32,
                 from ./include/linux/ratelimit_types.h:5,
                 from ./include/linux/printk.h:9,
                 from ./include/asm-generic/bug.h:31,
                 from ./arch/x86/include/asm/bug.h:195,
                 from ./include/linux/ktime.h:24,
                 from ./include/linux/poll.h:7,
                 from ./include/net/bluetooth/bluetooth.h:26,
                 from net/bluetooth/hci_codec.c:5:
./include/linux/overflow.h:420:11: error: invalid operands to binary * (have ‘struct hci_std_codecs_hdr’ and ‘long unsigned int’)
  420 |   (count) * sizeof(*(p)->member) + __must_be_array((p)->member), \
      |   ~~~~~~~ ^
net/bluetooth/hci_codec.c:164:16: note: in expansion of macro ‘flex_array_size’
  164 |  skb_pull(skb, flex_array_size(std_codecs, codec, std_codecs->num)
      |                ^~~~~~~~~~~~~~~
net/bluetooth/hci_codec.c:164:61: error: incompatible type for argument 1 of ‘size_mul’
  164 |  skb_pull(skb, flex_array_size(std_codecs, codec, std_codecs->num)
      |                                                   ~~~~~~~~~~^~~~~
      |                                                             |
      |                                                             struct hci_std_codecs_hdr
./include/linux/overflow.h:421:12: note: in definition of macro ‘flex_array_size’
  421 |   size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member)))
      |            ^~~~~
./include/linux/overflow.h:330:60: note: expected ‘size_t’ {aka ‘long unsigned int’} but argument is of type ‘struct hci_std_codecs_hdr’
  330 | static __always_inline size_t __must_check size_mul(size_t factor1, size_t factor2)
      |                                                     ~~~~~~~^~~~~~~
net/bluetooth/hci_codec.c: In function ‘hci_read_supported_codecs_v2’:
net/bluetooth/hci_codec.c:220:2: error: aggregate value used where an integer was expected
  220 |  if (skb->len < flex_array_size(std_codecs, codec, std_codecs->num)
      |  ^~
In file included from ./include/linux/bits.h:32,
                 from ./include/linux/ratelimit_types.h:5,
                 from ./include/linux/printk.h:9,
                 from ./include/asm-generic/bug.h:31,
                 from ./arch/x86/include/asm/bug.h:195,
                 from ./include/linux/ktime.h:24,
                 from ./include/linux/poll.h:7,
                 from ./include/net/bluetooth/bluetooth.h:26,
                 from net/bluetooth/hci_codec.c:5:
./include/linux/overflow.h:420:11: error: invalid operands to binary * (have ‘struct hci_std_codecs_v2_hdr’ and ‘long unsigned int’)
  420 |   (count) * sizeof(*(p)->member) + __must_be_array((p)->member), \
      |   ~~~~~~~ ^
net/bluetooth/hci_codec.c:220:17: note: in expansion of macro ‘flex_array_size’
  220 |  if (skb->len < flex_array_size(std_codecs, codec, std_codecs->num)
      |                 ^~~~~~~~~~~~~~~
net/bluetooth/hci_codec.c:220:62: error: incompatible type for argument 1 of ‘size_mul’
  220 |  if (skb->len < flex_array_size(std_codecs, codec, std_codecs->num)
      |                                                    ~~~~~~~~~~^~~~~
      |                                                              |
      |                                                              struct hci_std_codecs_v2_hdr
./include/linux/overflow.h:421:12: note: in definition of macro ‘flex_array_size’
  421 |   size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member)))
      |            ^~~~~
./include/linux/overflow.h:330:60: note: expected ‘size_t’ {aka ‘long unsigned int’} but argument is of type ‘struct hci_std_codecs_v2_hdr’
  330 | static __always_inline size_t __must_check size_mul(size_t factor1, size_t factor2)
      |                                                     ~~~~~~~^~~~~~~
net/bluetooth/hci_codec.c:226:16: error: invalid operands to binary < (have ‘int’ and ‘struct hci_std_codecs_v2_hdr’)
  226 |  for (i = 0; i < std_codecs->num; i++) {
      |                ^ ~~~~~~~~~~~~~~~
      |                            |
      |                            struct hci_std_codecs_v2_hdr
net/bluetooth/hci_codec.c:232:2: error: aggregate value used where an integer was expected
  232 |  skb_pull(skb, flex_array_size(std_codecs, codec, std_codecs->num)
      |  ^~~~~~~~
In file included from ./include/linux/bits.h:32,
                 from ./include/linux/ratelimit_types.h:5,
                 from ./include/linux/printk.h:9,
                 from ./include/asm-generic/bug.h:31,
                 from ./arch/x86/include/asm/bug.h:195,
                 from ./include/linux/ktime.h:24,
                 from ./include/linux/poll.h:7,
                 from ./include/net/bluetooth/bluetooth.h:26,
                 from net/bluetooth/hci_codec.c:5:
./include/linux/overflow.h:420:11: error: invalid operands to binary * (have ‘struct hci_std_codecs_v2_hdr’ and ‘long unsigned int’)
  420 |   (count) * sizeof(*(p)->member) + __must_be_array((p)->member), \
      |   ~~~~~~~ ^
net/bluetooth/hci_codec.c:232:16: note: in expansion of macro ‘flex_array_size’
  232 |  skb_pull(skb, flex_array_size(std_codecs, codec, std_codecs->num)
      |                ^~~~~~~~~~~~~~~
net/bluetooth/hci_codec.c:232:61: error: incompatible type for argument 1 of ‘size_mul’
  232 |  skb_pull(skb, flex_array_size(std_codecs, codec, std_codecs->num)
      |                                                   ~~~~~~~~~~^~~~~
      |                                                             |
      |                                                             struct hci_std_codecs_v2_hdr
./include/linux/overflow.h:421:12: note: in definition of macro ‘flex_array_size’
  421 |   size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member)))
      |            ^~~~~
./include/linux/overflow.h:330:60: note: expected ‘size_t’ {aka ‘long unsigned int’} but argument is of type ‘struct hci_std_codecs_v2_hdr’
  330 | static __always_inline size_t __must_check size_mul(size_t factor1, size_t factor2)
      |                                                     ~~~~~~~^~~~~~~
make[4]: *** [scripts/Makefile.build:289: net/bluetooth/hci_codec.o] Error 1
make[4]: *** Waiting for unfinished jobs....
make[3]: *** [scripts/Makefile.build:549: net/bluetooth] Error 2
make[2]: *** [scripts/Makefile.build:549: net] Error 2
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [/github/workspace/src/src/Makefile:2187: .] Error 2
make: *** [Makefile:248: __sub-make] Error 2


https://github.com/bluez/bluetooth-next/pull/578

---
Regards,
Linux Bluetooth


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

* Re: [PATCH] Bluetooth: hci-core: fix "declaration does not declare anything" error
  2026-08-14  5:10 [PATCH] Bluetooth: hci-core: fix "declaration does not declare anything" error David Marlin
  2026-08-14  5:46 ` bluez.test.bot
@ 2026-08-21  2:08 ` kernel test robot
  1 sibling, 0 replies; 3+ messages in thread
From: kernel test robot @ 2026-08-21  2:08 UTC (permalink / raw)
  To: David Marlin, linux-bluetooth, Luiz Augusto von Dentz
  Cc: llvm, oe-kbuild-all, Gustavo A . R . Silva, David Marlin,
	Bastien Nocera

Hi David,

kernel test robot noticed the following build errors:

[auto build test ERROR on bluetooth-next/master]
[also build test ERROR on bluetooth/master linus/master v7.2 next-20260819]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/David-Marlin/Bluetooth-hci-core-fix-declaration-does-not-declare-anything-error/20260814-001012
base:   https://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git master
patch link:    https://lore.kernel.org/r/20260814051032.261320-1-dmarlin%40redhat.com
patch subject: [PATCH] Bluetooth: hci-core: fix "declaration does not declare anything" error
config: loongarch-defconfig (https://download.01.org/0day-ci/archive/20260821/202608211016.aKSwZC8Y-lkp@intel.com/config)
compiler: clang version 24.0.0git (https://github.com/llvm/llvm-project 935bfc708590c60147a79c7df145bb6e68b1d388)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260821/202608211016.aKSwZC8Y-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/202608211016.aKSwZC8Y-lkp@intel.com/

All errors (new ones prefixed by >>):

>> net/bluetooth/hci_codec.c:151:17: error: operand of type 'struct hci_std_codecs_hdr' where arithmetic or pointer type is required
     151 |         if (skb->len < flex_array_size(std_codecs, codec, std_codecs->num)
         |                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/overflow.h:419:24: note: expanded from macro 'flex_array_size'
     419 |         __builtin_choose_expr(__is_constexpr(count),                    \
         |                               ^~~~~~~~~~~~~~~~~~~~~
   include/linux/compiler.h:323:47: note: expanded from macro '__is_constexpr'
     323 |         (sizeof(int) == sizeof(*(8 ? ((void *)((long)(x) * 0l)) : (int *)8)))
         |                                                      ^~~
>> net/bluetooth/hci_codec.c:157:16: error: invalid operands to binary expression ('__u8' (aka 'unsigned char') and 'struct hci_std_codecs_hdr')
     157 |         for (i = 0; i < std_codecs->num; i++) {
         |                     ~ ^ ~~~~~~~~~~~~~~~
   net/bluetooth/hci_codec.c:164:16: error: operand of type 'struct hci_std_codecs_hdr' where arithmetic or pointer type is required
     164 |         skb_pull(skb, flex_array_size(std_codecs, codec, std_codecs->num)
         |                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/overflow.h:419:24: note: expanded from macro 'flex_array_size'
     419 |         __builtin_choose_expr(__is_constexpr(count),                    \
         |                               ^~~~~~~~~~~~~~~~~~~~~
   include/linux/compiler.h:323:47: note: expanded from macro '__is_constexpr'
     323 |         (sizeof(int) == sizeof(*(8 ? ((void *)((long)(x) * 0l)) : (int *)8)))
         |                                                      ^~~
>> net/bluetooth/hci_codec.c:220:17: error: operand of type 'struct hci_std_codecs_v2_hdr' where arithmetic or pointer type is required
     220 |         if (skb->len < flex_array_size(std_codecs, codec, std_codecs->num)
         |                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/overflow.h:419:24: note: expanded from macro 'flex_array_size'
     419 |         __builtin_choose_expr(__is_constexpr(count),                    \
         |                               ^~~~~~~~~~~~~~~~~~~~~
   include/linux/compiler.h:323:47: note: expanded from macro '__is_constexpr'
     323 |         (sizeof(int) == sizeof(*(8 ? ((void *)((long)(x) * 0l)) : (int *)8)))
         |                                                      ^~~
>> net/bluetooth/hci_codec.c:226:16: error: invalid operands to binary expression ('__u8' (aka 'unsigned char') and 'struct hci_std_codecs_v2_hdr')
     226 |         for (i = 0; i < std_codecs->num; i++) {
         |                     ~ ^ ~~~~~~~~~~~~~~~
   net/bluetooth/hci_codec.c:232:16: error: operand of type 'struct hci_std_codecs_v2_hdr' where arithmetic or pointer type is required
     232 |         skb_pull(skb, flex_array_size(std_codecs, codec, std_codecs->num)
         |                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/overflow.h:419:24: note: expanded from macro 'flex_array_size'
     419 |         __builtin_choose_expr(__is_constexpr(count),                    \
         |                               ^~~~~~~~~~~~~~~~~~~~~
   include/linux/compiler.h:323:47: note: expanded from macro '__is_constexpr'
     323 |         (sizeof(int) == sizeof(*(8 ? ((void *)((long)(x) * 0l)) : (int *)8)))
         |                                                      ^~~
   6 errors generated.


vim +151 net/bluetooth/hci_codec.c

8961987f3f5fa2f Kiran K     2021-09-07  119  
8961987f3f5fa2f Kiran K     2021-09-07  120  void hci_read_supported_codecs(struct hci_dev *hdev)
8961987f3f5fa2f Kiran K     2021-09-07  121  {
8961987f3f5fa2f Kiran K     2021-09-07  122  	struct sk_buff *skb;
8961987f3f5fa2f Kiran K     2021-09-07  123  	struct hci_rp_read_local_supported_codecs *rp;
8961987f3f5fa2f Kiran K     2021-09-07  124  	struct hci_std_codecs *std_codecs;
8961987f3f5fa2f Kiran K     2021-09-07  125  	struct hci_vnd_codecs *vnd_codecs;
8961987f3f5fa2f Kiran K     2021-09-07  126  	struct hci_op_read_local_codec_caps caps;
8961987f3f5fa2f Kiran K     2021-09-07  127  	__u8 i;
8961987f3f5fa2f Kiran K     2021-09-07  128  
828cea2b71de501 Chethan T N 2022-11-22  129  	skb = __hci_cmd_sync_sk(hdev, HCI_OP_READ_LOCAL_CODECS, 0, NULL,
828cea2b71de501 Chethan T N 2022-11-22  130  				0, HCI_CMD_TIMEOUT, NULL);
8961987f3f5fa2f Kiran K     2021-09-07  131  
8961987f3f5fa2f Kiran K     2021-09-07  132  	if (IS_ERR(skb)) {
8961987f3f5fa2f Kiran K     2021-09-07  133  		bt_dev_err(hdev, "Failed to read local supported codecs (%ld)",
8961987f3f5fa2f Kiran K     2021-09-07  134  			   PTR_ERR(skb));
8961987f3f5fa2f Kiran K     2021-09-07  135  		return;
8961987f3f5fa2f Kiran K     2021-09-07  136  	}
8961987f3f5fa2f Kiran K     2021-09-07  137  
8961987f3f5fa2f Kiran K     2021-09-07  138  	if (skb->len < sizeof(*rp))
8961987f3f5fa2f Kiran K     2021-09-07  139  		goto error;
8961987f3f5fa2f Kiran K     2021-09-07  140  
8961987f3f5fa2f Kiran K     2021-09-07  141  	rp = (void *)skb->data;
8961987f3f5fa2f Kiran K     2021-09-07  142  
8961987f3f5fa2f Kiran K     2021-09-07  143  	if (rp->status)
8961987f3f5fa2f Kiran K     2021-09-07  144  		goto error;
8961987f3f5fa2f Kiran K     2021-09-07  145  
8961987f3f5fa2f Kiran K     2021-09-07  146  	skb_pull(skb, sizeof(rp->status));
8961987f3f5fa2f Kiran K     2021-09-07  147  
8961987f3f5fa2f Kiran K     2021-09-07  148  	std_codecs = (void *)skb->data;
8961987f3f5fa2f Kiran K     2021-09-07  149  
8961987f3f5fa2f Kiran K     2021-09-07  150  	/* validate codecs length before accessing */
8961987f3f5fa2f Kiran K     2021-09-07 @151  	if (skb->len < flex_array_size(std_codecs, codec, std_codecs->num)
8961987f3f5fa2f Kiran K     2021-09-07  152  	    + sizeof(std_codecs->num))
8961987f3f5fa2f Kiran K     2021-09-07  153  		goto error;
8961987f3f5fa2f Kiran K     2021-09-07  154  
8961987f3f5fa2f Kiran K     2021-09-07  155  	/* enumerate codec capabilities of standard codecs */
8961987f3f5fa2f Kiran K     2021-09-07  156  	memset(&caps, 0, sizeof(caps));
8961987f3f5fa2f Kiran K     2021-09-07 @157  	for (i = 0; i < std_codecs->num; i++) {
8961987f3f5fa2f Kiran K     2021-09-07  158  		caps.id = std_codecs->codec[i];
8961987f3f5fa2f Kiran K     2021-09-07  159  		caps.direction = 0x00;
828cea2b71de501 Chethan T N 2022-11-22  160  		hci_read_codec_capabilities(hdev,
828cea2b71de501 Chethan T N 2022-11-22  161  					    LOCAL_CODEC_ACL_MASK | LOCAL_CODEC_SCO_MASK, &caps);
8961987f3f5fa2f Kiran K     2021-09-07  162  	}
8961987f3f5fa2f Kiran K     2021-09-07  163  
8961987f3f5fa2f Kiran K     2021-09-07  164  	skb_pull(skb, flex_array_size(std_codecs, codec, std_codecs->num)
8961987f3f5fa2f Kiran K     2021-09-07  165  		 + sizeof(std_codecs->num));
8961987f3f5fa2f Kiran K     2021-09-07  166  
8961987f3f5fa2f Kiran K     2021-09-07  167  	vnd_codecs = (void *)skb->data;
8961987f3f5fa2f Kiran K     2021-09-07  168  
8961987f3f5fa2f Kiran K     2021-09-07  169  	/* validate vendor codecs length before accessing */
8961987f3f5fa2f Kiran K     2021-09-07  170  	if (skb->len <
8961987f3f5fa2f Kiran K     2021-09-07  171  	    flex_array_size(vnd_codecs, codec, vnd_codecs->num)
8961987f3f5fa2f Kiran K     2021-09-07  172  	    + sizeof(vnd_codecs->num))
8961987f3f5fa2f Kiran K     2021-09-07  173  		goto error;
8961987f3f5fa2f Kiran K     2021-09-07  174  
8961987f3f5fa2f Kiran K     2021-09-07  175  	/* enumerate vendor codec capabilities */
8961987f3f5fa2f Kiran K     2021-09-07  176  	for (i = 0; i < vnd_codecs->num; i++) {
8961987f3f5fa2f Kiran K     2021-09-07  177  		caps.id = 0xFF;
8961987f3f5fa2f Kiran K     2021-09-07  178  		caps.cid = vnd_codecs->codec[i].cid;
8961987f3f5fa2f Kiran K     2021-09-07  179  		caps.vid = vnd_codecs->codec[i].vid;
8961987f3f5fa2f Kiran K     2021-09-07  180  		caps.direction = 0x00;
828cea2b71de501 Chethan T N 2022-11-22  181  		hci_read_codec_capabilities(hdev,
828cea2b71de501 Chethan T N 2022-11-22  182  					    LOCAL_CODEC_ACL_MASK | LOCAL_CODEC_SCO_MASK, &caps);
8961987f3f5fa2f Kiran K     2021-09-07  183  	}
8961987f3f5fa2f Kiran K     2021-09-07  184  
8961987f3f5fa2f Kiran K     2021-09-07  185  error:
8961987f3f5fa2f Kiran K     2021-09-07  186  	kfree_skb(skb);
8961987f3f5fa2f Kiran K     2021-09-07  187  }
9ae664028a9ea83 Kiran K     2021-09-07  188  
9ae664028a9ea83 Kiran K     2021-09-07  189  void hci_read_supported_codecs_v2(struct hci_dev *hdev)
9ae664028a9ea83 Kiran K     2021-09-07  190  {
9ae664028a9ea83 Kiran K     2021-09-07  191  	struct sk_buff *skb;
9ae664028a9ea83 Kiran K     2021-09-07  192  	struct hci_rp_read_local_supported_codecs_v2 *rp;
9ae664028a9ea83 Kiran K     2021-09-07  193  	struct hci_std_codecs_v2 *std_codecs;
9ae664028a9ea83 Kiran K     2021-09-07  194  	struct hci_vnd_codecs_v2 *vnd_codecs;
9ae664028a9ea83 Kiran K     2021-09-07  195  	struct hci_op_read_local_codec_caps caps;
9ae664028a9ea83 Kiran K     2021-09-07  196  	__u8 i;
9ae664028a9ea83 Kiran K     2021-09-07  197  
828cea2b71de501 Chethan T N 2022-11-22  198  	skb = __hci_cmd_sync_sk(hdev, HCI_OP_READ_LOCAL_CODECS_V2, 0, NULL,
828cea2b71de501 Chethan T N 2022-11-22  199  				0, HCI_CMD_TIMEOUT, NULL);
9ae664028a9ea83 Kiran K     2021-09-07  200  
9ae664028a9ea83 Kiran K     2021-09-07  201  	if (IS_ERR(skb)) {
9ae664028a9ea83 Kiran K     2021-09-07  202  		bt_dev_err(hdev, "Failed to read local supported codecs (%ld)",
9ae664028a9ea83 Kiran K     2021-09-07  203  			   PTR_ERR(skb));
9ae664028a9ea83 Kiran K     2021-09-07  204  		return;
9ae664028a9ea83 Kiran K     2021-09-07  205  	}
9ae664028a9ea83 Kiran K     2021-09-07  206  
9ae664028a9ea83 Kiran K     2021-09-07  207  	if (skb->len < sizeof(*rp))
9ae664028a9ea83 Kiran K     2021-09-07  208  		goto error;
9ae664028a9ea83 Kiran K     2021-09-07  209  
9ae664028a9ea83 Kiran K     2021-09-07  210  	rp = (void *)skb->data;
9ae664028a9ea83 Kiran K     2021-09-07  211  
9ae664028a9ea83 Kiran K     2021-09-07  212  	if (rp->status)
9ae664028a9ea83 Kiran K     2021-09-07  213  		goto error;
9ae664028a9ea83 Kiran K     2021-09-07  214  
9ae664028a9ea83 Kiran K     2021-09-07  215  	skb_pull(skb, sizeof(rp->status));
9ae664028a9ea83 Kiran K     2021-09-07  216  
9ae664028a9ea83 Kiran K     2021-09-07  217  	std_codecs = (void *)skb->data;
9ae664028a9ea83 Kiran K     2021-09-07  218  
9ae664028a9ea83 Kiran K     2021-09-07  219  	/* check for payload data length before accessing */
9ae664028a9ea83 Kiran K     2021-09-07 @220  	if (skb->len < flex_array_size(std_codecs, codec, std_codecs->num)
9ae664028a9ea83 Kiran K     2021-09-07  221  	    + sizeof(std_codecs->num))
9ae664028a9ea83 Kiran K     2021-09-07  222  		goto error;
9ae664028a9ea83 Kiran K     2021-09-07  223  
9ae664028a9ea83 Kiran K     2021-09-07  224  	memset(&caps, 0, sizeof(caps));
9ae664028a9ea83 Kiran K     2021-09-07  225  
9ae664028a9ea83 Kiran K     2021-09-07 @226  	for (i = 0; i < std_codecs->num; i++) {

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

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

end of thread, other threads:[~2026-08-21  2:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-14  5:10 [PATCH] Bluetooth: hci-core: fix "declaration does not declare anything" error David Marlin
2026-08-14  5:46 ` bluez.test.bot
2026-08-21  2:08 ` [PATCH] " kernel test robot

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.