linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Henrik Grimler <henrik@grimler.se>
To: linux-bluetooth@vger.kernel.org
Cc: Henrik Grimler <henrik@grimler.se>
Subject: [PATCH BlueZ v3] tools: fix forgotten index->mgmt_index renaming in btmgmt.c
Date: Tue,  6 Oct 2020 17:50:34 +0200	[thread overview]
Message-ID: <20201006155034.126914-1-henrik@grimler.se> (raw)

Commit 6523d168a7c1 ("tools/btmgmt: Port to use bt_shell") seem to
have missed this.  When trying to compile bluez I get:

```
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)) {
                                                             ^
tools/btmgmt.c:1229:34: note: include the header <strings.h> or explicitly \
provide a declaration for 'index'
[...]
aarch64-linux-android-ld: tools/btmgmt.o: in function `cmd_config':
btmgmt.c:(.text+0x544): undefined reference to `index'
aarch64-linux-android-ld: btmgmt.c:(.text+0x548): undefined reference to `index'
```

Probably only happens on system (like android) where the obsolete
index function does not exist.

---
Changes in v3:
- Ensure lines in code are < 80 characters as well

Changes in v2:
- Update commit message to make lint bot happy

 tools/btmgmt.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tools/btmgmt.c b/tools/btmgmt.c
index b0b837d34..9daa58c54 100644
--- a/tools/btmgmt.c
+++ b/tools/btmgmt.c
@@ -1212,8 +1212,9 @@ static void cmd_config(int argc, char **argv)
 		return;
 	}
 
-	if (!mgmt_send(mgmt, MGMT_OP_READ_CONFIG_INFO, mgmt_index, 0, NULL,
-				config_info_rsp, UINT_TO_PTR(index), NULL)) {
+	if (!mgmt_send(mgmt, MGMT_OP_READ_CONFIG_INFO, mgmt_index,
+				0, 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


             reply	other threads:[~2020-10-06 15:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-06 15:50 Henrik Grimler [this message]
2020-10-06 16:38 ` [BlueZ,v3] tools: fix forgotten index->mgmt_index renaming in btmgmt.c bluez.test.bot
2020-10-10  7:48   ` Henrik Grimler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201006155034.126914-1-henrik@grimler.se \
    --to=henrik@grimler.se \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).