[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20211210012245.207489-1-xiujianfeng@huawei.com>
Date: Fri, 10 Dec 2021 09:22:45 +0800
From: Xiu Jianfeng <xiujianfeng@...wei.com>
To: <rostedt@...dmis.org>, <mingo@...hat.com>,
<miguel.ojeda.sandonis@...il.com>
CC: <linux-kernel@...r.kernel.org>, <wangweiyang2@...wei.com>
Subject: [PATCH -next] trace.h: Use memset_startat helper in trace_iterator_reset
Make use of memset_startat helper to simplify the code, there should be
no functional change as a result of this patch.
Signed-off-by: Xiu Jianfeng <xiujianfeng@...wei.com>
---
kernel/trace/trace.h | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
index 38715aa6cfdf..cde9c0710317 100644
--- a/kernel/trace/trace.h
+++ b/kernel/trace/trace.h
@@ -1926,14 +1926,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;
}
--
2.17.1
Powered by blists - more mailing lists