linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH BlueZ] unit: reduce macro expansion volume
@ 2025-12-09 20:26 Pauli Virtanen
  2025-12-09 21:21 ` [BlueZ] " bluez.test.bot
  2025-12-10 21:40 ` [PATCH BlueZ] " patchwork-bot+bluetooth
  0 siblings, 2 replies; 3+ messages in thread
From: Pauli Virtanen @ 2025-12-09 20:26 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Pauli Virtanen

define_test() in some of unit tests expands the long command sequences
three times.

Make it expand only once.

This reduces preprocessor output e.g. for test-bap.c from 23 Mb to 5 Mb,
for faster compilation.
---
 unit/test-bap.c  | 4 ++--
 unit/test-bass.c | 4 ++--
 unit/test-gmap.c | 4 ++--
 unit/test-micp.c | 8 ++++----
 unit/test-tmap.c | 4 ++--
 unit/test-vcp.c  | 4 ++--
 6 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/unit/test-bap.c b/unit/test-bap.c
index 83457bc7b..2da427694 100644
--- a/unit/test-bap.c
+++ b/unit/test-bap.c
@@ -121,8 +121,8 @@ static struct bt_bap_pac_qos lc3_qos = {
 			data.caps = data.cfg->pac_caps;		\
 		if (data.cfg && data.cfg->pac_qos)		\
 			data.qos = data.cfg->pac_qos;		\
-		data.iovcnt = ARRAY_SIZE(iov_data(args));	\
-		data.iov = util_iov_dup(iov, ARRAY_SIZE(iov_data(args))); \
+		data.iovcnt = ARRAY_SIZE(iov);			\
+		data.iov = util_iov_dup(iov, ARRAY_SIZE(iov));	\
 		data.streams = queue_new(); \
 		tester_add(name, &data, setup, function,	\
 				test_teardown);			\
diff --git a/unit/test-bass.c b/unit/test-bass.c
index 8d914cffa..0cdee043e 100644
--- a/unit/test-bass.c
+++ b/unit/test-bass.c
@@ -491,8 +491,8 @@ struct ccc_state {
 	do {							\
 		const struct iovec iov[] = { args };		\
 		static struct test_data data;			\
-		data.iovcnt = ARRAY_SIZE(iov_data(args));	\
-		data.iov = util_iov_dup(iov, ARRAY_SIZE(iov_data(args))); \
+		data.iovcnt = ARRAY_SIZE(iov);			\
+		data.iov = util_iov_dup(iov, ARRAY_SIZE(iov));	\
 		tester_add(name, &data, NULL, function,	\
 				test_teardown);			\
 	} while (0)
diff --git a/unit/test-gmap.c b/unit/test-gmap.c
index ce9eeb8f9..8b37efd18 100644
--- a/unit/test-gmap.c
+++ b/unit/test-gmap.c
@@ -54,8 +54,8 @@ struct test_data {
 	do {							\
 		const struct iovec iov[] = { args };		\
 		static struct test_data data;			\
-		data.iovcnt = ARRAY_SIZE(iov_data(args));	\
-		data.iov = util_iov_dup(iov, ARRAY_SIZE(iov_data(args))); \
+		data.iovcnt = ARRAY_SIZE(iov);			\
+		data.iov = util_iov_dup(iov, ARRAY_SIZE(iov));	\
 		data.cfg = _cfg;				\
 		tester_add(name, &data, setup, function,	\
 				test_teardown);			\
diff --git a/unit/test-micp.c b/unit/test-micp.c
index 9c4f834e7..ff17300d5 100644
--- a/unit/test-micp.c
+++ b/unit/test-micp.c
@@ -70,8 +70,8 @@ struct notify {
 	do {							\
 		const struct iovec iov[] = { args };		\
 		static struct test_data_mics data;			\
-		data.iovcnt = ARRAY_SIZE(iov_data(args));	\
-		data.iov = util_iov_dup(iov, ARRAY_SIZE(iov_data(args))); \
+		data.iovcnt = ARRAY_SIZE(iov);			\
+		data.iov = util_iov_dup(iov, ARRAY_SIZE(iov));	\
 		tester_add(name, &data, NULL, function,	\
 				test_teardown_mics);			\
 	} while (0)
@@ -80,8 +80,8 @@ struct notify {
 	do {							\
 		const struct iovec iov[] = { args };		\
 		static struct test_data_micp data;			\
-		data.iovcnt = ARRAY_SIZE(iov_data(args));	\
-		data.iov = util_iov_dup(iov, ARRAY_SIZE(iov_data(args))); \
+		data.iovcnt = ARRAY_SIZE(iov);			\
+		data.iov = util_iov_dup(iov, ARRAY_SIZE(iov));	\
 		tester_add(name, &data, test_setup, function,	\
 				test_teardown_micp);			\
 	} while (0)
diff --git a/unit/test-tmap.c b/unit/test-tmap.c
index 937dac6ee..e75d62119 100644
--- a/unit/test-tmap.c
+++ b/unit/test-tmap.c
@@ -51,8 +51,8 @@ struct test_data {
 	do {							\
 		const struct iovec iov[] = { args };		\
 		static struct test_data data;			\
-		data.iovcnt = ARRAY_SIZE(iov_data(args));	\
-		data.iov = util_iov_dup(iov, ARRAY_SIZE(iov_data(args))); \
+		data.iovcnt = ARRAY_SIZE(iov);			\
+		data.iov = util_iov_dup(iov, ARRAY_SIZE(iov));	\
 		data.cfg = _cfg;				\
 		tester_add(name, &data, setup, function,	\
 				test_teardown);			\
diff --git a/unit/test-vcp.c b/unit/test-vcp.c
index 71c545656..4a60842e5 100644
--- a/unit/test-vcp.c
+++ b/unit/test-vcp.c
@@ -59,8 +59,8 @@ struct ccc_state {
 	do {							\
 		const struct iovec iov[] = { args };		\
 		static struct test_data data;			\
-		data.iovcnt = ARRAY_SIZE(iov_data(args));	\
-		data.iov = util_iov_dup(iov, ARRAY_SIZE(iov_data(args))); \
+		data.iovcnt = ARRAY_SIZE(iov);			\
+		data.iov = util_iov_dup(iov, ARRAY_SIZE(iov));	\
 		tester_add(name, &data, NULL, function,	\
 				test_teardown);			\
 	} while (0)
-- 
2.51.1


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

* RE: [BlueZ] unit: reduce macro expansion volume
  2025-12-09 20:26 [PATCH BlueZ] unit: reduce macro expansion volume Pauli Virtanen
@ 2025-12-09 21:21 ` bluez.test.bot
  2025-12-10 21:40 ` [PATCH BlueZ] " patchwork-bot+bluetooth
  1 sibling, 0 replies; 3+ messages in thread
From: bluez.test.bot @ 2025-12-09 21:21 UTC (permalink / raw)
  To: linux-bluetooth, pav

[-- Attachment #1: Type: text/plain, Size: 1262 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.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=1031813

---Test result---

Test Summary:
CheckPatch                    PENDING   0.27 seconds
GitLint                       PENDING   0.26 seconds
BuildEll                      PASS      19.94 seconds
BluezMake                     PASS      635.97 seconds
MakeCheck                     PASS      22.07 seconds
MakeDistcheck                 PASS      237.44 seconds
CheckValgrind                 PASS      297.68 seconds
CheckSmatch                   PASS      345.96 seconds
bluezmakeextell               PASS      181.79 seconds
IncrementalBuild              PENDING   0.25 seconds
ScanBuild                     PASS      1021.97 seconds

Details
##############################
Test: CheckPatch - PENDING
Desc: Run checkpatch.pl script
Output:

##############################
Test: GitLint - PENDING
Desc: Run gitlint
Output:

##############################
Test: IncrementalBuild - PENDING
Desc: Incremental build with the patches in the series
Output:



---
Regards,
Linux Bluetooth


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

* Re: [PATCH BlueZ] unit: reduce macro expansion volume
  2025-12-09 20:26 [PATCH BlueZ] unit: reduce macro expansion volume Pauli Virtanen
  2025-12-09 21:21 ` [BlueZ] " bluez.test.bot
@ 2025-12-10 21:40 ` patchwork-bot+bluetooth
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+bluetooth @ 2025-12-10 21:40 UTC (permalink / raw)
  To: Pauli Virtanen; +Cc: linux-bluetooth

Hello:

This patch was applied to bluetooth/bluez.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:

On Tue,  9 Dec 2025 22:26:11 +0200 you wrote:
> define_test() in some of unit tests expands the long command sequences
> three times.
> 
> Make it expand only once.
> 
> This reduces preprocessor output e.g. for test-bap.c from 23 Mb to 5 Mb,
> for faster compilation.
> 
> [...]

Here is the summary with links:
  - [BlueZ] unit: reduce macro expansion volume
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=fa6f1e942cee

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2025-12-10 21:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-09 20:26 [PATCH BlueZ] unit: reduce macro expansion volume Pauli Virtanen
2025-12-09 21:21 ` [BlueZ] " bluez.test.bot
2025-12-10 21:40 ` [PATCH BlueZ] " patchwork-bot+bluetooth

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