Skip to content

Commit

Permalink
tracing: Use memset_startat helper in trace_iterator_reset()
Browse files Browse the repository at this point in the history
Make use of memset_startat helper to simplify the code, there should be
no functional change as a result of this patch.

Link: https://lkml.kernel.org/r/20211210012245.207489-1-xiujianfeng@huawei.com

Signed-off-by: Xiu Jianfeng <xiujianfeng@huawei.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
  • Loading branch information
Xiu Jianfeng authored and Steven Rostedt (VMware) committed Dec 11, 2021
1 parent 4f67cca commit dba8796
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions kernel/trace/trace.h
Original file line number Diff line number Diff line change
Expand Up @@ -1932,14 +1932,7 @@ extern struct trace_iterator *tracepoint_print_iter;
*/
static __always_inline void trace_iterator_reset(struct trace_iterator *iter)
{
const size_t offset = offsetof(struct trace_iterator, seq);

/*
* Keep gcc from complaining about overwriting more than just one
* member in the structure.
*/
memset((char *)iter + offset, 0, sizeof(struct trace_iterator) - offset);

memset_startat(iter, 0, seq);
iter->pos = -1;
}

Expand Down

0 comments on commit dba8796

Please sign in to comment.