pg.ddx.io pgsql-hackers@postgresql.org mailing list archive
help / color / mirror / Atom feedamcheck: Remove unused IndexCheckableCallback typedef
3+ messages / 2 participants
[nested] [flat]
* amcheck: Remove unused IndexCheckableCallback typedef
@ 2025-07-04 07:50 Fujii Masao <masao.fujii@oss.nttdata.com>
0 siblings, 1 reply; 3+ messages in thread
From: Fujii Masao @ 2025-07-04 07:50 UTC (permalink / raw)
To: pgsql-hackers@lists.postgresql.org
Hi,
Commit d70b17636dd introduced the IndexCheckableCallback typedef for
a callback function, but it appears to be unused.
From the discussion in [1], it seems this typedef was originally used as
a function argument in early versions of the patch. However,
the argument was removed in v23, and the typedef was accidentally left behind.
The attached patch removes this unused typedef to clean up the dead code.
Thoughts?
Regards,
[1] https://postgr.es/m/45AC9B0A-2B45-40EE-B08F-BDCF5739D1E1@yandex-team.ru
--
Fujii Masao
NTT DATA Japan Corporation
From 2d38d5cbb3d764f033d2e93b3eba1e4b735a6c28 Mon Sep 17 00:00:00 2001
From: Fujii Masao <fujii@postgresql.org>
Date: Fri, 4 Jul 2025 15:28:24 +0900
Subject: [PATCH v1] amcheck: Remove unused IndexCheckableCallback typedef.
Commit d70b17636dd introduced the IndexCheckableCallback typedef for
a callback function, but it was never used. This commit removes
the unused typedef to clean up dead code.
---
contrib/amcheck/verify_common.h | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/contrib/amcheck/verify_common.h b/contrib/amcheck/verify_common.h
index e78adb68808..42ef9c20fe2 100644
--- a/contrib/amcheck/verify_common.h
+++ b/contrib/amcheck/verify_common.h
@@ -16,8 +16,7 @@
#include "utils/relcache.h"
#include "miscadmin.h"
-/* Typedefs for callback functions for amcheck_lock_relation_and_check */
-typedef void (*IndexCheckableCallback) (Relation index);
+/* Typedef for callback function for amcheck_lock_relation_and_check */
typedef void (*IndexDoCheckCallback) (Relation rel,
Relation heaprel,
void *state,
--
2.49.0
Attachments:
[text/plain] v1-0001-amcheck-Remove-unused-IndexCheckableCallback-type.patch (1.1K, ../../e1ea4e14-3b21-4e01-a5f2-0686883265df@oss.nttdata.com/2-v1-0001-amcheck-Remove-unused-IndexCheckableCallback-type.patch)
download | inline diff:
From 2d38d5cbb3d764f033d2e93b3eba1e4b735a6c28 Mon Sep 17 00:00:00 2001
From: Fujii Masao <fujii@postgresql.org>
Date: Fri, 4 Jul 2025 15:28:24 +0900
Subject: [PATCH v1] amcheck: Remove unused IndexCheckableCallback typedef.
Commit d70b17636dd introduced the IndexCheckableCallback typedef for
a callback function, but it was never used. This commit removes
the unused typedef to clean up dead code.
---
contrib/amcheck/verify_common.h | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/contrib/amcheck/verify_common.h b/contrib/amcheck/verify_common.h
index e78adb68808..42ef9c20fe2 100644
--- a/contrib/amcheck/verify_common.h
+++ b/contrib/amcheck/verify_common.h
@@ -16,8 +16,7 @@
#include "utils/relcache.h"
#include "miscadmin.h"
-/* Typedefs for callback functions for amcheck_lock_relation_and_check */
-typedef void (*IndexCheckableCallback) (Relation index);
+/* Typedef for callback function for amcheck_lock_relation_and_check */
typedef void (*IndexDoCheckCallback) (Relation rel,
Relation heaprel,
void *state,
--
2.49.0
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: amcheck: Remove unused IndexCheckableCallback typedef
@ 2025-07-04 08:25 Andrey Borodin <x4mmm@yandex-team.ru>
parent: Fujii Masao <masao.fujii@oss.nttdata.com>
0 siblings, 1 reply; 3+ messages in thread
From: Andrey Borodin @ 2025-07-04 08:25 UTC (permalink / raw)
To: Fujii Masao <masao.fujii@oss.nttdata.com>; +Cc: pgsql-hackers@lists.postgresql.org
> On 4 Jul 2025, at 10:50, Fujii Masao <masao.fujii@oss.nttdata.com> wrote:
>
> From the discussion in [1], it seems this typedef was originally used as
> a function argument in early versions of the patch. However,
> the argument was removed in v23, and the typedef was accidentally left behind.
Yes, your analysis is correct. We could make common checking function and argument was not needed.
>
> The attached patch removes this unused typedef to clean up the dead code.
> Thoughts?
Looks good to me. Thanks for fixing this!
Best regards, Andrey Borodin.
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: amcheck: Remove unused IndexCheckableCallback typedef
@ 2025-07-04 14:29 Fujii Masao <masao.fujii@oss.nttdata.com>
parent: Andrey Borodin <x4mmm@yandex-team.ru>
0 siblings, 0 replies; 3+ messages in thread
From: Fujii Masao @ 2025-07-04 14:29 UTC (permalink / raw)
To: Andrey Borodin <x4mmm@yandex-team.ru>; +Cc: pgsql-hackers@lists.postgresql.org
On 2025/07/04 17:25, Andrey Borodin wrote:
>
>
>> On 4 Jul 2025, at 10:50, Fujii Masao <masao.fujii@oss.nttdata.com> wrote:
>>
>> From the discussion in [1], it seems this typedef was originally used as
>> a function argument in early versions of the patch. However,
>> the argument was removed in v23, and the typedef was accidentally left behind.
>
> Yes, your analysis is correct. We could make common checking function and argument was not needed.
>
>>
>> The attached patch removes this unused typedef to clean up the dead code.
>> Thoughts?
>
> Looks good to me. Thanks for fixing this!
Thanks for the review! I've pushed the patch.
Regards,
--
Fujii Masao
NTT DATA Japan Corporation
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2025-07-04 14:29 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2025-07-04 07:50 amcheck: Remove unused IndexCheckableCallback typedef Fujii Masao <masao.fujii@oss.nttdata.com>
2025-07-04 08:25 ` Andrey Borodin <x4mmm@yandex-team.ru>
2025-07-04 14:29 ` Fujii Masao <masao.fujii@oss.nttdata.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox