All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH BlueZ] adv_monitor: Fix spamming errors
Date: Tue,  8 Feb 2022 13:05:41 -0800	[thread overview]
Message-ID: <20220208210541.3883437-1-luiz.dentz@gmail.com> (raw)

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

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.

Fixes: https://github.com/bluez/bluez/issues/286
---
 src/adapter.c     | 2 +-
 src/adv_monitor.c | 6 ++----
 src/adv_monitor.h | 2 +-
 3 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/src/adapter.c b/src/adapter.c
index e59b16328..b15b5021f 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -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);
 
diff --git a/src/adv_monitor.c b/src/adv_monitor.c
index 602830e30..33f4d9619 100644
--- a/src/adv_monitor.c
+++ b/src/adv_monitor.c
@@ -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);
diff --git a/src/adv_monitor.h b/src/adv_monitor.h
index bed6572d0..c6bb8a68a 100644
--- a/src/adv_monitor.h
+++ b/src/adv_monitor.h
@@ -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


             reply	other threads:[~2022-02-08 22:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-08 21:05 Luiz Augusto von Dentz [this message]
2022-02-08 21:13 ` [PATCH BlueZ] adv_monitor: Fix spamming errors Luiz Augusto von Dentz
2022-02-08 23:43 ` [BlueZ] " bluez.test.bot
2022-02-10  0:10   ` Luiz Augusto von Dentz

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=20220208210541.3883437-1-luiz.dentz@gmail.com \
    --to=luiz.dentz@gmail.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.