From patchwork Thu Oct 16 16:49:47 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Wood X-Patchwork-Id: 5092631 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id E16A99F40A for ; Thu, 16 Oct 2014 16:50:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0FEED201D3 for ; Thu, 16 Oct 2014 16:50:01 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 201D7201EC for ; Thu, 16 Oct 2014 16:50:00 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7C2DA6E2B2; Thu, 16 Oct 2014 09:49:59 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wg0-f42.google.com (mail-wg0-f42.google.com [74.125.82.42]) by gabe.freedesktop.org (Postfix) with ESMTP id D446F6E2B2 for ; Thu, 16 Oct 2014 09:49:57 -0700 (PDT) Received: by mail-wg0-f42.google.com with SMTP id z12so4167039wgg.25 for ; Thu, 16 Oct 2014 09:49:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=Jkfy4oLkFqCfV0xt8kKQKCMCOZpTn+BZSLY2YKknbw4=; b=X5jSUvHsCJVrjXB0LNPVM80MXc/dOPbYt80ma+SJG84mEh6usWJFnMJIeZA4ZpvtA3 vz91wAu2CUa5jFYlH4AZADY10n7WHrd+SrudthVq67WxvDqZZiGNBWJP2lTAGkxsHnzo pwHHhrCX1ccW9VYEalPz9ALXek1B9+UIfEG/iJhstMTDAeMYtolJafl1w6KJs4qYzSig t95ZxUkb0o8kotWMPz8rSQJyTantDtKMSAQgzymVZo+PT3Ht3dcfv6jCANadt43Agj1N ZA7Ww7IVORoNFzVE793xdvzgHsvCGz2NNH6j4KqlKBDnx25IkgwpXsmrZb0y55Uf3Vzs +9LA== X-Gm-Message-State: ALoCoQkTQ/90Uk+NCKklgrC1+Y2I5QNqDAevCFtQEpfV828stHSoBRrL/8CsSiH/S2D6NCBUyOxc X-Received: by 10.180.77.79 with SMTP id q15mr22113618wiw.8.1413478196741; Thu, 16 Oct 2014 09:49:56 -0700 (PDT) Received: from pistachio.icx.intel.com ([83.217.123.106]) by mx.google.com with ESMTPSA id ic4sm2595840wid.19.2014.10.16.09.49.55 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 16 Oct 2014 09:49:56 -0700 (PDT) From: Thomas Wood To: intel-gfx@lists.freedesktop.org Date: Thu, 16 Oct 2014 17:49:47 +0100 Message-Id: <1413478193-7970-2-git-send-email-thomas.wood@intel.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1413478193-7970-1-git-send-email-thomas.wood@intel.com> References: <1413478193-7970-1-git-send-email-thomas.wood@intel.com> Subject: [Intel-gfx] [PATCH i-g-t 1/7] Fix uninitialised variable warnings X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Thomas Wood --- 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(-) 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;