Skip to contentSkip to conversation

fgraph: Remove unused FGRAPH_MAX_INDEX

PATCH In review Donggeun Yoo 2 participants 2 messages Sep 5 – Sep 6

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fgraph: Remove unused FGRAPH_MAX_INDEX

FGRAPH_MAX_INDEX has no user, and it expands to FGRAPH_INDEX_SIZE and FGRAPH_RET_INDEX, neither of which is defined anywhere in the tree. It was added in that form by commit 91c46b0aa917 ("function_graph:
Implement fgraph_reserve_data() and fgraph_retrieve_data()"), which introduced the current data word layout under new names, so anything referencing it would have failed to build ever since.

Remove it.

---
Found while reading the shadow stack word layout. The macro is dead in both senses: nothing references it, and it could not be used as it is.

Compile-tested only, with CONFIG_FUNCTION_GRAPH_TRACER=y and CONFIG_DYNAMIC_FTRACE=y. Removing an unreferenced macro cannot change generated code, so there is nothing to test at run time.

 kernel/trace/fgraph.c | 3 ---
 1 file changed, 3 deletions(-)
kernel/trace/fgraph.c +0 -3
index 40d373d65f9b..ed455b53513b 100644
@@ -143,9 +143,6 @@ enum {
 #define FGRAPH_DATA_INDEX_MASK	GENMASK(FGRAPH_DATA_INDEX_BITS - 1, 0)
 #define FGRAPH_DATA_INDEX_SHIFT	(FGRAPH_DATA_SHIFT + FGRAPH_DATA_BITS)
 
-#define FGRAPH_MAX_INDEX	\
-	((FGRAPH_INDEX_SIZE << FGRAPH_DATA_BITS) + FGRAPH_RET_INDEX)
-
 #define FGRAPH_ARRAY_SIZE	FGRAPH_INDEX_BITS
 
 /*
Signature · 1 line
2.53.0
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines · On Sun, 6 Sep 2026 06:19:22 +0900 Donggeun Yoo <[email protected]>…

FGRAPH_MAX_INDEX has no user, and it expands to FGRAPH_INDEX_SIZE and FGRAPH_RET_INDEX, neither of which is defined anywhere in the tree. It was added in that form by commit 91c46b0aa917 ("function_graph:
Implement fgraph_reserve_data() and fgraph_retrieve_data()"), which introduced the current data word layout under new names, so anything referencing it would have failed to build ever since.

Remove it.

Looks good to me.

Thanks!

Quoted 29 lines

---
Found while reading the shadow stack word layout. The macro is dead in both senses: nothing references it, and it could not be used as it is.

Compile-tested only, with CONFIG_FUNCTION_GRAPH_TRACER=y and CONFIG_DYNAMIC_FTRACE=y. Removing an unreferenced macro cannot change generated code, so there is nothing to test at run time.

 kernel/trace/fgraph.c | 3 ---
 1 file changed, 3 deletions(-)
kernel/trace/fgraph.c +0 -3
index 40d373d65f9b..ed455b53513b 100644
@@ -143,9 +143,6 @@ enum {
 #define FGRAPH_DATA_INDEX_MASK	GENMASK(FGRAPH_DATA_INDEX_BITS - 1, 0)
 #define FGRAPH_DATA_INDEX_SHIFT	(FGRAPH_DATA_SHIFT + FGRAPH_DATA_BITS)
 
-#define FGRAPH_MAX_INDEX	\
-	((FGRAPH_INDEX_SIZE << FGRAPH_DATA_BITS) + FGRAPH_RET_INDEX)
-
 #define FGRAPH_ARRAY_SIZE	FGRAPH_INDEX_BITS
 
 /*
Signature · 1 line
2.53.0
Signature · 1 line
Masami Hiramatsu (Google) <[email protected]>