All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mika Kuoppala <mika.kuoppala@linux.intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: Vinay Belgaumkar <vinay.belgaumkar@intel.com>
Subject: [PATCH i-g-t] tests/gem_softpin: Fix compiler warning on 32bit systems
Date: Thu, 10 Dec 2015 16:58:25 +0200	[thread overview]
Message-ID: <1449759505-19527-1-git-send-email-mika.kuoppala@intel.com> (raw)

We get build error as we try to cast from ptr to integer
of different size on 32 bit platforms. Use unsigned long
as the cast, it will work with both 32 and 64 bit
systems.

Cc: Vinay Belgaumkar <vinay.belgaumkar@intel.com>
Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
---
 tests/gem_softpin.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tests/gem_softpin.c b/tests/gem_softpin.c
index 7bee16b..0919716 100644
--- a/tests/gem_softpin.c
+++ b/tests/gem_softpin.c
@@ -155,7 +155,7 @@ static uint32_t init_userptr(int fd, i915_gem_userptr *userptr, void *ptr,
 
 	memset((void*)userptr, 0, sizeof(i915_gem_userptr));
 
-	userptr->user_ptr = (uint64_t)ptr; /* Need the cast to overcome compiler warning */
+	userptr->user_ptr = (unsigned long)ptr; /* Need the cast to overcome compiler warning */
 	userptr->user_size = size;
 	userptr->flags = 0; /* use synchronized operation */
 
@@ -270,7 +270,7 @@ static void setup_execbuffer(struct drm_i915_gem_execbuffer2 *execbuf,
 			     struct drm_i915_gem_exec_object2 *exec_object,
 			     int ring, int buffer_count, int batch_length)
 {
-	execbuf->buffers_ptr = (uint64_t)exec_object;
+	execbuf->buffers_ptr = (unsigned long)exec_object;
 	execbuf->buffer_count = buffer_count;
 	execbuf->batch_start_offset = 0;
 	execbuf->batch_len = batch_length;
@@ -417,7 +417,7 @@ static void gem_pin_bo_test(void)
 		       EXEC_OBJECT_PINNED, pinning_offset);
 	setup_exec_obj(&exec_object2[1], batch_buf_handle, 0, 0);
 	exec_object2[1].relocation_count = 1;
-	exec_object2[1].relocs_ptr = (uint64_t)reloc;
+	exec_object2[1].relocs_ptr = (unsigned long)reloc;
 
 	ring = I915_EXEC_RENDER;
 
-- 
2.5.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

             reply	other threads:[~2015-12-10 14:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-10 14:58 Mika Kuoppala [this message]
2015-12-10 16:43 ` [PATCH i-g-t] tests/gem_softpin: Fix compiler warning on 32bit systems Tvrtko Ursulin
2015-12-10 17:45   ` Dave Gordon
2015-12-11 23:53   ` Belgaumkar, Vinay

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1449759505-19527-1-git-send-email-mika.kuoppala@intel.com \
    --to=mika.kuoppala@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=vinay.belgaumkar@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.