Module Name:    src
Committed By:   riastradh
Date:           Sun Dec 19 09:43:05 UTC 2021

Modified Files:
        src/sys/external/bsd/drm2/dist/drm: drm_color_mgmt.c

Log Message:
cast to avoid void* arithmetic

Author: Maya Rashish <m...@netbsd.org>


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/external/bsd/drm2/dist/drm/drm_color_mgmt.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/drm_color_mgmt.c
diff -u src/sys/external/bsd/drm2/dist/drm/drm_color_mgmt.c:1.2 src/sys/external/bsd/drm2/dist/drm/drm_color_mgmt.c:1.3
--- src/sys/external/bsd/drm2/dist/drm/drm_color_mgmt.c:1.2	Sat Dec 18 23:44:57 2021
+++ src/sys/external/bsd/drm2/dist/drm/drm_color_mgmt.c	Sun Dec 19 09:43:05 2021
@@ -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 @@ int drm_mode_gamma_set_ioctl(struct drm_
 		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 @@ int drm_mode_gamma_get_ioctl(struct drm_
 		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;

Reply via email to