Skip to content

Commit 0d6f554

Browse files
jognesspmladek
authored andcommitted
crash: add VMCOREINFO macro to define offset in a struct declared by typedef
The existing macro VMCOREINFO_OFFSET() can't be used for structures declared via typedef because "struct" is not part of type definition. Create another macro for this purpose. Signed-off-by: John Ogness <john.ogness@linutronix.de> Reviewed-by: Petr Mladek <pmladek@suse.com> Acked-by: Baoquan He <bhe@redhat.com> Acked-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com> Signed-off-by: Petr Mladek <pmladek@suse.com> Link: https://lore.kernel.org/r/20200709132344.760-2-john.ogness@linutronix.de
1 parent 625d344 commit 0d6f554

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

‎include/linux/crash_core.h‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ phys_addr_t paddr_vmcoreinfo_note(void);
5353
#define VMCOREINFO_OFFSET(name, field) \
5454
vmcoreinfo_append_str("OFFSET(%s.%s)=%lu\n", #name, #field, \
5555
(unsigned long)offsetof(struct name, field))
56+
#define VMCOREINFO_TYPE_OFFSET(name, field) \
57+
vmcoreinfo_append_str("OFFSET(%s.%s)=%lu\n", #name, #field, \
58+
(unsigned long)offsetof(name, field))
5659
#define VMCOREINFO_LENGTH(name, value) \
5760
vmcoreinfo_append_str("LENGTH(%s)=%lu\n", #name, (unsigned long)value)
5861
#define VMCOREINFO_NUMBER(name) \

0 commit comments

Comments
 (0)