From 7b6468cc9523d7d923487d212281af51f7f3dae2 Mon Sep 17 00:00:00 2001 From: Michael Paquier Date: Fri, 17 Jan 2025 08:26:17 +0900 Subject: Rework macro pgstat_is_ioop_tracked_in_bytes() As written, it was triggering a compilation warning for old versions of clang, as reported by buildfarm members ayu, batfish and demoiselle. Forcing a cast with "unsigned int" should fix the warning. While on it, the macro is moved to pgstat.h, closer to the declaration of IOOp, per suggestion from Tom Lane. Reported-by: Tom Lane Reviewed-by: Bertrand Drouvot, Tom Lane, Nazir Bilal Yavuz Discussion: https://postgr.es/m/1272824.1736961543@sss.pgh.pa.us --- src/backend/utils/activity/pgstat_io.c | 8 -------- 1 file changed, 8 deletions(-) (limited to 'src/backend') diff --git a/src/backend/utils/activity/pgstat_io.c b/src/backend/utils/activity/pgstat_io.c index e03b021af3d..027aad8b24e 100644 --- a/src/backend/utils/activity/pgstat_io.c +++ b/src/backend/utils/activity/pgstat_io.c @@ -23,14 +23,6 @@ static PgStat_PendingIO PendingIOStats; static bool have_iostats = false; -/* - * Check if an IOOp is tracked in bytes. This relies on the ordering of IOOp - * defined in pgstat.h, so make sure to update this check when changing its - * elements. - */ -#define pgstat_is_ioop_tracked_in_bytes(io_op) \ - ((io_op) < IOOP_NUM_TYPES && (io_op) >= IOOP_EXTEND) - /* * Check that stats have not been counted for any combination of IOObject, * IOContext, and IOOp which are not tracked for the passed-in BackendType. If -- cgit v1.2.3