From: Archie Pusaka <apusaka@google.com>
To: linux-bluetooth@vger.kernel.org
Cc: James Y Knight <jyknight@google.com>
Subject: [PATCH BlueZ] shared/ad: Return NULL instead of false in bt_ad_has_data
Date: Thu, 19 Nov 2026 06:56:41 +0000 [thread overview]
Message-ID: <20261119065641.2510361-1-apusaka@google.com> (raw)
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
next reply other threads:[~2026-11-19 6:57 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-19 6:56 Archie Pusaka [this message]
2026-11-19 9:29 ` [BlueZ] shared/ad: Return NULL instead of false in bt_ad_has_data bluez.test.bot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261119065641.2510361-1-apusaka@google.com \
--to=apusaka@google.com \
--cc=jyknight@google.com \
--cc=linux-bluetooth@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.