All of lore.kernel.org
 help / color / mirror / Atom feed
* [BlueZ PATCH v2] shared/ad: move MAX_ADV_DATA_LEN macro to the header
@ 2020-08-18  5:27 Miao-chen Chou
  2020-08-18  5:50 ` [BlueZ,v2] " bluez.test.bot
  0 siblings, 1 reply; 2+ messages in thread
From: Miao-chen Chou @ 2020-08-18  5:27 UTC (permalink / raw)
  To: Bluetooth Kernel Mailing List
  Cc: Howard Chung, Luiz Augusto von Dentz, Alain Michaud,
	Manish Mandlik, Miao-chen Chou

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(-)

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
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* RE: [BlueZ,v2] shared/ad: move MAX_ADV_DATA_LEN macro to the header
  2020-08-18  5:27 [BlueZ PATCH v2] shared/ad: move MAX_ADV_DATA_LEN macro to the header Miao-chen Chou
@ 2020-08-18  5:50 ` bluez.test.bot
  0 siblings, 0 replies; 2+ messages in thread
From: bluez.test.bot @ 2020-08-18  5:50 UTC (permalink / raw)
  To: linux-bluetooth, mcchou

[-- Attachment #1: Type: text/plain, Size: 2007 bytes --]


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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-08-18  5:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-18  5:27 [BlueZ PATCH v2] shared/ad: move MAX_ADV_DATA_LEN macro to the header Miao-chen Chou
2020-08-18  5:50 ` [BlueZ,v2] " bluez.test.bot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.