[PATCH 7/7] btf_encoder: Remove unused variables

Arnaldo Carvalho de Melo <[email protected]> Thu, 18 Jun 2026 14:33:16 -0300
Newsgroups org.kernel.vger.dwarves
Message-ID <[email protected]>
From: Arnaldo Carvalho de Melo <[email protected]>

Detected with gcc on fedora44:

  /home/acme/git/pahole/btf_encoder.c: In function ‘types__match’:
  /home/acme/git/pahole/btf_encoder.c:1123:49: warning: variable ‘p2’ set but not used [-Wunused-but-set-variable=]
   1123 |                         const struct btf_param *p2 = btf_params(t2);
        |                                                 ^~
  /home/acme/git/pahole/btf_encoder.c:1122:49: warning: variable ‘p1’ set but not used [-Wunused-but-set-variable=]
   1122 |                         const struct btf_param *p1 = btf_params(t1);
        |                                                 ^~

Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
---
 btf_encoder.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/btf_encoder.c b/btf_encoder.c
index 12c22b003b7990bf..4467710e4e03c32f 100644
--- a/btf_encoder.c
+++ b/btf_encoder.c
@@ -1119,8 +1119,6 @@ static bool types__match(struct btf_encoder *encoder,
 			break;
 		}
 		case BTF_KIND_FUNC_PROTO: {
-			const struct btf_param *p1 = btf_params(t1);
-			const struct btf_param *p2 = btf_params(t2);
 			int i, vlen = btf_vlen(t1);
 
 			if (vlen != btf_vlen(t2))
@@ -1128,7 +1126,7 @@ static bool types__match(struct btf_encoder *encoder,
 			if (!types__match(encoder, btf1, t1->type,
 					  btf2, t2->type))
 				return false;
-			for (i = 0; i < vlen; i++, p1++, p2++) {
+			for (i = 0; i < vlen; i++) {
 				if (!types__match(encoder, btf1, t1->type,
 						  btf2, t2->type))
 					return false;
-- 
2.54.0