Skip to contentSkip to conversation

adv_monitor: Fix spamming errors

PATCH In review Luiz Augusto von Dentz 2 participants 4 messages Feb 8, 2022 – Feb 10, 2022 Bluetooth drivers

lore
Share & tools
lore

Luiz Augusto von Dentz

author maintainer
#0 lore raw

PATCH 1/1 adv_monitor: Fix spamming errors

From: Luiz Augusto von Dentz <[email protected]>

If advertising manager is not enabled don't log any error on btd_adapter_update_found_device, also change btd_adv_monitor_offload_supported to btd_adv_monitor_offload_enabled since that is checking if the features has been enabled rather than it is just supported.

---
 src/adapter.c     | 2 +-
 src/adv_monitor.c | 6 ++----
 src/adv_monitor.h | 2 +-
 3 files changed, 4 insertions(+), 6 deletions(-)
src/adapter.c +1 -1
index e59b16328..b15b5021f 100644
@@ -6899,7 +6899,7 @@ void btd_adapter_update_found_device(struct btd_adapter *adapter,
 	bool duplicate = false;
 	struct queue *matched_monitors = NULL;
 
-	if (!btd_adv_monitor_offload_supported(adapter->adv_monitor_manager)) {
+	if (!btd_adv_monitor_offload_enabled(adapter->adv_monitor_manager)) {
 		if (bdaddr_type != BDADDR_BREDR)
 			ad = bt_ad_new_with_data(data_len, data);
 
src/adv_monitor.c +2 -4
index 602830e30..33f4d9619 100644
@@ -1844,12 +1844,10 @@ void btd_adv_monitor_manager_destroy(struct btd_adv_monitor_manager *manager)
 	manager_destroy(manager);
 }
 
-bool btd_adv_monitor_offload_supported(struct btd_adv_monitor_manager *manager)
+bool btd_adv_monitor_offload_enabled(struct btd_adv_monitor_manager *manager)
 {
-	if (!manager) {
-		error("Manager is NULL, get offload support failed");
+	if (!manager)
 		return false;
-	}
 
 	return !!(manager->enabled_features &
 				MGMT_ADV_MONITOR_FEATURE_MASK_OR_PATTERNS);
src/adv_monitor.h +1 -1
index bed6572d0..c6bb8a68a 100644
@@ -27,7 +27,7 @@ struct btd_adv_monitor_manager *btd_adv_monitor_manager_create(
 						struct mgmt *mgmt);
 void btd_adv_monitor_manager_destroy(struct btd_adv_monitor_manager *manager);
 
-bool btd_adv_monitor_offload_supported(struct btd_adv_monitor_manager *manager);
+bool btd_adv_monitor_offload_enabled(struct btd_adv_monitor_manager *manager);
 
 struct queue *btd_adv_monitor_content_filter(
 				struct btd_adv_monitor_manager *manager,
Signature · 1 line
2.34.1
author maintainer
#1 lore raw

Hi Manish,

Quoted 21 lines · Luiz Augusto von Dentz

From: Luiz Augusto von Dentz <[email protected]>

If advertising manager is not enabled don't log any error on btd_adapter_update_found_device, also change btd_adv_monitor_offload_supported to btd_adv_monitor_offload_enabled since that is checking if the features has been enabled rather than it is just supported.

---
 src/adapter.c     | 2 +-
 src/adv_monitor.c | 6 ++----
 src/adv_monitor.h | 2 +-
 3 files changed, 4 insertions(+), 6 deletions(-)
src/adapter.c +0 -0
index e59b16328..b15b5021f 100644

src/adapter.c void btd_adapter_update_found_device(struct btd_adapter *adapter, · line 6902

Quoted 5 lines
src/adapter.c +1 -1
@@ -6899,7 +6899,7 @@ void btd_adapter_update_found_device(struct btd_adapter *adapter,
        bool duplicate = false;
        struct queue *matched_monitors = NULL;
 
-       if (!btd_adv_monitor_offload_supported(adapter->adv_monitor_manager)) {
+       if (!btd_adv_monitor_offload_enabled(adapter->adv_monitor_manager)) {

Could you please confirm this is actually correct, I have the filling there shouldn't be ! in the above statement.

Quoted 38 lines
src/adapter.c +0 -0
                if (bdaddr_type != BDADDR_BREDR)
                        ad = bt_ad_new_with_data(data_len, data);
 
src/adv_monitor.c +2 -4
index 602830e30..33f4d9619 100644
@@ -1844,12 +1844,10 @@ void btd_adv_monitor_manager_destroy(struct btd_adv_monitor_manager *manager)
        manager_destroy(manager);
 }
 
-bool btd_adv_monitor_offload_supported(struct btd_adv_monitor_manager *manager)
+bool btd_adv_monitor_offload_enabled(struct btd_adv_monitor_manager *manager)
 {
-       if (!manager) {
-               error("Manager is NULL, get offload support failed");
+       if (!manager)
                return false;
-       }
 
        return !!(manager->enabled_features &
                                MGMT_ADV_MONITOR_FEATURE_MASK_OR_PATTERNS);
src/adv_monitor.h +1 -2
index bed6572d0..c6bb8a68a 100644
@@ -27,7 +27,7 @@ struct btd_adv_monitor_manager *btd_adv_monitor_manager_create(
                                                struct mgmt *mgmt);
 void btd_adv_monitor_manager_destroy(struct btd_adv_monitor_manager *manager);
 
-bool btd_adv_monitor_offload_supported(struct btd_adv_monitor_manager *manager);
+bool btd_adv_monitor_offload_enabled(struct btd_adv_monitor_manager *manager);
 
 struct queue *btd_adv_monitor_content_filter(
                                struct btd_adv_monitor_manager *manager,
--

2.34.1

Signature · 1 line
Luiz Augusto von Dentz
#2 lore raw
In reply to Luiz Augusto von Dentz

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=612350

---Test result---

Test Summary:

CheckPatch                    PASS      1.47 seconds
GitLint                       PASS      1.02 seconds
Prep - Setup ELL              PASS      49.50 seconds
Build - Prep                  PASS      0.73 seconds
Build - Configure             PASS      9.70 seconds
Build - Make                  PASS      1398.39 seconds
Make Check                    PASS      12.21 seconds
Make Check w/Valgrind         PASS      513.32 seconds
Make Distcheck                PASS      258.23 seconds
Build w/ext ELL - Configure   PASS      9.62 seconds
Build w/ext ELL - Make        PASS      1372.14 seconds
Incremental Build with patchesPASS      0.00 seconds

---
Regards,
Linux Bluetooth

author maintainer
#3 lore raw

Hi,

Quoted 27 lines · On Tue, Feb 8, 2022 at 3:43 PM <[email protected]> wrote:

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=612350

---Test result---

Test Summary:

CheckPatch                    PASS      1.47 seconds
GitLint                       PASS      1.02 seconds
Prep - Setup ELL              PASS      49.50 seconds
Build - Prep                  PASS      0.73 seconds
Build - Configure             PASS      9.70 seconds
Build - Make                  PASS      1398.39 seconds
Make Check                    PASS      12.21 seconds
Make Check w/Valgrind         PASS      513.32 seconds
Make Distcheck                PASS      258.23 seconds
Build w/ext ELL - Configure   PASS      9.62 seconds
Build w/ext ELL - Make        PASS      1372.14 seconds
Incremental Build with patchesPASS      0.00 seconds
Quoted 3 lines

---
Regards,
Linux Bluetooth

Pushed.

Signature · 1 line
Luiz Augusto von Dentz