diff mbox series

bluetooth: mgmt: Replace zero-length array with flexible-array member

Message ID 20220121013508.950175-1-deng.changcheng@zte.com.cn
State New
Headers show
Series bluetooth: mgmt: Replace zero-length array with flexible-array member | expand

Commit Message

Lv Ruyi Jan. 21, 2022, 1:35 a.m. UTC
From: Changcheng Deng <deng.changcheng@zte.com.cn>

There is a regular need in the kernel to provide a way to declare having
a dynamically sized set of trailing elements in a structure. Kernel code
should always use "flexible array members" for these cases. The older
style of one-element or zero-length arrays should no longer be used.
Reference:
https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Changcheng Deng <deng.changcheng@zte.com.cn>
---
 include/net/bluetooth/mgmt.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Luiz Augusto von Dentz Feb. 1, 2022, 8:25 p.m. UTC | #1
Hi,

On Fri, Jan 21, 2022 at 4:29 PM <bluez.test.bot@gmail.com> wrote:
>
> 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=607119
>
> ---Test result---
>
> Test Summary:
> CheckPatch                    FAIL      1.61 seconds
> GitLint                       FAIL      0.96 seconds
> SubjectPrefix                 FAIL      0.87 seconds
> BuildKernel                   PASS      30.32 seconds
> BuildKernel32                 PASS      26.97 seconds
> Incremental Build with patchesPASS      36.33 seconds
> TestRunner: Setup             PASS      472.13 seconds
> TestRunner: l2cap-tester      PASS      13.23 seconds
> TestRunner: bnep-tester       PASS      6.01 seconds
> TestRunner: mgmt-tester       PASS      103.93 seconds
> TestRunner: rfcomm-tester     PASS      7.33 seconds
> TestRunner: sco-tester        PASS      7.60 seconds
> TestRunner: smp-tester        PASS      7.47 seconds
> TestRunner: userchan-tester   PASS      6.25 seconds
>
> Details
> ##############################
> Test: CheckPatch - FAIL - 1.61 seconds
> Run checkpatch.pl script with rule in .checkpatch.conf
> bluetooth: mgmt: Replace zero-length array with flexible-array member\WARNING:COMMIT_LOG_LONG_LINE: Possible unwrapped commit description (prefer a maximum 75 chars per line)
> #88:
> https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays
>
> total: 0 errors, 1 warnings, 8 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/12719219.patch has style problems, please review.
>
> NOTE: Ignored message types: UNKNOWN_COMMIT_ID
>
> NOTE: If any of the errors are false positives, please report
>       them to the maintainer, see CHECKPATCH in MAINTAINERS.
>
>
> ##############################
> Test: GitLint - FAIL - 0.96 seconds
> Run gitlint with rule in .gitlint
> bluetooth: mgmt: Replace zero-length array with flexible-array member
> 10: B1 Line exceeds max length (97>80): "https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays"
>
>
> ##############################
> Test: SubjectPrefix - FAIL - 0.87 seconds
> Check subject contains "Bluetooth" prefix
> "Bluetooth: " is not specified in the subject
>
>
>
> ---
> Regards,
> Linux Bluetooth

Applied, thanks.
diff mbox series

Patch

diff --git a/include/net/bluetooth/mgmt.h b/include/net/bluetooth/mgmt.h
index 99266f7aebdc..3d26e6a3478b 100644
--- a/include/net/bluetooth/mgmt.h
+++ b/include/net/bluetooth/mgmt.h
@@ -1112,7 +1112,7 @@  struct mgmt_ev_adv_monitor_device_found {
 	__s8   rssi;
 	__le32 flags;
 	__le16 eir_len;
-	__u8   eir[0];
+	__u8   eir[];
 } __packed;
 
 #define MGMT_EV_ADV_MONITOR_DEVICE_LOST		0x0030