diff mbox series

[BlueZ,1/2] l2test: Enable hex input for PSM

Message ID 20230323102732.566440-2-simon.mikuda@streamunlimited.com (mailing list archive)
State New, archived
Headers show
Series l2test fix+feature | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
tedd_an/CheckPatch success CheckPatch PASS
tedd_an/GitLint success Gitlint PASS
tedd_an/BuildEll success Build ELL PASS
tedd_an/BluezMake success Bluez Make PASS
tedd_an/MakeCheck success Bluez Make Check PASS
tedd_an/MakeDistcheck success Make Distcheck PASS
tedd_an/CheckValgrind success Check Valgrind PASS
tedd_an/CheckSmatch success CheckSparse PASS
tedd_an/bluezmakeextell success Make External ELL PASS
tedd_an/IncrementalBuild success Incremental Build PASS
tedd_an/ScanBuild success Scan Build PASS

Commit Message

Simon Mikuda March 23, 2023, 10:27 a.m. UTC
---
 tools/l2test.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

bluez.test.bot@gmail.com March 23, 2023, 11:42 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=733107

---Test result---

Test Summary:
CheckPatch                    FAIL      1.31 seconds
GitLint                       PASS      0.68 seconds
BuildEll                      PASS      26.34 seconds
BluezMake                     PASS      752.58 seconds
MakeCheck                     PASS      11.03 seconds
MakeDistcheck                 PASS      147.91 seconds
CheckValgrind                 PASS      240.89 seconds
CheckSmatch                   PASS      320.56 seconds
bluezmakeextell               PASS      97.38 seconds
IncrementalBuild              PASS      1229.04 seconds
ScanBuild                     PASS      972.80 seconds

Details
##############################
Test: CheckPatch - FAIL
Desc: Run checkpatch.pl script
Output:
[BlueZ,2/2] l2test: Fix setting mode for BR/EDR l2cap socket
ERROR:SWITCH_CASE_INDENT_LEVEL: switch and case should be at the same indent
#108: FILE: tools/l2test.c:160:
+	switch (mode) {
+		case BT_MODE_BASIC:
[...]
+		case BT_MODE_ERTM:
[...]
+		case BT_MODE_STREAMING:
[...]
+		case BT_MODE_LE_FLOWCTL:
[...]
+		case BT_MODE_EXT_FLOWCTL:
[...]
+		default:

/github/workspace/src/src/13185459.patch total: 1 errors, 0 warnings, 44 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/src/13185459.patch has style problems, please review.

NOTE: Ignored message types: COMMIT_MESSAGE COMPLEX_MACRO CONST_STRUCT FILE_PATH_CHANGES MISSING_SIGN_OFF PREFER_PACKED SPDX_LICENSE_TAG SPLIT_STRING SSCANF_TO_KSTRTO

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.




---
Regards,
Linux Bluetooth
Luiz Augusto von Dentz March 23, 2023, 5:20 p.m. UTC | #2
Hi Simon,

On Thu, Mar 23, 2023 at 3:39 AM Simon Mikuda
<simon.mikuda@streamunlimited.com> wrote:
>
> ---
>  tools/l2test.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/tools/l2test.c b/tools/l2test.c
> index 5aae4b687..595f1dab2 100644
> --- a/tools/l2test.c
> +++ b/tools/l2test.c
> @@ -1416,7 +1416,10 @@ int main(int argc, char *argv[])
>                         break;
>
>                 case 'P':
> -                       psm = atoi(optarg);
> +                       if (!strncasecmp(optarg, "0x", 2))
> +                               psm = strtoul(&optarg[2], NULL, 16);

strtoul should be able to autodetect the base and parse 0x if you give
0 as base:

https://linux.die.net/man/3/strtoul

> +                       else
> +                               psm = atoi(optarg);
>                         break;
>
>                 case 'I':
> --
> 2.34.1
>
diff mbox series

Patch

diff --git a/tools/l2test.c b/tools/l2test.c
index 5aae4b687..595f1dab2 100644
--- a/tools/l2test.c
+++ b/tools/l2test.c
@@ -1416,7 +1416,10 @@  int main(int argc, char *argv[])
 			break;
 
 		case 'P':
-			psm = atoi(optarg);
+			if (!strncasecmp(optarg, "0x", 2))
+				psm = strtoul(&optarg[2], NULL, 16);
+			else
+				psm = atoi(optarg);
 			break;
 
 		case 'I':