Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH BlueZ] shared/ad: Return NULL instead of false in bt_ad_has_data
@ 2026-11-19  6:56 Archie Pusaka
  2026-11-19  9:29 ` [BlueZ] " bluez.test.bot
  0 siblings, 1 reply; 2+ messages in thread
From: Archie Pusaka @ 2026-11-19  6:56 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: James Y Knight

From: James Y Knight <jyknight@google.com>

bt_ad_has_data() returns a pointer, but its NULL-ad check returns
false. In C23, false is no longer a valid null pointer constant and
cannot be implicitly converted to a pointer type, which breaks the
build. Return NULL instead.
---
 src/shared/ad.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/shared/ad.c b/src/shared/ad.c
index 236e71950..c772d4b51 100644
--- a/src/shared/ad.c
+++ b/src/shared/ad.c
@@ -1245,7 +1245,7 @@ struct bt_ad_data *bt_ad_has_data(struct bt_ad *ad,
 					const struct bt_ad_data *data)
 {
 	if (!ad)
-		return false;
+		return NULL;
 
 	return queue_find(ad->data, data_match, data);
 }
-- 
2.56.1.708.g77570a6a1d-goog


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

end of thread, other threads:[~2026-11-19  9:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-19  6:56 [PATCH BlueZ] shared/ad: Return NULL instead of false in bt_ad_has_data Archie Pusaka
2026-11-19  9:29 ` [BlueZ] " bluez.test.bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox