diff mbox

intel-gpu-tools: Fixes-compiler-warnings-about-wrong-function-type

Message ID 20150824095948.GA8349@suse.de (mailing list archive)
State New, archived
Headers show

Commit Message

Stefan Dirsch Aug. 24, 2015, 9:59 a.m. UTC
Hi

Find a simple buildfix against current intel-gpu-tools git sources attached.

Thanks,
Stefan

Public Key available
------------------------------------------------------
Stefan Dirsch (Res. & Dev.)   SUSE LINUX GmbH
Tel: 0911-740 53 0            Maxfeldstraße 5
FAX: 0911-740 53 479          D-90409 Nürnberg
http://www.suse.de            Germany 
---------------------------------------------------------------
SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham
Norton, HRB 21284 (AG Nürnberg)
---------------------------------------------------------------

Comments

Thomas Wood Aug. 26, 2015, 10:42 a.m. UTC | #1
On 24 August 2015 at 10:59, Stefan Dirsch <sndirsch@suse.de> wrote:
> Hi
>
> Find a simple buildfix against current intel-gpu-tools git sources attached.

I assume the compiler warning is about uninitialised values and unused
variables? It looks like the Makefile is not using the debug cflags so
these warning do not appear by default.

intel_null_state_gen.c appears to assume the
gen*_setup_null_render_state functions have return values in the
extern declarations, so this could do with fixing too.


>
> Thanks,
> Stefan
>
> Public Key available
> ------------------------------------------------------
> Stefan Dirsch (Res. & Dev.)   SUSE LINUX GmbH
> Tel: 0911-740 53 0            Maxfeldstraße 5
> FAX: 0911-740 53 479          D-90409 Nürnberg
> http://www.suse.de            Germany
> ---------------------------------------------------------------
> SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham
> Norton, HRB 21284 (AG Nürnberg)
> ---------------------------------------------------------------
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
>
Stefan Dirsch Aug. 31, 2015, 10:12 a.m. UTC | #2
On Wed, Aug 26, 2015 at 11:42:23AM +0100, Thomas Wood wrote:
> On 24 August 2015 at 10:59, Stefan Dirsch <sndirsch@suse.de> wrote:
> > Hi
> >
> > Find a simple buildfix against current intel-gpu-tools git sources attached.
> 
> I assume the compiler warning is about uninitialised values and unused
> variables? It looks like the Makefile is not using the debug cflags so
> these warning do not appear by default.

Warnings/error were:

W: intel-gpu-tools uninitialized-variable intel_renderstate_gen9.c:476
E: intel-gpu-tools no-return-in-nonvoid-function intel_renderstate_gen8.c:441

> intel_null_state_gen.c appears to assume the
> gen*_setup_null_render_state functions have return values in the
> extern declarations, so this could do with fixing too.

Indeed your patches fixes these warnings/errors. So no need any longer to
include/review my patch as long as your patch gets integrated. ;-)

Thanks,
Stefan

Public Key available
------------------------------------------------------
Stefan Dirsch (Res. & Dev.)   SUSE LINUX GmbH
Tel: 0911-740 53 0            Maxfeldstraße 5
FAX: 0911-740 53 479          D-90409 Nürnberg
http://www.suse.de            Germany 
---------------------------------------------------------------
SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham
Norton, HRB 21284 (AG Nürnberg)
---------------------------------------------------------------
diff mbox

Patch

From 89822e4caba0868b397afb141a9f561a254fe92c Mon Sep 17 00:00:00 2001
From: Stefan Dirsch <sndirsch@suse.de>
Date: Fri, 21 Aug 2015 12:40:23 +0200
Subject: [PATCH] Fixes compiler warnings about wrong function type.

Makes definition of function types for gen8_setup_null_render_state
and gen9_setup_null_render_state consistent with the ones from functions
for earlier GPU families like gen6_setup_null_render_state,
gen7_setup_null_render_state, ...

Signed-off-by: Stefan Dirsch <sndirsch@suse.com>
---
 tools/null_state_gen/intel_renderstate_gen8.c | 5 +----
 tools/null_state_gen/intel_renderstate_gen9.c | 5 +----
 2 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/tools/null_state_gen/intel_renderstate_gen8.c b/tools/null_state_gen/intel_renderstate_gen8.c
index 2d7a4b0..58ba6fa 100644
--- a/tools/null_state_gen/intel_renderstate_gen8.c
+++ b/tools/null_state_gen/intel_renderstate_gen8.c
@@ -322,11 +322,8 @@  static void gen8_emit_primitive(struct intel_batchbuffer *batch)
         OUT_BATCH(0);   /* index buffer offset, ignored */
 }
 
-int gen8_setup_null_render_state(struct intel_batchbuffer *batch)
+void gen8_setup_null_render_state(struct intel_batchbuffer *batch)
 {
-	int ret;
-	int i;
-
 #define GEN8_PIPE_CONTROL_GLOBAL_GTT   (1 << 24)
 
 	OUT_BATCH(GEN6_PIPE_CONTROL | (6 - 2));
diff --git a/tools/null_state_gen/intel_renderstate_gen9.c b/tools/null_state_gen/intel_renderstate_gen9.c
index 37bc675..08ee7ba 100644
--- a/tools/null_state_gen/intel_renderstate_gen9.c
+++ b/tools/null_state_gen/intel_renderstate_gen9.c
@@ -342,9 +342,8 @@  static void gen9_emit_state_base_address(struct intel_batchbuffer *batch) {
  * Generate the batch buffer commands needed to initialize the 3D engine
  * to its "golden state".
  */
-int gen9_setup_null_render_state(struct intel_batchbuffer *batch)
+void gen9_setup_null_render_state(struct intel_batchbuffer *batch)
 {
-	int ret;
 	int i;
 
 #define GEN8_PIPE_CONTROL_GLOBAL_GTT   (1 << 24)
@@ -477,6 +476,4 @@  int gen9_setup_null_render_state(struct intel_batchbuffer *batch)
 	gen8_emit_primitive(batch);
 
 	OUT_BATCH(MI_BATCH_BUFFER_END);
-
-	return ret;
 }
-- 
1.8.4.5