diff mbox series

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

Message ID 20220121013508.950175-1-deng.changcheng@zte.com.cn (mailing list archive)
State Accepted
Delegated to: Luiz Von Dentz
Headers show
Series bluetooth: mgmt: Replace zero-length array with flexible-array member | expand

Checks

Context Check Description
tedd_an/checkpatch fail 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.
tedd_an/gitlint fail 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"
tedd_an/subjectprefix fail "Bluetooth: " is not specified in the subject
tedd_an/buildkernel success Build Kernel PASS
tedd_an/buildkernel32 success Build Kernel32 PASS
tedd_an/incremental_build success Pass
tedd_an/testrunnersetup success Test Runner Setup PASS
tedd_an/testrunnerl2cap-tester success Total: 40, Passed: 40 (100.0%), Failed: 0, Not Run: 0
tedd_an/testrunnerbnep-tester success Total: 1, Passed: 1 (100.0%), Failed: 0, Not Run: 0
tedd_an/testrunnermgmt-tester success Total: 493, Passed: 493 (100.0%), Failed: 0, Not Run: 0
tedd_an/testrunnerrfcomm-tester success Total: 9, Passed: 9 (100.0%), Failed: 0, Not Run: 0
tedd_an/testrunnersco-tester success Total: 12, Passed: 12 (100.0%), Failed: 0, Not Run: 0
tedd_an/testrunnersmp-tester success Total: 8, Passed: 8 (100.0%), Failed: 0, Not Run: 0
tedd_an/testrunneruserchan-tester success Total: 4, Passed: 4 (100.0%), Failed: 0, Not Run: 0

Commit Message

CGEL 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

bluez.test.bot@gmail.com Jan. 21, 2022, 1:56 a.m. UTC | #1
This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=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
Luiz Augusto von Dentz Feb. 1, 2022, 8:25 p.m. UTC | #2
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