drm: Make drm_clflush_virt_range() void*
Subsystems (2)
PATCH 1/1 drm: Make drm_clflush_virt_range() void*
From: Ville Syrjälä <[email protected]>
Currently drm_cflush_virt_rage() takes a char* so the caller probably has to do pointless casting to avoid compiler warnings. Make the argument void* instead to avoid such issues.
--- drivers/gpu/drm/drm_cache.c | 3 ++- include/drm/drmP.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/drm_cache.c +2 -1
@@ -125,10 +125,11 @@ drm_clflush_sg(struct sg_table *st)EXPORT_SYMBOL (drm_clflush_sg);void -drm_clflush_virt_range (char *addr,unsigned long length) +drm_clflush_virt_range (void *virt,unsigned long length) {#if defined(CONFIG_X86 )if (cpu_has_clflush) { +char *addr = virt;char *end = addr + length;mb ();for (; addr < end; addr += boot_cpu_data.x86_clflush_size)
include/drm/drmP.h +1 -1
@@ -1294,7 +1294,7 @@ extern int drm_remove_magic(struct drm_master *master, drm_magic_t magic);/* Cache management (drm_cache.c) */ void drm_clflush_pages (struct page *pages[],unsigned long num_pages);void drm_clflush_sg (struct sg_table *st); -void drm_clflush_virt_range (char *addr,unsigned long length); +void drm_clflush_virt_range (void *virt,unsigned long length);/* Locking IOCTL support (drm_lock.h) */ extern int drm_lock(struct drm_device *dev, void *data,
Signature · 6 lines
1.8.3.2 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 7 lines · On Mon, Mar 31, 2014 at 06:08:51PM +0300, [email protected] wrote:
From: Ville Syrjälä <[email protected]>
Currently
drm_cflush_virt_rage()takes a char* so the caller probably has to do pointless casting to avoid compiler warnings. Make the argument void* instead to avoid such issues.Signed-off-by Ville Syrjälä <[email protected]>
Can we not use a gcc'ism to allow pointer arithmetic on void *? -Chris
Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre
Quoted 10 lines · Chris Wilson
Quoted 7 lines · On Mon, Mar 31, 2014 at 06:08:51PM +0300, [email protected] wrote:
From: Ville Syrjälä <[email protected]>
Currently
drm_cflush_virt_rage()takes a char* so the caller probably has to do pointless casting to avoid compiler warnings. Make the argument void* instead to avoid such issues.Signed-off-by Ville Syrjälä <[email protected]>Can we not use a gcc'ism to allow pointer arithmetic on void *?
Personally I'd be fine with that. So if no one disagrees I can send a v2.
Signature · 2 lines
Ville Syrjälä Intel OTC
PATCH v2 1/1 drm: Make drm_clflush_virt_range() void*
In reply to Chris WilsonFrom: Ville Syrjälä <[email protected]>
Currently drm_cflush_virt_rage() takes a char* so the caller probably has to do pointless casting to avoid compiler warnings. Make the argument void* instead to avoid such issues.
v2: Use void* arithmetic (Chris)
--- drivers/gpu/drm/drm_cache.c | 4 ++-- include/drm/drmP.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/drm_cache.c +2 -2
@@ -125,11 +125,11 @@ drm_clflush_sg(struct sg_table *st)EXPORT_SYMBOL (drm_clflush_sg);void -drm_clflush_virt_range (char *addr,unsigned long length) +drm_clflush_virt_range (void *addr,unsigned long length) {#if defined(CONFIG_X86 )if (cpu_has_clflush) { -char *end = addr + length; +void *end = addr + length;mb ();for (; addr < end; addr += boot_cpu_data.x86_clflush_size)clflush (addr);
include/drm/drmP.h +1 -1
@@ -1294,7 +1294,7 @@ extern int drm_remove_magic(struct drm_master *master, drm_magic_t magic);/* Cache management (drm_cache.c) */ void drm_clflush_pages (struct page *pages[],unsigned long num_pages);void drm_clflush_sg (struct sg_table *st); -void drm_clflush_virt_range (char *addr,unsigned long length); +void drm_clflush_virt_range (void *addr,unsigned long length);/* Locking IOCTL support (drm_lock.h) */ extern int drm_lock(struct drm_device *dev, void *data,
Signature · 6 lines
1.8.3.2 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 9 lines · On Tue, Apr 01, 2014 at 12:59:08PM +0300, [email protected] wrote:
From: Ville Syrjälä <[email protected]>
Currently
drm_cflush_virt_rage()takes a char* so the caller probably has to do pointless casting to avoid compiler warnings. Make the argument void* instead to avoid such issues.v2: Use void* arithmetic (Chris)
Signed-off-by Ville Syrjälä <[email protected]>
-Chris
Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre
Daniel Vetter
AppliedQuoted 11 lines · Chris Wilson
Quoted 9 lines · On Tue, Apr 01, 2014 at 12:59:08PM +0300, [email protected] wrote:
From: Ville Syrjälä <[email protected]>
Currently
drm_cflush_virt_rage()takes a char* so the caller probably has to do pointless casting to avoid compiler warnings. Make the argument void* instead to avoid such issues.v2: Use void* arithmetic (Chris)
Signed-off-by Ville Syrjälä <[email protected]>Reviewed-by Chris Wilson <[email protected]>
Queued for -next with Dave's irc ack, thanks for the patch. -Daniel
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch