All of lore.kernel.org
 help / color / mirror / Atom feed
From: Santiago Carot-Nemesio <sancane@gmail.com>
To: linux-bluetooth@vger.kernel.org
Cc: Santiago Carot-Nemesio <sancane@gmail.com>
Subject: [PATCH] Remove unnecessary casting in thermometer plugin
Date: Mon, 31 Oct 2011 14:16:05 +0100	[thread overview]
Message-ID: <1320066965-27742-1-git-send-email-sancane@gmail.com> (raw)

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


             reply	other threads:[~2011-10-31 13:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-31 13:16 Santiago Carot-Nemesio [this message]
2011-11-01  8:14 ` [PATCH] Remove unnecessary casting in thermometer plugin Johan Hedberg

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=1320066965-27742-1-git-send-email-sancane@gmail.com \
    --to=sancane@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.