diff mbox

drm: Make drm_clflush_virt_range() void*

Message ID 1396278531-27778-1-git-send-email-ville.syrjala@linux.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Ville Syrjälä March 31, 2014, 3:08 p.m. UTC
From: Ville Syrjälä <ville.syrjala@linux.intel.com>

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ä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/drm_cache.c | 3 ++-
 include/drm/drmP.h          | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

Comments

Chris Wilson March 31, 2014, 3:40 p.m. UTC | #1
On Mon, Mar 31, 2014 at 06:08:51PM +0300, ville.syrjala@linux.intel.com wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> 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ä <ville.syrjala@linux.intel.com>

Can we not use a gcc'ism to allow pointer arithmetic on void *?
-Chris
Ville Syrjälä March 31, 2014, 4:28 p.m. UTC | #2
On Mon, Mar 31, 2014 at 04:40:47PM +0100, Chris Wilson wrote:
> On Mon, Mar 31, 2014 at 06:08:51PM +0300, ville.syrjala@linux.intel.com wrote:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > 
> > 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ä <ville.syrjala@linux.intel.com>
> 
> 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.
diff mbox

Patch

diff --git a/drivers/gpu/drm/drm_cache.c b/drivers/gpu/drm/drm_cache.c
index bb8f580..be7046e 100644
--- a/drivers/gpu/drm/drm_cache.c
+++ b/drivers/gpu/drm/drm_cache.c
@@ -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)
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index 2f49510..330e868 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -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,