From owner-svn-src-head@freebsd.org Tue May 10 11:39:37 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 83040B340BA; Tue, 10 May 2016 11:39:37 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3A1621A83; Tue, 10 May 2016 11:39:37 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4ABdatE098172; Tue, 10 May 2016 11:39:36 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4ABdaTL098171; Tue, 10 May 2016 11:39:36 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201605101139.u4ABdaTL098171@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 10 May 2016 11:39:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299363 - head/sys/compat/linuxkpi/common/include/asm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 May 2016 11:39:37 -0000 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)