Source-Changes-HG archive

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

[src/trunk]: src/sys/external/bsd/drm2/dist/drm cast to avoid void* arithmetic



details:   https://anonhg.NetBSD.org/src/rev/baa0d33d9a13
branches:  trunk
changeset: 1028159:baa0d33d9a13
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Dec 19 09:43:05 2021 +0000

description:
cast to avoid void* arithmetic


Author: Maya Rashish <maya%NetBSD.org@localhost>

diffstat:

 sys/external/bsd/drm2/dist/drm/drm_color_mgmt.c |  12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diffs (50 lines):

diff -r ee10029de640 -r baa0d33d9a13 sys/external/bsd/drm2/dist/drm/drm_color_mgmt.c
--- a/sys/external/bsd/drm2/dist/drm/drm_color_mgmt.c   Sun Dec 19 09:42:27 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/drm_color_mgmt.c   Sun Dec 19 09:43:05 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: drm_color_mgmt.c,v 1.2 2021/12/18 23:44:57 riastradh Exp $     */
+/*     $NetBSD: drm_color_mgmt.c,v 1.3 2021/12/19 09:43:05 riastradh Exp $     */
 
 /*
  * Copyright (c) 2016 Intel Corporation
@@ -23,7 +23,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: drm_color_mgmt.c,v 1.2 2021/12/18 23:44:57 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: drm_color_mgmt.c,v 1.3 2021/12/19 09:43:05 riastradh Exp $");
 
 #include <linux/uaccess.h>
 
@@ -283,13 +283,13 @@
                goto out;
        }
 
-       g_base = r_base + size;
+       g_base = (char *)r_base + size;
        if (copy_from_user(g_base, (void __user *)(unsigned long)crtc_lut->green, size)) {
                ret = -EFAULT;
                goto out;
        }
 
-       b_base = g_base + size;
+       b_base = (char *)g_base + size;
        if (copy_from_user(b_base, (void __user *)(unsigned long)crtc_lut->blue, size)) {
                ret = -EFAULT;
                goto out;
@@ -347,13 +347,13 @@
                goto out;
        }
 
-       g_base = r_base + size;
+       g_base = (char *)r_base + size;
        if (copy_to_user((void __user *)(unsigned long)crtc_lut->green, g_base, size)) {
                ret = -EFAULT;
                goto out;
        }
 
-       b_base = g_base + size;
+       b_base = (char *)g_base + size;
        if (copy_to_user((void __user *)(unsigned long)crtc_lut->blue, b_base, size)) {
                ret = -EFAULT;
                goto out;



Home | Main Index | Thread Index | Old Index