etnaviv: fix returning _Bool instead of pointer

When building for C23 the compiler warns about returning a boolean when
a different type is expected instead.

Change the code to return NULL instead of false, fixing the following
error:

-----------------------------------------------------------------------
../src/gallium/drivers/etnaviv/etnaviv_query_acc_perfmon.c: In function ‘perfmon_allocate’:
../src/gallium/drivers/etnaviv/etnaviv_query_acc_perfmon.c:109:14: error: incompatible types when returning type ‘_Bool’ but ‘struct etna_acc_query *’ was expected
  109 |       return false;
      |              ^~~~~
../src/gallium/drivers/etnaviv/etnaviv_query_acc_perfmon.c:112:14: error: incompatible types when returning type ‘_Bool’ but ‘struct etna_acc_query *’ was expected
  112 |       return false;
      |              ^~~~~
-----------------------------------------------------------------------

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36323>
This commit is contained in:
Antonio Ospite 2025-07-24 14:54:06 +02:00 committed by Marge Bot
parent 2972f1df83
commit b2b6e56583

View file

@ -106,10 +106,10 @@ perfmon_allocate(struct etna_context *ctx, unsigned query_type)
cfg = etna_pm_query_config(query_type);
if (!cfg)
return false;
return NULL;
if (!etna_pm_cfg_supported(ctx->screen->perfmon, cfg))
return false;
return NULL;
pq = CALLOC_STRUCT(etna_pm_query);
if (!pq)