lkml.org 
[lkml]   [2019]   [Apr]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/3] riscv: Add support for perf registers sampling
On Fri, Apr 12, 2019 at 05:38:53PM +0800, Mao Han wrote:
> >
> > > + fp = user_backtrace(entry, fp, regs->ra);
> > > + while ((entry->nr < entry->max_stack) &&
> > > + fp && !((unsigned long)fp & 0x3))
> > > + fp = user_backtrace(entry, fp, 0);
> >
> > Please don't indent the condition continuation and the loop body
> > by the same amount.
>
> Like this?
> while ((entry->nr < entry->max_stack) &&
> fp && !((unsigned long)fp & 0x3))
> fp = user_backtrace(entry, fp, 0);

We tend to either use indentations to the same level as the condition,
or two tabs indents. But I also noticed that we shouldn't even need
the cast here as fp already is unsigned long, so it should all fit on
one line anyway:

while (fp && !(fp & 0x3) && entry->nr < entry->max_stack)
fp = user_backtrace(entry, fp, 0);

\
 
 \ /
  Last update: 2019-04-13 10:03    [W:0.081 / U:0.344 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site