Linux IEEE 802.15.4 and 6LoWPAN development
 help / color / mirror / Atom feed
From: Alexander Aring <alex.aring@gmail.com>
To: linux-wpan@vger.kernel.org
Cc: kernel@pengutronix.de, Alexander Aring <alex.aring@gmail.com>
Subject: [PATCH bluetooth-next 2/6] ieee802154: fix byteorder issues
Date: Sun,  2 Nov 2014 21:43:02 +0100	[thread overview]
Message-ID: <1414960986-7051-3-git-send-email-alex.aring@gmail.com> (raw)
In-Reply-To: <1414960986-7051-1-git-send-email-alex.aring@gmail.com>

This patch fix byteorder issues which occurs because we compare __le64
with an host byteorder value. Simple add a cpu_to_le64 to convert the
host byteorder values to __le64.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Reported-by: Marcel Holtmann <marcel@holtmann.org>
---
 include/linux/ieee802154.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/include/linux/ieee802154.h b/include/linux/ieee802154.h
index 9da7c01..5d9e745 100644
--- a/include/linux/ieee802154.h
+++ b/include/linux/ieee802154.h
@@ -24,6 +24,7 @@
 #define LINUX_IEEE802154_H
 
 #include <linux/types.h>
+#include <asm/byteorder.h>
 
 #define IEEE802154_MTU			127
 #define IEEE802154_MIN_PSDU_LEN		5
@@ -208,8 +209,8 @@ static inline bool ieee802154_is_valid_extended_addr(const __le64 addr)
 	 * This is currently a workaround because neighbor discovery can't
 	 * deal with short addresses types right now.
 	 */
-	return ((addr != 0x0000000000000000ULL) ||
-		(addr != 0xffffffffffffffffULL));
+	return ((addr != cpu_to_le64(0x0000000000000000ULL)) ||
+		(addr != cpu_to_le64(0xffffffffffffffffULL)));
 }
 
 #endif /* LINUX_IEEE802154_H */
-- 
2.1.3


  parent reply	other threads:[~2014-11-02 20:43 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-02 20:43 [PATCH bluetooth-next 0/6] ieee802154: solve make C=2 warnings Alexander Aring
2014-11-02 20:43 ` [PATCH bluetooth-next 1/6] ieee802154: add missing ULL definition Alexander Aring
2014-11-02 20:43 ` Alexander Aring [this message]
2014-11-02 20:43 ` [PATCH bluetooth-next 3/6] mac802154: fix byteorder issues Alexander Aring
2014-11-02 20:43 ` [PATCH bluetooth-next 4/6] ieee802154: sysfs: add missing include Alexander Aring
2014-11-02 20:43 ` [PATCH bluetooth-next 5/6] mac802154: cfg: " Alexander Aring
2014-11-02 20:43 ` [PATCH bluetooth-next 6/6] ieee802154: remove unnecessary functions Alexander Aring
2014-11-02 20:52 ` [PATCH bluetooth-next 0/6] ieee802154: solve make C=2 warnings Marcel Holtmann

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=1414960986-7051-3-git-send-email-alex.aring@gmail.com \
    --to=alex.aring@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-wpan@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox