Commit 980d92a6 authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] hton* and ntoh* endianness annotations

Signed-off-by: default avatarAl Viro <viro@parcelfarce.linux.org.uk>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 8784a0db
No related merge requests found
...@@ -11,10 +11,10 @@ ...@@ -11,10 +11,10 @@
#include <linux/types.h> #include <linux/types.h>
#include <linux/byteorder/swab.h> #include <linux/byteorder/swab.h>
#define __constant_htonl(x) ((__u32)(x)) #define __constant_htonl(x) ((__force __be32)(__u32)(x))
#define __constant_ntohl(x) ((__u32)(x)) #define __constant_ntohl(x) ((__force __u32)(__be32)(x))
#define __constant_htons(x) ((__u16)(x)) #define __constant_htons(x) ((__force __be16)(__u16)(x))
#define __constant_ntohs(x) ((__u16)(x)) #define __constant_ntohs(x) ((__force __u16)(__be16)(x))
#define __constant_cpu_to_le64(x) ((__force __le64)___constant_swab64((x))) #define __constant_cpu_to_le64(x) ((__force __le64)___constant_swab64((x)))
#define __constant_le64_to_cpu(x) ___constant_swab64((__force __u64)(__le64)(x)) #define __constant_le64_to_cpu(x) ___constant_swab64((__force __u64)(__le64)(x))
#define __constant_cpu_to_le32(x) ((__force __le32)___constant_swab32((x))) #define __constant_cpu_to_le32(x) ((__force __le32)___constant_swab32((x)))
......
...@@ -147,10 +147,10 @@ ...@@ -147,10 +147,10 @@
* Do the prototypes. Somebody might want to take the * Do the prototypes. Somebody might want to take the
* address or some such sick thing.. * address or some such sick thing..
*/ */
extern __u32 ntohl(__u32); extern __u32 ntohl(__be32);
extern __u32 htonl(__u32); extern __be32 htonl(__u32);
extern unsigned short int ntohs(unsigned short int); extern __u16 ntohs(__be16);
extern unsigned short int htons(unsigned short int); extern __be16 htons(__u16);
#if defined(__GNUC__) && (__GNUC__ >= 2) && defined(__OPTIMIZE__) #if defined(__GNUC__) && (__GNUC__ >= 2) && defined(__OPTIMIZE__)
......
...@@ -11,10 +11,10 @@ ...@@ -11,10 +11,10 @@
#include <linux/types.h> #include <linux/types.h>
#include <linux/byteorder/swab.h> #include <linux/byteorder/swab.h>
#define __constant_htonl(x) ___constant_swab32((x)) #define __constant_htonl(x) ((__force __be32)___constant_swab32((x)))
#define __constant_ntohl(x) ___constant_swab32((x)) #define __constant_ntohl(x) ___constant_swab32((__force __be32)(x))
#define __constant_htons(x) ___constant_swab16((x)) #define __constant_htons(x) ((__force __be16)___constant_swab16((x)))
#define __constant_ntohs(x) ___constant_swab16((x)) #define __constant_ntohs(x) ___constant_swab16((__force __be16)(x))
#define __constant_cpu_to_le64(x) ((__force __le64)(__u64)(x)) #define __constant_cpu_to_le64(x) ((__force __le64)(__u64)(x))
#define __constant_le64_to_cpu(x) ((__force __u64)(__le64)(x)) #define __constant_le64_to_cpu(x) ((__force __u64)(__le64)(x))
#define __constant_cpu_to_le32(x) ((__force __le32)(__u32)(x)) #define __constant_cpu_to_le32(x) ((__force __le32)(__u32)(x))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment