From: Samuel Pitoiset Date: Tue, 24 Jan 2017 10:11:59 +0000 (+0100) Subject: gallium/radeon: undef the very specific UPDATE_COUNTER macro X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d90d37db735359cc85e3b0a2ceb6a8d0cbd3ec73;p=mesa.git gallium/radeon: undef the very specific UPDATE_COUNTER macro Also, wrap this into a do { ... } while (0). Suggested by Nicolai. Signed-off-by: Samuel Pitoiset Reviewed-by: Nicolai Hähnle --- diff --git a/src/gallium/drivers/radeon/r600_gpu_load.c b/src/gallium/drivers/radeon/r600_gpu_load.c index 775ac7ac92f..83b7bd72106 100644 --- a/src/gallium/drivers/radeon/r600_gpu_load.c +++ b/src/gallium/drivers/radeon/r600_gpu_load.c @@ -58,11 +58,13 @@ #define CB_BUSY(x) (((x) >> 30) & 0x1) #define GUI_ACTIVE(x) (((x) >> 31) & 0x1) -#define UPDATE_COUNTER(field, mask) \ - if (mask(value)) \ - p_atomic_inc(&counters->named.field.busy); \ - else \ - p_atomic_inc(&counters->named.field.idle); +#define UPDATE_COUNTER(field, mask) \ + do { \ + if (mask(value)) \ + p_atomic_inc(&counters->named.field.busy); \ + else \ + p_atomic_inc(&counters->named.field.idle); \ + } while (0) static void r600_update_grbm_counters(struct r600_common_screen *rscreen, union r600_grbm_counters *counters) @@ -87,6 +89,8 @@ static void r600_update_grbm_counters(struct r600_common_screen *rscreen, UPDATE_COUNTER(gui, GUI_ACTIVE); } +#undef UPDATE_COUNTER + static PIPE_THREAD_ROUTINE(r600_gpu_load_thread, param) { struct r600_common_screen *rscreen = (struct r600_common_screen*)param;