Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/riastradh-drm2]: src/sys/external/bsd/drm2/dist/drm Unconditionally avoi...



details:   https://anonhg.NetBSD.org/src/rev/5b37a31a9f61
branches:  riastradh-drm2
changeset: 788549:5b37a31a9f61
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Sep 08 16:09:35 2013 +0000

description:
Unconditionally avoid arithmetic on void * in drm_buffer.c.

diffstat:

 sys/external/bsd/drm2/dist/drm/drm_buffer.c |  11 +----------
 1 files changed, 1 insertions(+), 10 deletions(-)

diffs (30 lines):

diff -r 94aae3f176ed -r 5b37a31a9f61 sys/external/bsd/drm2/dist/drm/drm_buffer.c
--- a/sys/external/bsd/drm2/dist/drm/drm_buffer.c       Sun Sep 08 16:08:38 2013 +0000
+++ b/sys/external/bsd/drm2/dist/drm/drm_buffer.c       Sun Sep 08 16:09:35 2013 +0000
@@ -115,11 +115,7 @@
        for (idx = 0; idx < nr_pages; ++idx) {
 
                if (DRM_COPY_FROM_USER(buf->data[idx],
-#ifdef __NetBSD__
-                       /* Pointer arithmetic on void * is not kosher...  */
-                       (const char *)
-#endif
-                       user_data + idx * PAGE_SIZE,
+                       (const char *)user_data + idx * PAGE_SIZE,
                        min(PAGE_SIZE, size - idx * PAGE_SIZE))) {
                        DRM_ERROR("Failed to copy user data (%p) to drm buffer"
                                        " (%p) %dth page.\n",
@@ -178,13 +174,8 @@
 
                memcpy(stack_obj, &buf->data[page][idx], beginsz);
 
-#ifdef __NetBSD__
                memcpy((char *)stack_obj + beginsz, &buf->data[page + 1][0],
                                objsize - beginsz);
-#else
-               memcpy(stack_obj + beginsz, &buf->data[page + 1][0],
-                               objsize - beginsz);
-#endif
 
                obj = stack_obj;
        }



Home | Main Index | Thread Index | Old Index