Use function macros when possible to avoid stray substitutions.
MFC after: 1 week Sponsored by: Mellanox Technologies
This commit is contained in:
parent
997f8ff84f
commit
7652bc32f7
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=299363
@ -2,7 +2,7 @@
|
||||
* Copyright (c) 2010 Isilon Systems, Inc.
|
||||
* Copyright (c) 2010 iX Systems, Inc.
|
||||
* Copyright (c) 2010 Panasas, Inc.
|
||||
* Copyright (c) 2013, 2014 Mellanox Technologies, Ltd.
|
||||
* Copyright (c) 2013-2016 Mellanox Technologies, Ltd.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -41,19 +41,19 @@
|
||||
#define __BIG_ENDIAN
|
||||
#endif
|
||||
|
||||
#define cpu_to_le64 htole64
|
||||
#define le64_to_cpu le64toh
|
||||
#define cpu_to_le32 htole32
|
||||
#define le32_to_cpu le32toh
|
||||
#define cpu_to_le16 htole16
|
||||
#define le16_to_cpu le16toh
|
||||
#define cpu_to_be64 htobe64
|
||||
#define be64_to_cpu be64toh
|
||||
#define cpu_to_be32 htobe32
|
||||
#define be32_to_cpu be32toh
|
||||
#define cpu_to_be16 htobe16
|
||||
#define be16_to_cpu be16toh
|
||||
#define __be16_to_cpu be16toh
|
||||
#define cpu_to_le64(x) htole64(x)
|
||||
#define le64_to_cpu(x) le64toh(x)
|
||||
#define cpu_to_le32(x) htole32(x)
|
||||
#define le32_to_cpu(x) le32toh(x)
|
||||
#define cpu_to_le16(x) htole16(x)
|
||||
#define le16_to_cpu(x) le16toh(x)
|
||||
#define cpu_to_be64(x) htobe64(x)
|
||||
#define be64_to_cpu(x) be64toh(x)
|
||||
#define cpu_to_be32(x) htobe32(x)
|
||||
#define be32_to_cpu(x) be32toh(x)
|
||||
#define cpu_to_be16(x) htobe16(x)
|
||||
#define be16_to_cpu(x) be16toh(x)
|
||||
#define __be16_to_cpu(x) be16toh(x)
|
||||
|
||||
#define cpu_to_le64p(x) htole64(*((const uint64_t *)(x)))
|
||||
#define le64_to_cpup(x) le64toh(*((const uint64_t *)(x)))
|
||||
@ -81,9 +81,9 @@
|
||||
#define cpu_to_be16s(x) do { *((uint16_t *)(x)) = cpu_to_be16p((x)); } while (0)
|
||||
#define be16_to_cpus(x) do { *((uint16_t *)(x)) = be16_to_cpup((x)); } while (0)
|
||||
|
||||
#define swab16 bswap16
|
||||
#define swab32 bswap32
|
||||
#define swab64 bswap64
|
||||
#define swab16(x) bswap16(x)
|
||||
#define swab32(x) bswap32(x)
|
||||
#define swab64(x) bswap64(x)
|
||||
|
||||
static inline void
|
||||
be16_add_cpu(uint16_t *var, uint16_t val)
|
||||
|
Loading…
Reference in New Issue
Block a user