lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <153622550941.14298.18224012706200881807.stgit@warthog.procyon.org.uk>
Date:   Thu, 06 Sep 2018 10:18:29 +0100
From:   David Howells <dhowells@...hat.com>
To:     linux-api@...r.kernel.org, linux-kbuild@...r.kernel.org
Cc:     Rob Clark <robdclark@...il.com>, David Airlie <airlied@...ux.ie>,
        linux-arm-msm@...r.kernel.org, dri-devel@...ts.freedesktop.org,
        freedreno@...ts.freedesktop.org, linux-kernel@...r.kernel.org,
        dhowells@...hat.com
Subject: [PATCH 01/11] UAPI: drm: Fix use of C++ keywords as structural
 members [ver #2]

The i810 and msm drm drivers use C++ keywords as structural members.  Fix
this by inserting an anonymous union that provides an alternative name and
then hide the reserved name in C++.

Signed-off-by: David Howells <dhowells@...hat.com>
cc: Rob Clark <robdclark@...il.com>
cc: David Airlie <airlied@...ux.ie>
cc: linux-arm-msm@...r.kernel.org
cc: dri-devel@...ts.freedesktop.org
cc: freedreno@...ts.freedesktop.org
---

 include/uapi/drm/i810_drm.h |    7 ++++++-
 include/uapi/drm/msm_drm.h  |    7 ++++++-
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/include/uapi/drm/i810_drm.h b/include/uapi/drm/i810_drm.h
index d285d5e72e6a..617d79ec3fc5 100644
--- a/include/uapi/drm/i810_drm.h
+++ b/include/uapi/drm/i810_drm.h
@@ -266,7 +266,12 @@ typedef struct _drm_i810_copy_t {
 #define PR_MASK              (0x7<<18)
 
 typedef struct drm_i810_dma {
-	void *virtual;
+	union {
+#ifndef __cplusplus
+		void *virtual;
+#endif
+		void *_virtual;
+	};
 	int request_idx;
 	int request_size;
 	int granted;
diff --git a/include/uapi/drm/msm_drm.h b/include/uapi/drm/msm_drm.h
index c06d0a5bdd80..e99bab72d58c 100644
--- a/include/uapi/drm/msm_drm.h
+++ b/include/uapi/drm/msm_drm.h
@@ -148,7 +148,12 @@ struct drm_msm_gem_cpu_fini {
  */
 struct drm_msm_gem_submit_reloc {
 	__u32 submit_offset;  /* in, offset from submit_bo */
-	__u32 or;             /* in, value OR'd with result */
+	union {
+#ifndef __cplusplus
+		__u32 or;	/* in, value OR'd with result */
+#endif
+		__u32 _or;	/* in, value OR'd with result */
+	};
 	__s32 shift;          /* in, amount of left shift (can be negative) */
 	__u32 reloc_idx;      /* in, index of reloc_bo buffer */
 	__u64 reloc_offset;   /* in, offset from start of reloc_bo */

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