]> git.baikalelectronics.ru Git - kernel.git/commit
tracing: Use alignof__(struct {type b;}) instead of offsetof()
authorSteven Rostedt (Google) <rostedt@goodmis.org>
Tue, 2 Aug 2022 19:44:12 +0000 (15:44 -0400)
committerSteven Rostedt (Google) <rostedt@goodmis.org>
Tue, 2 Aug 2022 20:01:12 +0000 (16:01 -0400)
commit5cdcd8e5c0da239d31311bf075625f8760ba56d3
treecf06a8c4d6061eefc4b7689c58da07472e88f5cd
parentd9a46d2d5dab33579525d6a6b4a157a525e603d1
tracing: Use alignof__(struct {type b;}) instead of offsetof()

Simplify:

  #define ALIGN_STRUCTFIELD(type) ((int)(offsetof(struct {char a; type b;}, b)))

with

  #define  ALIGN_STRUCTFIELD(type) __alignof__(struct {type b;})

Which works just the same.

Link: https://lore.kernel.org/all/a7d202457150472588df0bd3b7334b3f@AcuMS.aculab.com/
Link: https://lkml.kernel.org/r/20220802154412.513c50e3@gandalf.local.home
Suggested-by: David Laight <David.Laight@ACULAB.COM>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
include/trace/stages/stage4_event_fields.h