From: Marcin Slusarz <marcin.slusarz@gmail.com>
To: dri-devel@lists.freedesktop.org
Subject: [PATCH] drm mode: fix drmIoctl wrapper
Date: Sun, 5 Jun 2011 19:28:20 +0200 [thread overview]
Message-ID: <20110605172820.GA26695@joi.lan> (raw)
Both drmIoctl and ioctl define second argument as unigned long, but
DRM_IOCTL do not.
Debugging/tracing tools (like strace or valgrind) on 64-bit machines see
different request value for ioctls with 32nd bit set, because casting
signed int to unsigned long extends 32nd bit to upper word, so 0x80000000
becomes 0xFFFFFFFF80000000)
Nobody noticed because higher 32 bits are chopped off on their way to kernel.
---
xf86drmMode.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/xf86drmMode.c b/xf86drmMode.c
index 0d268fc..f08e648 100644
--- a/xf86drmMode.c
+++ b/xf86drmMode.c
@@ -52,7 +52,7 @@
#define U642VOID(x) ((void *)(unsigned long)(x))
#define VOID2U64(x) ((uint64_t)(unsigned long)(x))
-static inline DRM_IOCTL(int fd, int cmd, void *arg)
+static inline int DRM_IOCTL(int fd, unsigned long cmd, void *arg)
{
int ret = drmIoctl(fd, cmd, arg);
return ret < 0 ? -errno : ret;
--
1.7.4.1
next reply other threads:[~2011-06-05 17:28 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-05 17:28 Marcin Slusarz [this message]
2011-06-19 21:58 ` [PATCH] drm mode: fix drmIoctl wrapper Marcin Slusarz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110605172820.GA26695@joi.lan \
--to=marcin.slusarz@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox