All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Remove unnecessary casting in thermometer plugin
@ 2011-10-31 13:16 Santiago Carot-Nemesio
  2011-11-01  8:14 ` Johan Hedberg
  0 siblings, 1 reply; 2+ messages in thread
From: Santiago Carot-Nemesio @ 2011-10-31 13:16 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Santiago Carot-Nemesio

---
 thermometer/thermometer.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/thermometer/thermometer.c b/thermometer/thermometer.c
index 0d85102..8f0a5ea 100644
--- a/thermometer/thermometer.c
+++ b/thermometer/thermometer.c
@@ -200,7 +200,7 @@ static void read_interval_cb(guint8 status, const guint8 *pdu, guint16 len,
 {
 	struct characteristic *ch = user_data;
 	uint8_t value[ATT_MAX_MTU];
-	uint16_t *p, interval;
+	uint16_t interval;
 	int vlen;
 
 	if (status != 0) {
@@ -219,9 +219,7 @@ static void read_interval_cb(guint8 status, const guint8 *pdu, guint16 len,
 		return;
 	}
 
-	p = (uint16_t *) value;
-	interval = btohs(bt_get_unaligned(p));
-
+	interval = att_get_u16(&value[0]);
 	change_property(ch->t, "Interval", &interval);
 }
 
-- 
1.7.7.1


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

end of thread, other threads:[~2011-11-01  8:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-31 13:16 [PATCH] Remove unnecessary casting in thermometer plugin Santiago Carot-Nemesio
2011-11-01  8:14 ` 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.