All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] device: Fix sending unneeded property change signals
@ 2014-03-21 15:06 Szymon Janc
  2014-03-21 15:58 ` Johan Hedberg
  0 siblings, 1 reply; 2+ messages in thread
From: Szymon Janc @ 2014-03-21 15:06 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Szymon Janc

Send property change for Modalias only if it changed. This fix sending
multiple unneeded property change events during discovery.
---
 src/device.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/device.c b/src/device.c
index 601dfdc..a69cfa6 100644
--- a/src/device.c
+++ b/src/device.c
@@ -4811,6 +4811,10 @@ gboolean btd_device_remove_attio_callback(struct btd_device *device, guint id)
 void btd_device_set_pnpid(struct btd_device *device, uint16_t source,
 			uint16_t vendor, uint16_t product, uint16_t version)
 {
+	if (device->vendor_src == source && device->version == version &&
+			device->vendor == vendor && device->product == product)
+		return;
+
 	device->vendor_src = source;
 	device->vendor = vendor;
 	device->product = product;
-- 
1.8.3.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] device: Fix sending unneeded property change signals
  2014-03-21 15:06 [PATCH] device: Fix sending unneeded property change signals Szymon Janc
@ 2014-03-21 15:58 ` Johan Hedberg
  0 siblings, 0 replies; 2+ messages in thread
From: Johan Hedberg @ 2014-03-21 15:58 UTC (permalink / raw)
  To: Szymon Janc; +Cc: linux-bluetooth

Hi Szymon,

On Fri, Mar 21, 2014, Szymon Janc wrote:
> Send property change for Modalias only if it changed. This fix sending
> multiple unneeded property change events during discovery.
> ---
>  src/device.c | 4 ++++
>  1 file changed, 4 insertions(+)

Applied. Thanks.

Johan

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-03-21 15:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-21 15:06 [PATCH] device: Fix sending unneeded property change signals Szymon Janc
2014-03-21 15:58 ` Johan Hedberg

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.