All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Wood <thomas.wood@intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH i-g-t 2/2] null_state_gen: add const to intel_batch_state_copy data
Date: Tue,  8 Sep 2015 18:13:04 +0100	[thread overview]
Message-ID: <1441732384-11633-2-git-send-email-thomas.wood@intel.com> (raw)
In-Reply-To: <1441732384-11633-1-git-send-email-thomas.wood@intel.com>

The data is not modified by the function and is often declared const.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
---
 tools/null_state_gen/intel_batchbuffer.c | 6 +++---
 tools/null_state_gen/intel_batchbuffer.h | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/tools/null_state_gen/intel_batchbuffer.c b/tools/null_state_gen/intel_batchbuffer.c
index 5aa980e..2ead22e 100644
--- a/tools/null_state_gen/intel_batchbuffer.c
+++ b/tools/null_state_gen/intel_batchbuffer.c
@@ -202,7 +202,7 @@ uint32_t intel_batch_state_alloc(struct intel_batchbuffer *batch, unsigned bytes
 }
 
 uint32_t intel_batch_state_copy(struct intel_batchbuffer *batch,
-				void *d, unsigned bytes,
+				const void *d, unsigned bytes,
 				unsigned align,
 				const char *str)
 {
@@ -217,10 +217,10 @@ uint32_t intel_batch_state_copy(struct intel_batchbuffer *batch,
 
 	for (i = 0; i < dwords; i++) {
 		char offsetinside[80];
-		uint32_t *s;
+		const uint32_t *s;
 		sprintf(offsetinside, "%s: 0x%x", str, i * 4);
 
-		s = (uint32_t *)(uint8_t *)d + i;
+		s = (const uint32_t *)(const uint8_t *)d + i;
 		bb_area_emit(batch->state, *s, STATE, offsetinside);
 	}
 
diff --git a/tools/null_state_gen/intel_batchbuffer.h b/tools/null_state_gen/intel_batchbuffer.h
index 2919e87..771d1c8 100644
--- a/tools/null_state_gen/intel_batchbuffer.h
+++ b/tools/null_state_gen/intel_batchbuffer.h
@@ -80,7 +80,7 @@ struct intel_batchbuffer *intel_batchbuffer_create(void);
 #define OUT_STATE_OFFSET(offset) bb_area_emit(batch->state, offset, STATE_OFFSET, #offset)
 #define OUT_STATE_STRUCT(name, align) intel_batch_state_copy(batch, &name, sizeof(name), align, #name " " #align)
 
-uint32_t intel_batch_state_copy(struct intel_batchbuffer *batch, void *d, unsigned bytes, unsigned align,
+uint32_t intel_batch_state_copy(struct intel_batchbuffer *batch, const void *d, unsigned bytes, unsigned align,
 				const char *name);
 uint32_t intel_batch_state_alloc(struct intel_batchbuffer *batch, unsigned bytes, unsigned align,
 				 const char *name);
-- 
1.9.1

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

      reply	other threads:[~2015-09-08 17:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-08 17:13 [PATCH i-g-t 1/2] tools/aubdump: remove void pointer arithmetic Thomas Wood
2015-09-08 17:13 ` Thomas Wood [this message]

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=1441732384-11633-2-git-send-email-thomas.wood@intel.com \
    --to=thomas.wood@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /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.