diff mbox series

[BlueZ,v2] shared/ad: move MAX_ADV_DATA_LEN macro to the header

Message ID 20200817222717.BlueZ.v2.1.I716fc87b0c97e5349a04766a61ecad1f5b0fd28e@changeid (mailing list archive)
State Superseded
Headers show
Series [BlueZ,v2] shared/ad: move MAX_ADV_DATA_LEN macro to the header | expand

Commit Message

Miao-chen Chou Aug. 18, 2020, 5:27 a.m. UTC
This moves MAX_ADV_DATA_LEN macro to src/shared/ad.h and rename it to
BT_AD_MAX_DATA_LEN.
---
Hi Maintainers,

In order to avoid duplicate definition of the maximum data length of
advertisement for the following series of advertisement monitor API,
we'd like to reuse the one in shared/ad.

Thanks,
Miao

Changes in v2:
- Rename the macro to BT_AD_MAX_DATA_LEN.

 src/shared/ad.c | 2 --
 src/shared/ad.h | 2 ++
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

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

Test Result:
checkbuild Failed

Outputs:
ar: `u' modifier ignored since `D' is the default (see `U')
src/shared/ad.c: In function ‘name_length’:
src/shared/ad.c:258:12: error: ‘MAX_ADV_DATA_LEN’ undeclared (first use in this function)
  258 |  if (len > MAX_ADV_DATA_LEN - *pos)
      |            ^~~~~~~~~~~~~~~~
src/shared/ad.c:258:12: note: each undeclared identifier is reported only once for each function it appears in
src/shared/ad.c: In function ‘serialize_name’:
src/shared/ad.c:427:12: error: ‘MAX_ADV_DATA_LEN’ undeclared (first use in this function)
  427 |  if (len > MAX_ADV_DATA_LEN - (*pos + 2)) {
      |            ^~~~~~~~~~~~~~~~
src/shared/ad.c: In function ‘bt_ad_generate’:
src/shared/ad.c:479:16: error: ‘MAX_ADV_DATA_LEN’ undeclared (first use in this function)
  479 |  if (*length > MAX_ADV_DATA_LEN)
      |                ^~~~~~~~~~~~~~~~
src/shared/ad.c: In function ‘bt_ad_add_manufacturer_data’:
src/shared/ad.c:587:13: error: ‘MAX_ADV_DATA_LEN’ undeclared (first use in this function)
  587 |  if (len > (MAX_ADV_DATA_LEN - 2 - sizeof(uint16_t)))
      |             ^~~~~~~~~~~~~~~~
src/shared/ad.c: In function ‘bt_ad_add_service_data’:
src/shared/ad.c:724:13: error: ‘MAX_ADV_DATA_LEN’ undeclared (first use in this function)
  724 |  if (len > (MAX_ADV_DATA_LEN - 2 - (size_t)bt_uuid_len(uuid)))
      |             ^~~~~~~~~~~~~~~~
src/shared/ad.c: In function ‘bt_ad_add_data’:
src/shared/ad.c:943:13: error: ‘MAX_ADV_DATA_LEN’ undeclared (first use in this function)
  943 |  if (len > (MAX_ADV_DATA_LEN - 2))
      |             ^~~~~~~~~~~~~~~~
make[1]: *** [Makefile:6807: src/shared/ad.lo] Error 1
make: *** [Makefile:4010: all] Error 2



---
Regards,
Linux Bluetooth
diff mbox series

Patch

diff --git a/src/shared/ad.c b/src/shared/ad.c
index 8d276842e..6d882a9b3 100644
--- a/src/shared/ad.c
+++ b/src/shared/ad.c
@@ -33,8 +33,6 @@ 
 #include "src/shared/queue.h"
 #include "src/shared/util.h"
 
-#define MAX_ADV_DATA_LEN 31
-
 struct bt_ad {
 	int ref_count;
 	char *name;
diff --git a/src/shared/ad.h b/src/shared/ad.h
index 19aa1d035..17e3b631b 100644
--- a/src/shared/ad.h
+++ b/src/shared/ad.h
@@ -27,6 +27,8 @@ 
 #include "lib/bluetooth.h"
 #include "lib/uuid.h"
 
+#define BT_AD_MAX_DATA_LEN		31
+
 #define BT_AD_FLAGS			0x01
 #define BT_AD_UUID16_SOME		0x02
 #define BT_AD_UUID16_ALL		0x03