All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm: Make drm_clflush_virt_range() void*
@ 2014-03-31 15:08 ville.syrjala
  2014-03-31 15:40 ` Chris Wilson
  0 siblings, 1 reply; 6+ messages in thread
From: ville.syrjala @ 2014-03-31 15:08 UTC (permalink / raw)
  To: dri-devel

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(-)

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,
-- 
1.8.3.2

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] drm: Make drm_clflush_virt_range() void*
  2014-03-31 15:08 [PATCH] drm: Make drm_clflush_virt_range() void* ville.syrjala
@ 2014-03-31 15:40 ` Chris Wilson
  2014-03-31 16:28   ` Ville Syrjälä
  2014-04-01  9:59   ` [PATCH v2] " ville.syrjala
  0 siblings, 2 replies; 6+ messages in thread
From: Chris Wilson @ 2014-03-31 15:40 UTC (permalink / raw)
  To: ville.syrjala; +Cc: dri-devel

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

-- 
Chris Wilson, Intel Open Source Technology Centre

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] drm: Make drm_clflush_virt_range() void*
  2014-03-31 15:40 ` Chris Wilson
@ 2014-03-31 16:28   ` Ville Syrjälä
  2014-04-01  9:59   ` [PATCH v2] " ville.syrjala
  1 sibling, 0 replies; 6+ messages in thread
From: Ville Syrjälä @ 2014-03-31 16:28 UTC (permalink / raw)
  To: Chris Wilson, dri-devel

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.

-- 
Ville Syrjälä
Intel OTC

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v2] drm: Make drm_clflush_virt_range() void*
  2014-03-31 15:40 ` Chris Wilson
  2014-03-31 16:28   ` Ville Syrjälä
@ 2014-04-01  9:59   ` ville.syrjala
  2014-04-01 10:08     ` Chris Wilson
  1 sibling, 1 reply; 6+ messages in thread
From: ville.syrjala @ 2014-04-01  9:59 UTC (permalink / raw)
  To: dri-devel

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.

v2: Use void* arithmetic (Chris)

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/drm_cache.c | 4 ++--
 include/drm/drmP.h          | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/drm_cache.c b/drivers/gpu/drm/drm_cache.c
index bb8f580..4bfad5f 100644
--- a/drivers/gpu/drm/drm_cache.c
+++ b/drivers/gpu/drm/drm_cache.c
@@ -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);
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index 2f49510..9c10952 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 *addr, unsigned long length);
 
 				/* Locking IOCTL support (drm_lock.h) */
 extern int drm_lock(struct drm_device *dev, void *data,
-- 
1.8.3.2

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] drm: Make drm_clflush_virt_range() void*
  2014-04-01  9:59   ` [PATCH v2] " ville.syrjala
@ 2014-04-01 10:08     ` Chris Wilson
  2014-04-01 10:57       ` Daniel Vetter
  0 siblings, 1 reply; 6+ messages in thread
From: Chris Wilson @ 2014-04-01 10:08 UTC (permalink / raw)
  To: ville.syrjala; +Cc: dri-devel

On Tue, Apr 01, 2014 at 12:59:08PM +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.
> 
> v2: Use void* arithmetic (Chris)
> 
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] drm: Make drm_clflush_virt_range() void*
  2014-04-01 10:08     ` Chris Wilson
@ 2014-04-01 10:57       ` Daniel Vetter
  0 siblings, 0 replies; 6+ messages in thread
From: Daniel Vetter @ 2014-04-01 10:57 UTC (permalink / raw)
  To: Chris Wilson, ville.syrjala, dri-devel

On Tue, Apr 01, 2014 at 11:08:59AM +0100, Chris Wilson wrote:
> On Tue, Apr 01, 2014 at 12:59:08PM +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.
> > 
> > v2: Use void* arithmetic (Chris)
> > 
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>

Queued for -next with Dave's irc ack, thanks for the patch.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-04-01 10:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-31 15:08 [PATCH] drm: Make drm_clflush_virt_range() void* ville.syrjala
2014-03-31 15:40 ` Chris Wilson
2014-03-31 16:28   ` Ville Syrjälä
2014-04-01  9:59   ` [PATCH v2] " ville.syrjala
2014-04-01 10:08     ` Chris Wilson
2014-04-01 10:57       ` Daniel Vetter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.