svn commit: r299363 - head/sys/compat/linuxkpi/common/include/asm

Hans Petter Selasky hselasky at FreeBSD.org
Tue May 10 11:39:37 UTC 2016


Author: hselasky
Date: Tue May 10 11:39:36 2016
New Revision: 299363
URL: https://svnweb.freebsd.org/changeset/base/299363

Log:
  Use function macros when possible to avoid stray substitutions.
  
  MFC after:	1 week
  Sponsored by:	Mellanox Technologies

Modified:
  head/sys/compat/linuxkpi/common/include/asm/byteorder.h

Modified: head/sys/compat/linuxkpi/common/include/asm/byteorder.h
==============================================================================
--- head/sys/compat/linuxkpi/common/include/asm/byteorder.h	Tue May 10 11:35:03 2016	(r299362)
+++ head/sys/compat/linuxkpi/common/include/asm/byteorder.h	Tue May 10 11:39:36 2016	(r299363)
@@ -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)


More information about the svn-src-all mailing list