2020-10-06 14:35:42

by Henrik Grimler

[permalink] [raw]
Subject: [PATCH BlueZ 1/1] tools: fix forgotten index->mgmt_index renaming in btmgmt.c

Commit 6523d168a7c1bdb886fbf42e8a810ed15e5ec0e2 renamed the variable
index to mgmt_index but missed it in one place. When trying to
compile bluez I get:

```
/data/data/com.termux/files/home/.termux-build/libbluetooth/src/tools/btmgmt.c:1229:34: warning: implicitly declaring library function 'index' with type 'char *(const char *, int)' [-Wimplicit-function-declaration]
config_info_rsp, UINT_TO_PTR(index), NULL)) {
^
/data/data/com.termux/files/home/.termux-build/libbluetooth/src/tools/btmgmt.c:1229:34: note: include the header <strings.h> or explicitly provide a declaration for 'index'
[...]
/data/data/com.termux/files/usr/bin/aarch64-linux-android-ld: tools/btmgmt.o: in function `cmd_config':
btmgmt.c:(.text+0x544): undefined reference to `index'
/data/data/com.termux/files/usr/bin/aarch64-linux-android-ld: btmgmt.c:(.text+0x548): undefined reference to `index'
```

This seem to only happens on system (like android) where the obsolete
index function is not defined.

---
tools/btmgmt.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/btmgmt.c b/tools/btmgmt.c
index b0b837d34..228f94efa 100644
--- a/tools/btmgmt.c
+++ b/tools/btmgmt.c
@@ -1213,7 +1213,7 @@ static void cmd_config(int argc, char **argv)
}

if (!mgmt_send(mgmt, MGMT_OP_READ_CONFIG_INFO, mgmt_index, 0, NULL,
- config_info_rsp, UINT_TO_PTR(index), NULL)) {
+ config_info_rsp, UINT_TO_PTR(mgmt_index), NULL)) {
error("Unable to send read_config_info cmd");
return bt_shell_noninteractive_quit(EXIT_FAILURE);
}
--
2.28.0


2020-10-06 14:49:04

by bluez.test.bot

[permalink] [raw]
Subject: RE: [BlueZ,1/1] tools: fix forgotten index->mgmt_index renaming in btmgmt.c

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=360317

---Test result---

##############################
Test: CheckPatch - FAIL
Output:
tools: fix forgotten index->mgmt_index renaming in btmgmt.c
ERROR:GIT_COMMIT_ID: Please use git commit description style 'commit <12+ chars of sha1> ("<title line>")' - ie: 'Commit 6523d168a7c1 ("tools/btmgmt: Port to use bt_shell")'
#6:
Commit 6523d168a7c1bdb886fbf42e8a810ed15e5ec0e2 renamed the variable

WARNING:COMMIT_LOG_LONG_LINE: Possible unwrapped commit description (prefer a maximum 75 chars per line)
#11:
/data/data/com.termux/files/home/.termux-build/libbluetooth/src/tools/btmgmt.c:1229:34: warning: implicitly declaring library function 'index' with type 'char *(const char *, int)' [-Wimplicit-function-declaration]

WARNING:LONG_LINE: line over 80 characters
#33: FILE: tools/btmgmt.c:1216:
+ config_info_rsp, UINT_TO_PTR(mgmt_index), NULL)) {

- total: 1 errors, 2 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.

Your patch has style problems, please review.

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

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


##############################
Test: CheckGitLint - FAIL
Output:
tools: fix forgotten index->mgmt_index renaming in btmgmt.c
8: B1 Line exceeds max length (214>80): "/data/data/com.termux/files/home/.termux-build/libbluetooth/src/tools/btmgmt.c:1229:34: warning: implicitly declaring library function 'index' with type 'char *(const char *, int)' [-Wimplicit-function-declaration]"
11: B1 Line exceeds max length (172>80): "/data/data/com.termux/files/home/.termux-build/libbluetooth/src/tools/btmgmt.c:1229:34: note: include the header <strings.h> or explicitly provide a declaration for 'index'"
13: B1 Line exceeds max length (103>80): "/data/data/com.termux/files/usr/bin/aarch64-linux-android-ld: tools/btmgmt.o: in function `cmd_config':"
15: B1 Line exceeds max length (116>80): "/data/data/com.termux/files/usr/bin/aarch64-linux-android-ld: btmgmt.c:(.text+0x548): undefined reference to `index'"


##############################
Test: CheckBuild - PASS

##############################
Test: MakeCheck - PASS



---
Regards,
Linux Bluetooth