From patchwork Mon Aug 21 22:28:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hauke Mehrtens X-Patchwork-Id: 9913905 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E6497603FA for ; Mon, 21 Aug 2017 22:28:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C6D3E286AA for ; Mon, 21 Aug 2017 22:28:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BBBA2286AB; Mon, 21 Aug 2017 22:28:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6E1DA286C1 for ; Mon, 21 Aug 2017 22:28:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754428AbdHUW2s (ORCPT ); Mon, 21 Aug 2017 18:28:48 -0400 Received: from mx1.mailbox.org ([80.241.60.212]:48955 "EHLO mx1.mailbox.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754388AbdHUW2r (ORCPT ); Mon, 21 Aug 2017 18:28:47 -0400 Received: from smtp1.mailbox.org (smtp1.mailbox.org [80.241.60.240]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.mailbox.org (Postfix) with ESMTPS id EE5814251F; Tue, 22 Aug 2017 00:28:45 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp1.mailbox.org ([80.241.60.240]) by spamfilter03.heinlein-hosting.de (spamfilter03.heinlein-hosting.de [80.241.56.117]) (amavisd-new, port 10030) with ESMTP id 7e-ws5w79ZVD; Tue, 22 Aug 2017 00:28:45 +0200 (CEST) From: Hauke Mehrtens To: johannes@sipsolutions.net Cc: backports@vger.kernel.org, Hauke Mehrtens Subject: [PATCH 14/21] header: add offsetofend() Date: Tue, 22 Aug 2017 00:28:10 +0200 Message-Id: <20170821222817.17376-15-hauke@hauke-m.de> In-Reply-To: <20170821222817.17376-1-hauke@hauke-m.de> References: <20170821222817.17376-1-hauke@hauke-m.de> Sender: backports-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: backports@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP offsetofend() was moved from vfio.h to stddef.h in commit 3876488444e7123 ("include/stddef.h: Move offsetofend() from vfio.h to a generic kernel header") for kernel 4.1. Add it again to stddef.h so it is available in more include paths. Signed-off-by: Hauke Mehrtens --- backport/backport-include/linux/stddef.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 backport/backport-include/linux/stddef.h diff --git a/backport/backport-include/linux/stddef.h b/backport/backport-include/linux/stddef.h new file mode 100644 index 00000000..2c836b00 --- /dev/null +++ b/backport/backport-include/linux/stddef.h @@ -0,0 +1,16 @@ +#ifndef __BACKPORT_LINUX_STDDEF_H +#define __BACKPORT_LINUX_STDDEF_H +#include_next + +#ifndef offsetofend +/** + * offsetofend(TYPE, MEMBER) + * + * @TYPE: The type of the structure + * @MEMBER: The member within the structure to get the end offset of + */ +#define offsetofend(TYPE, MEMBER) \ + (offsetof(TYPE, MEMBER) + sizeof(((TYPE *)0)->MEMBER)) +#endif + +#endif /* __BACKPORT_LINUX_STDDEF_H */