diff mbox series

[BlueZ,1/2] btiotest: Correct setting of addr_type for big-endian platforms

Message ID 418845b9-28e1-4356-9ce2-b422720bf948@EXC04-ATKLA.omicron.at (mailing list archive)
State Accepted
Delegated to: Luiz Von Dentz
Headers show
Series Fix a couple of endian issues | expand

Commit Message

Mark Marshall Aug. 19, 2020, 1:22 p.m. UTC
The glibc option parser expects the option values pointed to by
G_OPTION_ARG_INT to be an int, so a guint8 is wrong in all cases,
but on a big-endian platform you can't even change the addr_type.
(On little endian, it would appear to work).
---
 tools/btiotest.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Comments

bluez.test.bot@gmail.com Aug. 19, 2020, 1:50 p.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.
While we are preparing for reviewing the patches, we found the following
issue/warning.

Test Result:
checkpatch Failed

Outputs:
ERROR:INITIALISED_STATIC: do not initialise statics to 0
#21: FILE: tools/btiotest.c:559:
+static int opt_addr_type = 0;

WARNING:LONG_LINE: line over 80 characters
#31: FILE: tools/btiotest.c:619:
+		" prio=%d voice=0x%04x addr_type=%u\n", opt_accept, opt_reject, opt_disconn,

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



---
Regards,
Linux Bluetooth
diff mbox series

Patch

diff --git a/tools/btiotest.c b/tools/btiotest.c
index 6c778e3c5..d56bb4fda 100644
--- a/tools/btiotest.c
+++ b/tools/btiotest.c
@@ -556,7 +556,7 @@  static int opt_sec = 0;
 static gboolean opt_master = FALSE;
 static int opt_priority = 0;
 static int opt_cid = 0;
-static guint8 opt_addr_type = 0;
+static int opt_addr_type = 0;
 
 static GMainLoop *main_loop;
 
@@ -616,8 +616,9 @@  int main(int argc, char *argv[])
 	g_option_context_free(context);
 
 	printf("accept=%d reject=%d discon=%d defer=%d sec=%d update_sec=%d"
-		" prio=%d voice=0x%04x\n", opt_accept, opt_reject, opt_disconn,
-		opt_defer, opt_sec, opt_update_sec, opt_priority, opt_voice);
+		" prio=%d voice=0x%04x addr_type=%u\n", opt_accept, opt_reject, opt_disconn,
+		opt_defer, opt_sec, opt_update_sec, opt_priority, opt_voice,
+		opt_addr_type);
 
 	if (opt_psm || opt_cid) {
 		if (argc > 1)