summaryrefslogtreecommitdiffstats
path: root/drivers/uwb/beacon.c
diff options
context:
space:
mode:
authorOleg Nesterov <oleg@redhat.com>2013-07-18 20:47:10 +0200
committerSteven Rostedt <rostedt@goodmis.org>2013-07-18 21:31:32 -0400
commit7710b639953b791610f0022a7d52d9801c93b969 (patch)
treead1e4822ad3b1b067ee2806142613caec0ed1e60 /drivers/uwb/beacon.c
parent8f768993394a8c0d3801033c11fd86ce8c88dcac (diff)
downloadop-kernel-dev-7710b639953b791610f0022a7d52d9801c93b969.zip
op-kernel-dev-7710b639953b791610f0022a7d52d9801c93b969.tar.gz
tracing: Simplify the iteration logic in f_start/f_next
f_next() looks overcomplicated, and it is not strictly correct even if this doesn't matter. Say, FORMAT_FIELD_SEPERATOR should not return NULL (means EOF) if trace_get_fields() returns an empty list, we should simply advance to FORMAT_PRINTFMT as we do when we find the end of list. 1. Change f_next() to return "struct list_head *" rather than "ftrace_event_field *", and change f_show() to do list_entry(). This simplifies the code a bit, only f_show() needs to know about ftrace_event_field, and f_next() can play with ->prev directly 2. Change f_next() to not play with ->prev / return inside the switch() statement. It can simply set node = head/common_head, the prev-or-advance-to-the-next-magic below does all work. While at it. f_start() looks overcomplicated too. I don't think *pos == 0 makes sense as a separate case, just change this code to do "while" instead of "do/while". The patch also moves f_start() down, close to f_stop(). This is purely cosmetic, just to make the locking added by the next patch more clear/visible. Link: http://lkml.kernel.org/r/20130718184710.GA4783@redhat.com Signed-off-by: Oleg Nesterov <oleg@redhat.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'drivers/uwb/beacon.c')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud