linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] stacktrace: cleanup inconsistent variable type
@ 2020-04-21  1:35 Walter Wu
  2020-04-23  1:21 ` Bart Van Assche
  0 siblings, 1 reply; 4+ messages in thread
From: Walter Wu @ 2020-04-21  1:35 UTC (permalink / raw)
  To: Matthias Brugger, Thomas Gleixner, Peter Zijlstra, Ingo Molnar,
	Josh Poimboeuf, Bart Van Assche, Andrew Morton
  Cc: linux-mm, linux-kernel, linux-arm-kernel, linux-mediatek,
	wsd_upstream, 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.

Signed-off-by: Walter Wu <walter-zh.wu@mediatek.com>
Cc: Matthias Brugger <matthias.bgg@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Bart Van Assche <bvanassche@acm.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
---
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(-)

diff --git a/include/linux/stacktrace.h b/include/linux/stacktrace.h
index 83bd8cb475d7..b7af8cc13eda 100644
--- a/include/linux/stacktrace.h
+++ b/include/linux/stacktrace.h
@@ -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);
-- 
2.18.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] stacktrace: cleanup inconsistent variable type
  2020-04-21  1:35 [PATCH v2] stacktrace: cleanup inconsistent variable type Walter Wu
@ 2020-04-23  1:21 ` Bart Van Assche
  2020-05-06  2:18   ` Walter Wu
  0 siblings, 1 reply; 4+ messages in thread
From: Bart Van Assche @ 2020-04-23  1:21 UTC (permalink / raw)
  To: Walter Wu, Matthias Brugger, Thomas Gleixner, Peter Zijlstra,
	Ingo Molnar, Josh Poimboeuf, Andrew Morton
  Cc: linux-mm, linux-kernel, linux-arm-kernel, linux-mediatek, wsd_upstream

On 4/20/20 6:35 PM, Walter Wu wrote:
> 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.

Reviewed-by: Bart Van Assche <bvanassche@acm.org>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] stacktrace: cleanup inconsistent variable type
  2020-04-23  1:21 ` Bart Van Assche
@ 2020-05-06  2:18   ` Walter Wu
  2020-05-08  0:04     ` Andrew Morton
  0 siblings, 1 reply; 4+ messages in thread
From: Walter Wu @ 2020-05-06  2:18 UTC (permalink / raw)
  To: Bart Van Assche, Andrew Morton
  Cc: Matthias Brugger, Thomas Gleixner, Peter Zijlstra, Ingo Molnar,
	Josh Poimboeuf, linux-mm, linux-kernel, linux-arm-kernel,
	linux-mediatek, wsd_upstream

On Wed, 2020-04-22 at 18:21 -0700, Bart Van Assche wrote:
> On 4/20/20 6:35 PM, Walter Wu wrote:
> > 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.
> 
> Reviewed-by: Bart Van Assche <bvanassche@acm.org>

Hi Andrew,

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


Thank you for your help.

Walter


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] stacktrace: cleanup inconsistent variable type
  2020-05-06  2:18   ` Walter Wu
@ 2020-05-08  0:04     ` Andrew Morton
  0 siblings, 0 replies; 4+ messages in thread
From: Andrew Morton @ 2020-05-08  0:04 UTC (permalink / raw)
  To: Walter Wu
  Cc: Bart Van Assche, Matthias Brugger, Thomas Gleixner,
	Peter Zijlstra, Ingo Molnar, Josh Poimboeuf, linux-mm,
	linux-kernel, linux-arm-kernel, linux-mediatek, wsd_upstream

On Wed, 6 May 2020 10:18:24 +0800 Walter Wu <walter-zh.wu@mediatek.com> wrote:

> On Wed, 2020-04-22 at 18:21 -0700, Bart Van Assche wrote:
> > On 4/20/20 6:35 PM, Walter Wu wrote:
> > > 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.
> > 
> > Reviewed-by: Bart Van Assche <bvanassche@acm.org>
> 
> 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 :(

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-05-08  0:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-21  1:35 [PATCH v2] stacktrace: cleanup inconsistent variable type Walter Wu
2020-04-23  1:21 ` Bart Van Assche
2020-05-06  2:18   ` Walter Wu
2020-05-08  0:04     ` Andrew Morton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).