Mesa (master): etnaviv: annotate variables only used in debug build

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Jan 7 10:51:50 UTC 2019


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

Author: Lucas Stach <l.stach at pengutronix.de>
Date:   Wed Nov 14 15:29:04 2018 +0100

etnaviv: annotate variables only used in debug build

Some of the status variables in the compiler are only used in asserts
and thus may be unused in release builds. Annotate them accordingly
to avoid 'unused but set' warnings from the compiler.

Signed-off-by: Lucas Stach <l.stach at pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner at gmail.com>

---

 src/gallium/drivers/etnaviv/etnaviv_compiler.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/src/gallium/drivers/etnaviv/etnaviv_compiler.c b/src/gallium/drivers/etnaviv/etnaviv_compiler.c
index bbc61a59fc..ceca5b8af9 100644
--- a/src/gallium/drivers/etnaviv/etnaviv_compiler.c
+++ b/src/gallium/drivers/etnaviv/etnaviv_compiler.c
@@ -477,8 +477,7 @@ static void
 etna_compile_parse_declarations(struct etna_compile *c)
 {
    struct tgsi_parse_context ctx = { };
-   unsigned status = TGSI_PARSE_OK;
-   status = tgsi_parse_init(&ctx, c->tokens);
+   MAYBE_UNUSED unsigned status = tgsi_parse_init(&ctx, c->tokens);
    assert(status == TGSI_PARSE_OK);
 
    while (!tgsi_parse_end_of_tokens(&ctx)) {
@@ -530,8 +529,7 @@ static void
 etna_compile_pass_check_usage(struct etna_compile *c)
 {
    struct tgsi_parse_context ctx = { };
-   unsigned status = TGSI_PARSE_OK;
-   status = tgsi_parse_init(&ctx, c->tokens);
+   MAYBE_UNUSED unsigned status = tgsi_parse_init(&ctx, c->tokens);
    assert(status == TGSI_PARSE_OK);
 
    for (int idx = 0; idx < c->total_decls; ++idx) {
@@ -662,8 +660,7 @@ etna_compile_pass_optimize_outputs(struct etna_compile *c)
 {
    struct tgsi_parse_context ctx = { };
    int inst_idx = 0;
-   unsigned status = TGSI_PARSE_OK;
-   status = tgsi_parse_init(&ctx, c->tokens);
+   MAYBE_UNUSED unsigned status = tgsi_parse_init(&ctx, c->tokens);
    assert(status == TGSI_PARSE_OK);
 
    while (!tgsi_parse_end_of_tokens(&ctx)) {
@@ -1812,7 +1809,7 @@ static void
 etna_compile_pass_generate_code(struct etna_compile *c)
 {
    struct tgsi_parse_context ctx = { };
-   unsigned status = tgsi_parse_init(&ctx, c->tokens);
+   MAYBE_UNUSED unsigned status = tgsi_parse_init(&ctx, c->tokens);
    assert(status == TGSI_PARSE_OK);
 
    int inst_idx = 0;




More information about the mesa-commit mailing list