public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ v2 0/2] shared/util: Add MIN/MAX implementations
@ 2026-03-31 21:36 Bastien Nocera
  2026-03-31 21:36 ` [PATCH BlueZ v2 1/2] " Bastien Nocera
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Bastien Nocera @ 2026-03-31 21:36 UTC (permalink / raw)
  To: linux-bluetooth

Changes since v1:
- Fix MIN/MAX implementation (tests all pass...)

Bastien Nocera (2):
  shared/util: Add MIN/MAX implementations
  emulator: Remove compile-time header only glib dep

 emulator/btdev.c   | 2 --
 src/sdpd-request.c | 2 --
 src/shared/util.h  | 6 ++++++
 3 files changed, 6 insertions(+), 4 deletions(-)

-- 
2.53.0


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

* [PATCH BlueZ v2 1/2] shared/util: Add MIN/MAX implementations
  2026-03-31 21:36 [PATCH BlueZ v2 0/2] shared/util: Add MIN/MAX implementations Bastien Nocera
@ 2026-03-31 21:36 ` Bastien Nocera
  2026-03-31 22:47   ` bluez.test.bot
  2026-03-31 21:36 ` [PATCH BlueZ v2 2/2] emulator: Remove compile-time header only glib dep Bastien Nocera
  2026-04-01 14:30 ` [PATCH BlueZ v2 0/2] shared/util: Add MIN/MAX implementations patchwork-bot+bluetooth
  2 siblings, 1 reply; 5+ messages in thread
From: Bastien Nocera @ 2026-03-31 21:36 UTC (permalink / raw)
  To: linux-bluetooth

And remove it from src/sdpd-request.c to avoid a redefinition warning
at compile-time.
---
 src/sdpd-request.c | 2 --
 src/shared/util.h  | 6 ++++++
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/sdpd-request.c b/src/sdpd-request.c
index 1fc07e97bfe0..7c632c2aaf62 100644
--- a/src/sdpd-request.c
+++ b/src/sdpd-request.c
@@ -40,8 +40,6 @@ typedef struct {
 
 #define SDP_CONT_STATE_SIZE (sizeof(uint8_t) + sizeof(sdp_cont_state_t))
 
-#define MIN(x, y) ((x) < (y)) ? (x): (y)
-
 typedef struct sdp_cont_info sdp_cont_info_t;
 
 struct sdp_cont_info {
diff --git a/src/shared/util.h b/src/shared/util.h
index c480351d6e9f..67629dddfaa9 100644
--- a/src/shared/util.h
+++ b/src/shared/util.h
@@ -22,6 +22,12 @@
 #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
 #define BIT(n)  (1 << (n))
 
+#undef MIN
+#define MIN(a, b) ((a) < (b) ? (a) : (b))
+
+#undef MAX
+#define MAX(a, b) ((a) > (b) ? (a) : (b))
+
 #if __BYTE_ORDER == __LITTLE_ENDIAN
 #define le16_to_cpu(val) (val)
 #define le32_to_cpu(val) (val)
-- 
2.53.0


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

* [PATCH BlueZ v2 2/2] emulator: Remove compile-time header only glib dep
  2026-03-31 21:36 [PATCH BlueZ v2 0/2] shared/util: Add MIN/MAX implementations Bastien Nocera
  2026-03-31 21:36 ` [PATCH BlueZ v2 1/2] " Bastien Nocera
@ 2026-03-31 21:36 ` Bastien Nocera
  2026-04-01 14:30 ` [PATCH BlueZ v2 0/2] shared/util: Add MIN/MAX implementations patchwork-bot+bluetooth
  2 siblings, 0 replies; 5+ messages in thread
From: Bastien Nocera @ 2026-03-31 21:36 UTC (permalink / raw)
  To: linux-bluetooth

btvirt relied on a glib header macro to use MIN/MAX, but didn't link
against it, meaning that it was dependent on other programs in the
project using glib to compile correctly.

