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 3/6] mac802154: fix byteorder issues
Date: Sun,  2 Nov 2014 21:43:03 +0100	[thread overview]
Message-ID: <1414960986-7051-4-git-send-email-alex.aring@gmail.com> (raw)
In-Reply-To: <1414960986-7051-1-git-send-email-alex.aring@gmail.com>

Running make C=2 occurs these warnings:

cast from restricted __be64
incorrect type in argument 1 (different base types)
expected unsigned long long[unsigned] [usertype] val
got restricted __be64 [usertype]<noident>
cast from restricted __be64
cast to restricted __le64

This patch fix these warnings by forcing to __le64 type and using swabp64
instead swab64.

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

diff --git a/include/net/mac802154.h b/include/net/mac802154.h
index c17acbd..8b0c26b 100644
--- a/include/net/mac802154.h
+++ b/include/net/mac802154.h
@@ -215,12 +215,12 @@ struct ieee802154_ops {
 };
 
 /**
- * ieee802154_netdev_to_extended_addr - convert __be64 u8 pointer to __le64
+ * ieee802154_netdev_to_extended_addr - convert big endian 64 byte void pointer to __le64
  * @dev_addr: big endian address pointer like netdevice dev_addr attribute
  */
-static inline __le64 ieee802154_netdev_to_extended_addr(const u8 *dev_addr)
+static inline __le64 ieee802154_netdev_to_extended_addr(const void *dev_addr)
 {
-	return (__le64)swab64(*((__be64 *)dev_addr));
+	return (__force __le64)swab64p(dev_addr);
 }
 
 /* Basic interface to register ieee802154 hwice */
-- 
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 ` [PATCH bluetooth-next 2/6] ieee802154: fix byteorder issues Alexander Aring
2014-11-02 20:43 ` Alexander Aring [this message]
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-4-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