Skip to contentSkip to conversation

shared/ad: Return NULL instead of false in bt_ad_has_data

PATCH In review Archie Pusaka 2 participants 2 messages Nov 19 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 shared/ad: Return NULL instead of false in bt_ad_has_data

From: James Y Knight <[email protected]>

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(-)
src/shared/ad.c +1 -1
index 236e71950..c772d4b51 100644
@@ -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);
 }
Signature · 1 line
2.56.1.708.g77570a6a1d-goog
#1 lore raw

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/series/1215766/

---Test result---

Test Summary:

CheckPatch                    PASS      0.39 seconds
GitLint                       PASS      0.29 seconds
BuildEll                      PASS      14.12 seconds
BluezMake                     PASS      208.35 seconds
CheckSmatch                   PASS      185.82 seconds
bluezmakeextell               PASS      67.33 seconds
TestFunctional                FAIL      957.68 seconds
IncrementalBuild              PASS      209.37 seconds
ScanBuild                     PASS      709.73 seconds

Details
##############################
Test: TestFunctional - FAIL
Desc: Run test-functional
Output:
FAIL functional.test_bap::test_bass_past_earbuds_transport_acquire[hosts11-vm3]: AssertionError: Failed to acquire: org.bluez.Error.Failed

https://github.com/bluez/bluez/pull/2847

---
Regards,
Linux Bluetooth