Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1671458ybt; Thu, 18 Jun 2020 14:26:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyIlxScIsvHpDpvCyI18oQieukyejWYVuA0UJNAYQMxQwMt5/lRWp94Rq0U8kKJW2vfv6e3 X-Received: by 2002:a17:906:3282:: with SMTP id 2mr622731ejw.93.1592515579525; Thu, 18 Jun 2020 14:26:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592515579; cv=none; d=google.com; s=arc-20160816; b=drx05YUdtXVKld5cdy9yoaK6HL3tGl44Ave4XCj5iRdZPeUiJKUekn+Yx3+4lnqpUO ViVKf0/HPgFOgjKhDN9qLUbZzQwfG7KurZpuISPCp5sZnhm1JCszZP9uedrarLSbGoY4 61/NyZsAtsXt2g95Z22A2yMDmtIK2evd2mZ0Roii7DWILjYePQSFUdyG6VV9896PoRc3 L4FeKqQiCFiWV4SXEvCnb8z8mIQN9S6qdLIfFixtiGqN4OafeHWuFBlCk4c126Oge1Gw y/KlvCvMzG2iagP6febAV+OXDDVtXtL5MgPg+rQrdRxWqnUscJcdJaGqoyxsJJ/HRxA9 CdWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=2JCZZZyRQ+HdhLZjdraGit2M5LJQJL2Z1nORwP3gmeo=; b=Aob2ilOqWinjTdAqmPQYBpEqjz2i/n6unbPAh3Ik0eG033Plg2YkZqK5J4/zf6GA5v LX5jU/56x3fonz5eu7aAT1bR1DUIicBaEnRmzYJG32OndD+w/W/7hKu9B93YxOa3uTep BvTeXsyM0aiuNXso5yByx4mRlqQCRmWjaasQJEX98bVymRlJySMLqAuKhcIjus20q4np f29xJNe4Wkid8V4kc9m6A/Z+gtHAC4Wenx1cvaF1DUBbnfo5NhZBY9tr01t62ZM+b5UB F6M5Nv5OsepzqFnrWo2qsjxxePB3hwPm2YLXHHR8pisJNdNdVDmuhKWVSQZc9XmKPxSI qB+Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n8si2699663ejj.317.2020.06.18.14.25.57; Thu, 18 Jun 2020 14:26:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731031AbgFROt5 (ORCPT + 99 others); Thu, 18 Jun 2020 10:49:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58294 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730973AbgFROtx (ORCPT ); Thu, 18 Jun 2020 10:49:53 -0400 Received: from Galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F232C0613EE for ; Thu, 18 Jun 2020 07:49:52 -0700 (PDT) Received: from [5.158.153.53] (helo=g2noscherz.lab.linutronix.de.) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1jlvrA-0004Ip-Tt; Thu, 18 Jun 2020 16:49:33 +0200 From: John Ogness To: Petr Mladek Cc: Peter Zijlstra , Sergey Senozhatsky , Sergey Senozhatsky , Steven Rostedt , Linus Torvalds , Greg Kroah-Hartman , Andrea Parri , Thomas Gleixner , Paul McKenney , kexec@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 1/3] crash: add VMCOREINFO macro to define offset in a struct declared by typedef Date: Thu, 18 Jun 2020 16:55:17 +0206 Message-Id: <20200618144919.9806-2-john.ogness@linutronix.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200618144919.9806-1-john.ogness@linutronix.de> References: <20200618144919.9806-1-john.ogness@linutronix.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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