diff mbox

[i-g-t,1/7] Fix uninitialised variable warnings

Message ID 1413478193-7970-2-git-send-email-thomas.wood@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Thomas Wood Oct. 16, 2014, 4:49 p.m. UTC
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
---
 benchmarks/gem_userptr_benchmark.c |  4 ++--
 tests/gem_ppgtt.c                  |  6 +++---
 tests/gem_userptr_blits.c          | 16 ++++++++--------
 tools/intel_reg_dumper.c           |  8 ++++----
 4 files changed, 17 insertions(+), 17 deletions(-)

Comments

Chris Wilson Oct. 16, 2014, 7:56 p.m. UTC | #1
On Thu, Oct 16, 2014 at 05:49:47PM +0100, Thomas Wood wrote:
> Signed-off-by: Thomas Wood <thomas.wood@intel.com>

Is something wrong with your compiler? ;)
-Chris
diff mbox

Patch

diff --git a/benchmarks/gem_userptr_benchmark.c b/benchmarks/gem_userptr_benchmark.c
index 4d7442b..148bcd3 100644
--- a/benchmarks/gem_userptr_benchmark.c
+++ b/benchmarks/gem_userptr_benchmark.c
@@ -137,7 +137,7 @@  static void free_handle_ptr(uint32_t handle)
 
 static uint32_t create_userptr_bo(int fd, int size)
 {
-	void *ptr;
+	void *ptr = NULL;
 	uint32_t handle;
 	int ret;
 
@@ -160,7 +160,7 @@  static void free_userptr_bo(int fd, uint32_t handle)
 static int has_userptr(int fd)
 {
 	uint32_t handle = 0;
-	void *ptr;
+	void *ptr = NULL;
 	uint32_t oldflags;
 	int ret;
 
diff --git a/tests/gem_ppgtt.c b/tests/gem_ppgtt.c
index 0ee4f5b..f0b5a9e 100644
--- a/tests/gem_ppgtt.c
+++ b/tests/gem_ppgtt.c
@@ -85,8 +85,8 @@  static void scratch_buf_fini(struct igt_buf *buf)
 static void fork_rcs_copy(int target, dri_bo **dst, int count, unsigned flags)
 #define CREATE_CONTEXT 0x1
 {
-	igt_render_copyfunc_t render_copy;
-	int devid;
+	igt_render_copyfunc_t render_copy = NULL;
+	int devid = 0;
 
 	for (int child = 0; child < count; child++) {
 		int fd = drm_open_any();
@@ -149,7 +149,7 @@  static void fork_rcs_copy(int target, dri_bo **dst, int count, unsigned flags)
 
 static void fork_bcs_copy(int target, dri_bo **dst, int count)
 {
-	int devid;
+	int devid = 0;
 
 	for (int child = 0; child < count; child++) {
 		drm_intel_bufmgr *bufmgr;
diff --git a/tests/gem_userptr_blits.c b/tests/gem_userptr_blits.c
index a729f31..7b3b26f 100644
--- a/tests/gem_userptr_blits.c
+++ b/tests/gem_userptr_blits.c
@@ -446,7 +446,7 @@  check_gpu(int fd, uint32_t handle, uint32_t val)
 static int has_userptr(int fd)
 {
 	uint32_t handle = 0;
-	void *ptr;
+	void *ptr = NULL;
 	uint32_t oldflags;
 	int ret;
 
@@ -501,7 +501,7 @@  static int test_input_checking(int fd)
 static int test_access_control(int fd)
 {
 	igt_fork(child, 1) {
-		void *ptr;
+		void *ptr = NULL;
 		int ret;
 		uint32_t handle;
 
@@ -636,7 +636,7 @@  static int test_forbidden_ops(int fd)
 {
 	struct drm_i915_gem_pread gem_pread;
 	struct drm_i915_gem_pwrite gem_pwrite;
-	void *ptr;
+	void *ptr = NULL;
 	int ret;
 	uint32_t handle;
 	char buf[PAGE_SIZE];
@@ -807,7 +807,7 @@  static int test_dmabuf(void)
 
 static int test_usage_restrictions(int fd)
 {
-	void *ptr;
+	void *ptr = NULL;
 	int ret;
 	uint32_t handle;
 
@@ -838,7 +838,7 @@  static int test_create_destroy(int fd, int time)
 {
 	struct timespec start, now;
 	uint32_t handle;
-	void *ptr;
+	void *ptr = NULL;
 	int n;
 
 	igt_fork_signal_helper();
@@ -866,7 +866,7 @@  static int test_create_destroy(int fd, int time)
 
 static int test_coherency(int fd, int count)
 {
-	uint32_t *memory;
+	uint32_t *memory = NULL;
 	uint32_t *cpu, *cpu_val;
 	uint32_t *gpu, *gpu_val;
 	uint32_t start = 0;
@@ -1030,7 +1030,7 @@  static void test_major_evictions(int fd, int size, int count)
 
 static void test_overlap(int fd, int expected)
 {
-	char *ptr;
+	char *ptr = NULL;
 	int ret;
 	uint32_t handle, handle2;
 
@@ -1188,7 +1188,7 @@  static void test_stress_mm(int fd)
 	pthread_t t;
 	unsigned int loops = 100000;
 	uint32_t handle;
-	void *ptr;
+	void *ptr = NULL;
 	struct stress_thread_data stdata;
 
 	memset(&stdata, 0, sizeof(stdata));
diff --git a/tools/intel_reg_dumper.c b/tools/intel_reg_dumper.c
index 0b6d887..7ef2023 100644
--- a/tools/intel_reg_dumper.c
+++ b/tools/intel_reg_dumper.c
@@ -147,7 +147,7 @@  DEBUGSTRING(i830_debug_dspcntr)
 DEBUGSTRING(i830_debug_pipeconf)
 {
 	const char *enabled = val & PIPEACONF_ENABLE ? "enabled" : "disabled";
-	const char *bit30, *interlace;
+	const char *bit30, *interlace = NULL;
 
 	if (IS_965(devid))
 		bit30 = val & I965_PIPECONF_ACTIVE ? "active" : "inactive";
@@ -156,7 +156,7 @@  DEBUGSTRING(i830_debug_pipeconf)
 		    val & PIPEACONF_DOUBLE_WIDE ? "double-wide" : "single-wide";
 
 	if (HAS_PCH_SPLIT(devid)) {
-		const char *bpc, *rotation;
+		const char *bpc, *rotation = NULL;
 
 		switch ((val >> 21) & 7) {
 		case 0:
@@ -1833,7 +1833,7 @@  DEBUGSTRING(hsw_debug_sinterrupt)
 DEBUGSTRING(ilk_debug_blc_pwm_cpu_ctl2)
 {
 	int enable, blinking, granularity;
-	const char *pipe;
+	const char *pipe = NULL;
 
 	enable = (val >> 31) & 1;
 
@@ -1920,7 +1920,7 @@  DEBUGSTRING(hsw_debug_blc_misc_ctl)
 DEBUGSTRING(hsw_debug_util_pin_ctl)
 {
 	int enable, data, inverted_polarity;
-	const char *transcoder, *mode;
+	const char *transcoder = NULL, *mode;
 
 	enable = (val >> 31) & 1;