summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/linux/sctp.h2
-rw-r--r--include/net/sctp/checksum.h14
2 files changed, 8 insertions, 8 deletions
diff --git a/include/linux/sctp.h b/include/linux/sctp.h
index bd50b371ffa..c2731bfe04d 100644
--- a/include/linux/sctp.h
+++ b/include/linux/sctp.h
@@ -60,7 +60,7 @@ typedef struct sctphdr {
__be16 source;
__be16 dest;
__be32 vtag;
- __be32 checksum;
+ __le32 checksum;
} __attribute__((packed)) sctp_sctphdr_t;
#ifdef __KERNEL__
diff --git a/include/net/sctp/checksum.h b/include/net/sctp/checksum.h
index 2fec3c366e8..befc8d2a1b9 100644
--- a/include/net/sctp/checksum.h
+++ b/include/net/sctp/checksum.h
@@ -46,14 +46,14 @@
#include <net/sctp/sctp.h>
#include <linux/crc32c.h>
-static inline __be32 sctp_crc32c(__be32 crc, u8 *buffer, u16 length)
+static inline __u32 sctp_crc32c(__u32 crc, u8 *buffer, u16 length)
{
- return (__force __be32)crc32c((__force u32)crc, buffer, length);
+ return crc32c(crc, buffer, length);
}
-static inline __be32 sctp_start_cksum(__u8 *buffer, __u16 length)
+static inline __u32 sctp_start_cksum(__u8 *buffer, __u16 length)
{
- __be32 crc = ~cpu_to_be32(0);
+ __u32 crc = ~(__u32)0;
__u8 zero[sizeof(__u32)] = {0};
/* Optimize this routine to be SCTP specific, knowing how
@@ -72,12 +72,12 @@ static inline __be32 sctp_start_cksum(__u8 *buffer, __u16 length)
return crc;
}
-static inline __be32 sctp_update_cksum(__u8 *buffer, __u16 length, __be32 crc32)
+static inline __u32 sctp_update_cksum(__u8 *buffer, __u16 length, __u32 crc32)
{
return sctp_crc32c(crc32, buffer, length);
}
-static inline __be32 sctp_end_cksum(__be32 crc32)
+static inline __le32 sctp_end_cksum(__be32 crc32)
{
- return (__force __be32)~cpu_to_le32((__force u32)crc32);
+ return cpu_to_le32(~crc32);
}