Remove the include and use our own implementation instead.
---
 emulator/btdev.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/emulator/btdev.c b/emulator/btdev.c
index d3a9c6735ff1..3a295b679f34 100644
--- a/emulator/btdev.c
+++ b/emulator/btdev.c
@@ -25,8 +25,6 @@
 #include <fcntl.h>
 #include <unistd.h>
 
-#include <glib.h>
-
 #include "bluetooth/bluetooth.h"
 #include "bluetooth/hci.h"
 
-- 
2.53.0


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

* RE: shared/util: Add MIN/MAX implementations
  2026-03-31 21:36 ` [PATCH BlueZ v2 1/2] " Bastien Nocera
@ 2026-03-31 22:47   ` bluez.test.bot
  0 siblings, 0 replies; 5+ messages in thread
From: bluez.test.bot @ 2026-03-31 22:47 UTC (permalink / raw)
  To: linux-bluetooth, hadess

[-- Attachment #1: Type: text/plain, Size: 1477 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=1075447

---Test result---

Test Summary:
CheckPatch                    PENDING   0.36 seconds
GitLint                       PENDING   0.33 seconds
BuildEll                      PASS      20.71 seconds
BluezMake                     PASS      651.49 seconds
MakeCheck                     PASS      18.40 seconds
MakeDistcheck                 PASS      247.42 seconds
CheckValgrind                 PASS      296.12 seconds
CheckSmatch                   WARNING   357.45 seconds
bluezmakeextell               PASS      184.81 seconds
IncrementalBuild              PENDING   0.64 seconds
ScanBuild                     PASS      1027.89 seconds

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

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

##############################
Test: CheckSmatch - WARNING
Desc: Run smatch tool with source
Output:
emulator/btdev.c:468:29: warning: Variable length array is used.
##############################
Test: IncrementalBuild - PENDING
Desc: Incremental build with the patches in the series
Output:



https://github.com/bluez/bluez/pull/1996/checks

---
Regards,
Linux Bluetooth


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

* Re: [PATCH BlueZ v2 0/2] shared/util: Add MIN/MAX implementations
  2026-03-31 21:36 [PATCH BlueZ v2 0/2] shared/util: Add MIN/MAX implementations Bastien Nocera
  2026-03-31 21:36 ` [PATCH BlueZ v2 1/2] " Bastien Nocera
  2026-03-31 21:36 ` [PATCH BlueZ v2 2/2] emulator: Remove compile-time header only glib dep Bastien Nocera
@ 2026-04-01 14:30 ` patchwork-bot+bluetooth
  2 siblings, 0 replies; 5+ messages in thread
From: patchwork-bot+bluetooth @ 2026-04-01 14:30 UTC (permalink / raw)
  To: Bastien Nocera; +Cc: linux-bluetooth

Hello:

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

On Tue, 31 Mar 2026 23:36:35 +0200 you wrote:
> Changes since v1:
> - Fix MIN/MAX implementation (tests all pass...)
> 
> Bastien Nocera (2):
>   shared/util: Add MIN/MAX implementations
>   emulator: Remove compile-time header only glib dep
> 
> [...]

Here is the summary with links:
  - [BlueZ,v2,1/2] shared/util: Add MIN/MAX implementations
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=023e57342a07
  - [BlueZ,v2,2/2] emulator: Remove compile-time header only glib dep
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=dbbfffe2c323

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] 5+ messages in thread

end of thread, other threads:[~2026-04-01 14:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-31 21:36 [PATCH BlueZ v2 0/2] shared/util: Add MIN/MAX implementations Bastien Nocera
2026-03-31 21:36 ` [PATCH BlueZ v2 1/2] " Bastien Nocera
2026-03-31 22:47   ` bluez.test.bot
2026-03-31 21:36 ` [PATCH BlueZ v2 2/2] emulator: Remove compile-time header only glib dep Bastien Nocera
2026-04-01 14:30 ` [PATCH BlueZ v2 0/2] shared/util: Add MIN/MAX implementations 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