Mesa (master): freedreno: Fix uninitialized var warning in afuc using unreachable().

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Nov 18 18:31:18 UTC 2020


Module: Mesa
Branch: master
Commit: 8ae38885d61b0efb58e1549d41c9577bdadee62e
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=8ae38885d61b0efb58e1549d41c9577bdadee62e

Author: Eric Anholt <eric at anholt.net>
Date:   Tue Nov 17 13:07:39 2020 -0800

freedreno: Fix uninitialized var warning in afuc using unreachable().

Reviewed-by: Rob Clark <robdclark at chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7664>

---

 src/freedreno/afuc/afuc.h      | 5 ++---
 src/freedreno/afuc/asm.c       | 3 ++-
 src/freedreno/afuc/meson.build | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/freedreno/afuc/afuc.h b/src/freedreno/afuc/afuc.h
index 6ec268e3dcc..89b79ef51be 100644
--- a/src/freedreno/afuc/afuc.h
+++ b/src/freedreno/afuc/afuc.h
@@ -24,6 +24,8 @@
 #ifndef _AFUC_H_
 #define _AFUC_H_
 
+#include "util/macros.h"
+
 /*
 TODO kernel debugfs to inject packet into rb for easier experimentation.  It
 should trigger reloading pfp/me and resetting gpu..
@@ -34,9 +36,6 @@ if flag set, copy cmdstream bo contents into RB instead of IB'ing to it from
 RB.
  */
 
-#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
-#define PACKED __attribute__((__packed__))
-
 /* The opcode is encoded variable length.  Opcodes less than 0x30
  * are encoded as 5 bits followed by (rep) flag.  Opcodes >= 0x30
  * (ie. top two bits are '11' are encoded as 6 bits.  See get_opc()
diff --git a/src/freedreno/afuc/asm.c b/src/freedreno/afuc/asm.c
index cb11439b979..7b302e4edaf 100644
--- a/src/freedreno/afuc/asm.c
+++ b/src/freedreno/afuc/asm.c
@@ -33,6 +33,7 @@
 #include <assert.h>
 #include <getopt.h>
 
+#include "util/macros.h"
 #include "afuc.h"
 #include "rnn.h"
 #include "rnndec.h"
@@ -298,7 +299,7 @@ static void emit_instructions(int outfd)
 			opc = OPC_WIN;
 			break;
 		default:
-			assert(0);
+			unreachable("");
 		}
 
 		afuc_set_opc(&instr, opc, ai->rep);
diff --git a/src/freedreno/afuc/meson.build b/src/freedreno/afuc/meson.build
index ccb258d45f8..516b2432604 100644
--- a/src/freedreno/afuc/meson.build
+++ b/src/freedreno/afuc/meson.build
@@ -44,7 +44,7 @@ asm = executable(
     afuc_parser,
   ],
   include_directories: [
-    inc_freedreno_rnn,
+    inc_freedreno_rnn, inc_include, inc_src, inc_util,
   ],
   link_with: [
     libfreedreno_rnn,
@@ -58,7 +58,7 @@ disasm = executable(
   'afuc-disasm',
   'disasm.c',
   include_directories: [
-    inc_freedreno_rnn,
+    inc_freedreno_rnn, inc_include, inc_src, inc_util,
   ],
   link_with: [
     libfreedreno_rnn,



More information about the mesa-commit mailing list