From owner-svn-src-all@freebsd.org Tue May 10 11:31:02 2016 Return-Path: Delivered-To: svn-src-all@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 489D7B35A39; Tue, 10 May 2016 11:31:02 +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 E9D301F73; Tue, 10 May 2016 11:31:01 +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 u4ABV1xI095151; Tue, 10 May 2016 11:31:01 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4ABV1xS095150; Tue, 10 May 2016 11:31:01 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201605101131.u4ABV1xS095150@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:31:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299360 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 May 2016 11:31:02 -0000 Author: hselasky Date: Tue May 10 11:31:00 2016 New Revision: 299360 URL: https://svnweb.freebsd.org/changeset/base/299360 Log: Allow the argument for the cpu_to_xxxp() and xxx_to_cpup() macros to point to a constant. Obtained from: kmacy @ 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:18:53 2016 (r299359) +++ head/sys/compat/linuxkpi/common/include/asm/byteorder.h Tue May 10 11:31:00 2016 (r299360) @@ -55,18 +55,18 @@ #define be16_to_cpu be16toh #define __be16_to_cpu be16toh -#define cpu_to_le64p(x) htole64(*((uint64_t *)x)) -#define le64_to_cpup(x) le64toh(*((uint64_t *)x)) -#define cpu_to_le32p(x) htole32(*((uint32_t *)x)) -#define le32_to_cpup(x) le32toh(*((uint32_t *)x)) -#define cpu_to_le16p(x) htole16(*((uint16_t *)x)) -#define le16_to_cpup(x) le16toh(*((uint16_t *)x)) -#define cpu_to_be64p(x) htobe64(*((uint64_t *)x)) -#define be64_to_cpup(x) be64toh(*((uint64_t *)x)) -#define cpu_to_be32p(x) htobe32(*((uint32_t *)x)) -#define be32_to_cpup(x) be32toh(*((uint32_t *)x)) -#define cpu_to_be16p(x) htobe16(*((uint16_t *)x)) -#define be16_to_cpup(x) be16toh(*((uint16_t *)x)) +#define cpu_to_le64p(x) htole64(*((const uint64_t *)(x))) +#define le64_to_cpup(x) le64toh(*((const uint64_t *)(x))) +#define cpu_to_le32p(x) htole32(*((const uint32_t *)(x))) +#define le32_to_cpup(x) le32toh(*((const uint32_t *)(x))) +#define cpu_to_le16p(x) htole16(*((const uint16_t *)(x))) +#define le16_to_cpup(x) le16toh(*((const uint16_t *)(x))) +#define cpu_to_be64p(x) htobe64(*((const uint64_t *)(x))) +#define be64_to_cpup(x) be64toh(*((const uint64_t *)(x))) +#define cpu_to_be32p(x) htobe32(*((const uint32_t *)(x))) +#define be32_to_cpup(x) be32toh(*((const uint32_t *)(x))) +#define cpu_to_be16p(x) htobe16(*((const uint16_t *)(x))) +#define be16_to_cpup(x) be16toh(*((const uint16_t *)(x))) #define cpu_to_le64s(x) do { *((uint64_t *)x) = cpu_to_le64p((x)) } while (0) #define le64_to_cpus(x) do { *((uint64_t *)x) = le64_to_cpup((x)) } while (0)