lkml.org 
[lkml]   [2020]   [Jul]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH v4 1/4] crash: add VMCOREINFO macro to define offset in a struct declared by typedef
    Date
    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>
    Acked-by: Baoquan He <bhe@redhat.com>
    Acked-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
    Reviewed-by: Petr Mladek <pmladek@suse.com>
    ---
    include/linux/crash_core.h | 3 +++
    1 file changed, 3 insertions(+)

    diff --git a/include/linux/crash_core.h b/include/linux/crash_core.h
    index 525510a9f965..43b51c9df571 100644
    --- a/include/linux/crash_core.h
    +++ b/include/linux/crash_core.h
    @@ -53,6 +53,9 @@ phys_addr_t paddr_vmcoreinfo_note(void);
    #define VMCOREINFO_OFFSET(name, field) \
    vmcoreinfo_append_str("OFFSET(%s.%s)=%lu\n", #name, #field, \
    (unsigned long)offsetof(struct name, field))
    +#define VMCOREINFO_TYPE_OFFSET(name, field) \
    + vmcoreinfo_append_str("OFFSET(%s.%s)=%lu\n", #name, #field, \
    + (unsigned long)offsetof(name, field))
    #define VMCOREINFO_LENGTH(name, value) \
    vmcoreinfo_append_str("LENGTH(%s)=%lu\n", #name, (unsigned long)value)
    #define VMCOREINFO_NUMBER(name) \
    --
    2.20.1
    \
     
     \ /
      Last update: 2020-07-07 17:00    [W:2.597 / U:0.332 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site