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 1/4] core/device: Fix btd_device_set_temporary
Date: Tue, 17 Mar 2015 11:13:12 +0200	[thread overview]
Message-ID: <1426583595-28502-1-git-send-email-luiz.dentz@gmail.com> (raw)

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

In case the device is set as not temporary it should trigger
store_device_info but the function checks if temporary flag is set but
since currently the code only set the flag after the call nothing really
happens.
---
 src/device.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/device.c b/src/device.c
index 97c0523..6100341 100644
--- a/src/device.c
+++ b/src/device.c
@@ -4474,17 +4474,19 @@ void btd_device_set_temporary(struct btd_device *device, gboolean temporary)
 
 	DBG("temporary %d", temporary);
 
+	device->temporary = temporary;
+
 	if (temporary) {
 		if (device->bredr)
 			adapter_whitelist_remove(device->adapter, device);
 		adapter_connect_list_remove(device->adapter, device);
-	} else {
-		if (device->bredr)
-			adapter_whitelist_add(device->adapter, device);
-		store_device_info(device);
+		return;
 	}
 
-	device->temporary = temporary;
+	if (device->bredr)
+		adapter_whitelist_add(device->adapter, device);
+
+	store_device_info(device);
 }
 
 void btd_device_set_trusted(struct btd_device *device, gboolean trusted)
-- 
2.1.0


             reply	other threads:[~2015-03-17  9:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-17  9:13 Luiz Augusto von Dentz [this message]
2015-03-17  9:13 ` [PATCH BlueZ 2/4] core/device: Convert temporary flag to bool Luiz Augusto von Dentz
2015-03-17  9:13 ` [PATCH BlueZ 3/4] core/adapter: Remove checks to device_is_temporary Luiz Augusto von Dentz
2015-03-17  9:13 ` [PATCH BlueZ 4/4] core: Make device_set_bonded reset temporary flag Luiz Augusto von Dentz
2015-03-17 15:46 ` [PATCH BlueZ 1/4] core/device: Fix btd_device_set_temporary 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=1426583595-28502-1-git-send-email-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.