Skip to contentSkip to conversation

stacktrace: cleanup inconsistent variable type

PATCH Applied Walter Wu 3 participants 4 messages Apr 21, 2020 – May 8, 2020

Subsystems (2)
lore
Share & tools
lore

Walter Wu

author
#0 lore raw

PATCH v2 1/1 stacktrace: cleanup inconsistent variable type

Modify the variable type of 'skip' member of struct stack_trace. In theory, the 'skip' variable type should be unsigned int. There are two reasons:
- The 'skip' only has two situation, 1)Positive value, 2)Zero
- The 'skip' of struct stack_trace has inconsistent type with struct stack_trace_data, it makes a bit confusion in the relationship between struct stack_trace and stack_trace_data.

Cc Matthias Brugger <[email protected]>
Cc Thomas Gleixner <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Josh Poimboeuf <[email protected]>
Cc Bart Van Assche <[email protected]>
Cc Andrew Morton <[email protected]>

---
changes in v2:
modify the commit log to describe the matter more clearly.

---
 include/linux/stacktrace.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/stacktrace.h +1 -1
index 83bd8cb475d7..b7af8cc13eda 100644
@@ -64,7 +64,7 @@ void arch_stack_walk_user(stack_trace_consume_fn consume_entry, void *cookie,
 struct stack_trace {
 	unsigned int nr_entries, max_entries;
 	unsigned long *entries;
-	int skip;	/* input argument: How many entries to skip */
+	unsigned int skip;	/* input argument: How many entries to skip */
 };
 
 extern void save_stack_trace(struct stack_trace *trace);
Signature · 1 line
2.18.0
Reviewed-by on v2 1/1
#1 lore raw
Quoted 7 lines · Walter Wu

Modify the variable type of 'skip' member of struct stack_trace. In theory, the 'skip' variable type should be unsigned int. There are two reasons:
- The 'skip' only has two situation, 1)Positive value, 2)Zero
- The 'skip' of struct stack_trace has inconsistent type with struct stack_trace_data, it makes a bit confusion in the relationship between struct stack_trace and stack_trace_data.

author
#2 lore raw
Quoted 10 lines · Bart Van Assche
Quoted 7 lines · Walter Wu

Modify the variable type of 'skip' member of struct stack_trace. In theory, the 'skip' variable type should be unsigned int. There are two reasons:
- The 'skip' only has two situation, 1)Positive value, 2)Zero
- The 'skip' of struct stack_trace has inconsistent type with struct stack_trace_data, it makes a bit confusion in the relationship between struct stack_trace and stack_trace_data.

Hi Andrew,

Would you know why not to be picked up this patch yet? Do I miss somethings?

Thank you for your help.

Walter

maintainer
#3 lore raw
Quoted 10 lines · On Wed, 6 May 2020 10:18:24 +0800 Walter Wu <[email protected]> wrote:
Quoted 9 lines · Bart Van Assche
Quoted 7 lines · Walter Wu

Modify the variable type of 'skip' member of struct stack_trace. In theory, the 'skip' variable type should be unsigned int. There are two reasons:
- The 'skip' only has two situation, 1)Positive value, 2)Zero
- The 'skip' of struct stack_trace has inconsistent type with struct stack_trace_data, it makes a bit confusion in the relationship between struct stack_trace and stack_trace_data.

Quoted 6 lines
Quoted 1 line

Hi Andrew,

Would you know why not to be picked up this patch yet? Do I miss somethings?

I'd decided to pass on this because it's so minor. We inappropriately use signed types in soooo many places :(