From patchwork Wed Sep 5 15:54:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 10589077 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B0CC0112B for ; Wed, 5 Sep 2018 15:54:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A164E296A2 for ; Wed, 5 Sep 2018 15:54:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9F9B229DB2; Wed, 5 Sep 2018 15:54:50 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=unavailable 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 4339E2A03C for ; Wed, 5 Sep 2018 15:54:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727644AbeIEUZb (ORCPT ); Wed, 5 Sep 2018 16:25:31 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:36964 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726189AbeIEUZa (ORCPT ); Wed, 5 Sep 2018 16:25:30 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 75E2740241C3; Wed, 5 Sep 2018 15:54:42 +0000 (UTC) Received: from warthog.procyon.org.uk (ovpn-123-84.rdu2.redhat.com [10.10.123.84]) by smtp.corp.redhat.com (Postfix) with ESMTP id 604FA202706C; Wed, 5 Sep 2018 15:54:41 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 Subject: [PATCH 01/11] UAPI: drm: Fix use of C++ keywords as structural members From: David Howells To: linux-api@vger.kernel.org, linux-kbuild@vger.kernel.org Cc: Rob Clark , David Airlie , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org, dhowells@redhat.com Date: Wed, 05 Sep 2018 16:54:40 +0100 Message-ID: <153616288089.23468.4502511671693917281.stgit@warthog.procyon.org.uk> In-Reply-To: <153616286704.23468.584491117180383924.stgit@warthog.procyon.org.uk> References: <153616286704.23468.584491117180383924.stgit@warthog.procyon.org.uk> User-Agent: StGit/unknown-version MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Wed, 05 Sep 2018 15:54:42 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Wed, 05 Sep 2018 15:54:42 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'dhowells@redhat.com' RCPT:'' Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The i810 and msm drm drivers use C++ keywords as structural members. Fix this by inserting an anonymous union that provides an alternative name and then hide the reserved name in C++. Signed-off-by: David Howells cc: Rob Clark cc: David Airlie cc: linux-arm-msm@vger.kernel.org cc: dri-devel@lists.freedesktop.org cc: freedreno@lists.freedesktop.org --- include/uapi/drm/i810_drm.h | 7 ++++++- include/uapi/drm/msm_drm.h | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/include/uapi/drm/i810_drm.h b/include/uapi/drm/i810_drm.h index d285d5e72e6a..617d79ec3fc5 100644 --- a/include/uapi/drm/i810_drm.h +++ b/include/uapi/drm/i810_drm.h @@ -266,7 +266,12 @@ typedef struct _drm_i810_copy_t { #define PR_MASK (0x7<<18) typedef struct drm_i810_dma { - void *virtual; + union { +#ifndef __cplusplus + void *virtual; +#endif + void *_virtual; + }; int request_idx; int request_size; int granted; diff --git a/include/uapi/drm/msm_drm.h b/include/uapi/drm/msm_drm.h index c06d0a5bdd80..e99bab72d58c 100644 --- a/include/uapi/drm/msm_drm.h +++ b/include/uapi/drm/msm_drm.h @@ -148,7 +148,12 @@ struct drm_msm_gem_cpu_fini { */ struct drm_msm_gem_submit_reloc { __u32 submit_offset; /* in, offset from submit_bo */ - __u32 or; /* in, value OR'd with result */ + union { +#ifndef __cplusplus + __u32 or; /* in, value OR'd with result */ +#endif + __u32 _or; /* in, value OR'd with result */ + }; __s32 shift; /* in, amount of left shift (can be negative) */ __u32 reloc_idx; /* in, index of reloc_bo buffer */ __u64 reloc_offset; /* in, offset from start of reloc_bo */ From patchwork Wed Sep 5 15:54:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 10589079 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6B32A174C for ; Wed, 5 Sep 2018 15:54:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 57F4B2A03C for ; Wed, 5 Sep 2018 15:54:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 564452A495; Wed, 5 Sep 2018 15:54:54 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 098222A4A4 for ; Wed, 5 Sep 2018 15:54:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727694AbeIEUZi (ORCPT ); Wed, 5 Sep 2018 16:25:38 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:36970 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726189AbeIEUZi (ORCPT ); Wed, 5 Sep 2018 16:25:38 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 24C6340241C3; Wed, 5 Sep 2018 15:54:50 +0000 (UTC) Received: from warthog.procyon.org.uk (ovpn-123-84.rdu2.redhat.com [10.10.123.84]) by smtp.corp.redhat.com (Postfix) with ESMTP id 216F42166BA4; Wed, 5 Sep 2018 15:54:48 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 Subject: [PATCH 02/11] UAPI: keys: Fix use of C++ keywords as structural members From: David Howells To: linux-api@vger.kernel.org, linux-kbuild@vger.kernel.org Cc: Mat Martineau , keyrings@vger.kernel.org, linux-kernel@vger.kernel.org, dhowells@redhat.com Date: Wed, 05 Sep 2018 16:54:47 +0100 Message-ID: <153616288762.23468.17409226604948361939.stgit@warthog.procyon.org.uk> In-Reply-To: <153616286704.23468.584491117180383924.stgit@warthog.procyon.org.uk> References: <153616286704.23468.584491117180383924.stgit@warthog.procyon.org.uk> User-Agent: StGit/unknown-version MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Wed, 05 Sep 2018 15:54:50 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Wed, 05 Sep 2018 15:54:50 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'dhowells@redhat.com' RCPT:'' Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The keyctl_dh_params struct uses a C++ keyword as structural members. Fix this by inserting an anonymous union that provides an alternative name and then hide the reserved name in C++. Signed-off-by: David Howells cc: Mat Martineau cc: keyrings@vger.kernel.org --- include/uapi/linux/keyctl.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/include/uapi/linux/keyctl.h b/include/uapi/linux/keyctl.h index 7b8c9e19bad1..170f015d1f25 100644 --- a/include/uapi/linux/keyctl.h +++ b/include/uapi/linux/keyctl.h @@ -65,7 +65,12 @@ /* keyctl structures */ struct keyctl_dh_params { - __s32 private; + union { +#ifndef __cplusplus + __s32 private; +#endif + __s32 dh_private; + }; __s32 prime; __s32 base; }; From patchwork Wed Sep 5 15:54:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 10589081 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DF7BF112B for ; Wed, 5 Sep 2018 15:55:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CE73C2A03C for ; Wed, 5 Sep 2018 15:55:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CCB752A432; Wed, 5 Sep 2018 15:55:04 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 80AE42A4AD for ; Wed, 5 Sep 2018 15:55:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727715AbeIEUZr (ORCPT ); Wed, 5 Sep 2018 16:25:47 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:33716 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726189AbeIEUZq (ORCPT ); Wed, 5 Sep 2018 16:25:46 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 834A0DFE5; Wed, 5 Sep 2018 15:54:58 +0000 (UTC) Received: from warthog.procyon.org.uk (ovpn-123-84.rdu2.redhat.com [10.10.123.84]) by smtp.corp.redhat.com (Postfix) with ESMTP id A37BE2027EB6; Wed, 5 Sep 2018 15:54:55 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 Subject: [PATCH 03/11] UAPI: virtio_net: Fix use of C++ keywords as structural members From: David Howells To: linux-api@vger.kernel.org, linux-kbuild@vger.kernel.org Cc: "Michael S. Tsirkin" , Jason Wang , virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org, dhowells@redhat.com Date: Wed, 05 Sep 2018 16:54:55 +0100 Message-ID: <153616289529.23468.7498785670556620808.stgit@warthog.procyon.org.uk> In-Reply-To: <153616286704.23468.584491117180383924.stgit@warthog.procyon.org.uk> References: <153616286704.23468.584491117180383924.stgit@warthog.procyon.org.uk> User-Agent: StGit/unknown-version MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Wed, 05 Sep 2018 15:54:58 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Wed, 05 Sep 2018 15:54:58 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'dhowells@redhat.com' RCPT:'' Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The virtio_net_ctrl_hdr struct uses a C++ keyword as structural members. Fix this by inserting an anonymous union that provides an alternative name and then hide the reserved name in C++. Signed-off-by: David Howells cc: "Michael S. Tsirkin" cc: Jason Wang cc: virtualization@lists.linux-foundation.org --- include/uapi/linux/virtio_net.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/include/uapi/linux/virtio_net.h b/include/uapi/linux/virtio_net.h index a3715a3224c1..967142bc0e05 100644 --- a/include/uapi/linux/virtio_net.h +++ b/include/uapi/linux/virtio_net.h @@ -150,7 +150,12 @@ struct virtio_net_hdr_mrg_rxbuf { * command goes in between. */ struct virtio_net_ctrl_hdr { - __u8 class; + union { +#ifndef __cplusplus + __u8 class; +#endif + __u8 _class; + }; __u8 cmd; } __attribute__((packed)); From patchwork Wed Sep 5 15:55:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 10589083 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EDC21112B for ; Wed, 5 Sep 2018 15:55:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DC7562A1A8 for ; Wed, 5 Sep 2018 15:55:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DB0BA2A432; Wed, 5 Sep 2018 15:55:07 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 C07B42A49F for ; Wed, 5 Sep 2018 15:55:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727738AbeIEUZx (ORCPT ); Wed, 5 Sep 2018 16:25:53 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:50544 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726189AbeIEUZx (ORCPT ); Wed, 5 Sep 2018 16:25:53 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2DAD240261BB; Wed, 5 Sep 2018 15:55:05 +0000 (UTC) Received: from warthog.procyon.org.uk (ovpn-123-84.rdu2.redhat.com [10.10.123.84]) by smtp.corp.redhat.com (Postfix) with ESMTP id 464B9202706C; Wed, 5 Sep 2018 15:55:04 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 Subject: [PATCH 04/11] UAPI: bcache: Fix use of embedded flexible array From: David Howells To: linux-api@vger.kernel.org, linux-kbuild@vger.kernel.org Cc: Coly Li , Kent Overstreet , linux-bcache@vger.kernel.org, linux-kernel@vger.kernel.org, dhowells@redhat.com Date: Wed, 05 Sep 2018 16:55:03 +0100 Message-ID: <153616290368.23468.7806230605345568524.stgit@warthog.procyon.org.uk> In-Reply-To: <153616286704.23468.584491117180383924.stgit@warthog.procyon.org.uk> References: <153616286704.23468.584491117180383924.stgit@warthog.procyon.org.uk> User-Agent: StGit/unknown-version MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Wed, 05 Sep 2018 15:55:05 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Wed, 05 Sep 2018 15:55:05 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'dhowells@redhat.com' RCPT:'' Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The bkey struct defined by bcache is embedded in the jset struct. However, this is illegal in C++ as there's a "flexible array" at the end of the struct. Change this to be a 0-length struct instead. Signed-off-by: David Howells cc: Coly Li cc: Kent Overstreet cc: linux-bcache@vger.kernel.org --- include/uapi/linux/bcache.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/uapi/linux/bcache.h b/include/uapi/linux/bcache.h index 5d4f58e059fd..11863e903bff 100644 --- a/include/uapi/linux/bcache.h +++ b/include/uapi/linux/bcache.h @@ -23,7 +23,7 @@ static inline void SET_##name(type *k, __u64 v) \ struct bkey { __u64 high; __u64 low; - __u64 ptr[]; + __u64 ptr[0]; }; #define KEY_FIELD(name, field, offset, size) \ From patchwork Wed Sep 5 15:55:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 10589085 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A5736174C for ; Wed, 5 Sep 2018 15:55:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 937BB288B9 for ; Wed, 5 Sep 2018 15:55:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 86BA628A08; Wed, 5 Sep 2018 15:55:14 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 56521288B9 for ; Wed, 5 Sep 2018 15:55:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727145AbeIEU0A (ORCPT ); Wed, 5 Sep 2018 16:26:00 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:45326 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726189AbeIEUZ7 (ORCPT ); Wed, 5 Sep 2018 16:25:59 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C3940804B4B9; Wed, 5 Sep 2018 15:55:11 +0000 (UTC) Received: from warthog.procyon.org.uk (ovpn-123-84.rdu2.redhat.com [10.10.123.84]) by smtp.corp.redhat.com (Postfix) with ESMTP id CAE9294643; Wed, 5 Sep 2018 15:55:10 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 Subject: [PATCH 05/11] UAPI: coda: Don't use internal kernel structs in UAPI From: David Howells To: linux-api@vger.kernel.org, linux-kbuild@vger.kernel.org Cc: Jan Harkes , coda@cs.cmu.edu, codalist@coda.cs.cmu.edu, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, dhowells@redhat.com Date: Wed, 05 Sep 2018 16:55:10 +0100 Message-ID: <153616291029.23468.16421004714304578585.stgit@warthog.procyon.org.uk> In-Reply-To: <153616286704.23468.584491117180383924.stgit@warthog.procyon.org.uk> References: <153616286704.23468.584491117180383924.stgit@warthog.procyon.org.uk> User-Agent: StGit/unknown-version MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Wed, 05 Sep 2018 15:55:11 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Wed, 05 Sep 2018 15:55:11 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'dhowells@redhat.com' RCPT:'' Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The size and layout of internal kernel structures may not be relied upon outside of the kernel and may even change in a containerised environment if a container image is frozen and shifted to another machine. Excise these from Coda's upc_req struct. Signed-off-by: David Howells cc: Jan Harkes cc: coda@cs.cmu.edu cc: codalist@coda.cs.cmu.edu cc: linux-fsdevel@vger.kernel.org --- include/uapi/linux/coda_psdev.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/uapi/linux/coda_psdev.h b/include/uapi/linux/coda_psdev.h index aa6623efd2dd..9c3acde393cd 100644 --- a/include/uapi/linux/coda_psdev.h +++ b/include/uapi/linux/coda_psdev.h @@ -10,14 +10,18 @@ /* messages between coda filesystem in kernel and Venus */ struct upc_req { +#ifdef __KERNEL__ struct list_head uc_chain; +#endif caddr_t uc_data; u_short uc_flags; u_short uc_inSize; /* Size is at most 5000 bytes */ u_short uc_outSize; u_short uc_opcode; /* copied from data to save lookup */ int uc_unique; +#ifdef __KERNEL__ wait_queue_head_t uc_sleep; /* process' wait queue */ +#endif }; #define CODA_REQ_ASYNC 0x1 From patchwork Wed Sep 5 15:55:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 10589089 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C0DD5112B for ; Wed, 5 Sep 2018 15:55:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AF5D928844 for ; Wed, 5 Sep 2018 15:55:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A35B72895F; Wed, 5 Sep 2018 15:55:24 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 1FB0628844 for ; Wed, 5 Sep 2018 15:55:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727791AbeIEU0H (ORCPT ); Wed, 5 Sep 2018 16:26:07 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:50584 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726189AbeIEU0H (ORCPT ); Wed, 5 Sep 2018 16:26:07 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 80D70400ADE6; Wed, 5 Sep 2018 15:55:18 +0000 (UTC) Received: from warthog.procyon.org.uk (ovpn-123-84.rdu2.redhat.com [10.10.123.84]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6F036202706C; Wed, 5 Sep 2018 15:55:17 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 Subject: [PATCH 06/11] UAPI: netfilter: Fix symbol collision issues From: David Howells To: linux-api@vger.kernel.org, linux-kbuild@vger.kernel.org Cc: netfilter-devel@vger.kernel.org, coreteam@netfilter.org, linux-kernel@vger.kernel.org, dhowells@redhat.com Date: Wed, 05 Sep 2018 16:55:16 +0100 Message-ID: <153616291694.23468.3826354165095743891.stgit@warthog.procyon.org.uk> In-Reply-To: <153616286704.23468.584491117180383924.stgit@warthog.procyon.org.uk> References: <153616286704.23468.584491117180383924.stgit@warthog.procyon.org.uk> User-Agent: StGit/unknown-version MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Wed, 05 Sep 2018 15:55:18 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Wed, 05 Sep 2018 15:55:18 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'dhowells@redhat.com' RCPT:'' Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The netfilter UAPI headers have some symbol collision issues: (1) "enum nfnl_acct_msg_types" is defined twice, and each definition is completely different. Fix this by renaming the one in nfnetlink_cthelper.h to be "enum nfnl_cthelper_types" to be consistent with the other things in that file. (2) There's a disagreement between ipt_ECN.h and ipt_ecn.h over the definition of various IPT_ECN_* constants, leading to an error over IPT_ECN_IP_MASK being substituted when being defined as an enum value in ipt_ecn.h if ipt_ECN.h is #included first. Fix this by removing the conflicting constants from ipt_ECN.h and including ipt_ecn.h instead. Signed-off-by: David Howells cc: netfilter-devel@vger.kernel.org cc: coreteam@netfilter.org --- include/uapi/linux/netfilter/nfnetlink_cthelper.h | 2 +- include/uapi/linux/netfilter_ipv4/ipt_ECN.h | 9 +-------- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/include/uapi/linux/netfilter/nfnetlink_cthelper.h b/include/uapi/linux/netfilter/nfnetlink_cthelper.h index a13137afc429..b9313ed0c313 100644 --- a/include/uapi/linux/netfilter/nfnetlink_cthelper.h +++ b/include/uapi/linux/netfilter/nfnetlink_cthelper.h @@ -5,7 +5,7 @@ #define NFCT_HELPER_STATUS_DISABLED 0 #define NFCT_HELPER_STATUS_ENABLED 1 -enum nfnl_acct_msg_types { +enum nfnl_cthelper_types { NFNL_MSG_CTHELPER_NEW, NFNL_MSG_CTHELPER_GET, NFNL_MSG_CTHELPER_DEL, diff --git a/include/uapi/linux/netfilter_ipv4/ipt_ECN.h b/include/uapi/linux/netfilter_ipv4/ipt_ECN.h index e3630fd045b8..d582119ad62a 100644 --- a/include/uapi/linux/netfilter_ipv4/ipt_ECN.h +++ b/include/uapi/linux/netfilter_ipv4/ipt_ECN.h @@ -12,14 +12,7 @@ #include #include - -#define IPT_ECN_IP_MASK (~XT_DSCP_MASK) - -#define IPT_ECN_OP_SET_IP 0x01 /* set ECN bits of IPv4 header */ -#define IPT_ECN_OP_SET_ECE 0x10 /* set ECE bit of TCP header */ -#define IPT_ECN_OP_SET_CWR 0x20 /* set CWR bit of TCP header */ - -#define IPT_ECN_OP_MASK 0xce +#include struct ipt_ECN_info { __u8 operation; /* bitset of operations */ From patchwork Wed Sep 5 15:55:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 10589091 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0627F174C for ; Wed, 5 Sep 2018 15:55:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E7B5E28844 for ; Wed, 5 Sep 2018 15:55:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DC2272895F; Wed, 5 Sep 2018 15:55:27 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 7A69528844 for ; Wed, 5 Sep 2018 15:55:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727635AbeIEU0O (ORCPT ); Wed, 5 Sep 2018 16:26:14 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:33744 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726189AbeIEU0O (ORCPT ); Wed, 5 Sep 2018 16:26:14 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B7F19DFE5; Wed, 5 Sep 2018 15:55:25 +0000 (UTC) Received: from warthog.procyon.org.uk (ovpn-123-84.rdu2.redhat.com [10.10.123.84]) by smtp.corp.redhat.com (Postfix) with ESMTP id 29983D1CE6; Wed, 5 Sep 2018 15:55:24 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 Subject: [PATCH 07/11] UAPI: nilfs2: Fix use of undefined byteswapping functions From: David Howells To: linux-api@vger.kernel.org, linux-kbuild@vger.kernel.org Cc: Ryusuke Konishi , linux-nilfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, dhowells@redhat.com Date: Wed, 05 Sep 2018 16:55:23 +0100 Message-ID: <153616292366.23468.14988166998690800938.stgit@warthog.procyon.org.uk> In-Reply-To: <153616286704.23468.584491117180383924.stgit@warthog.procyon.org.uk> References: <153616286704.23468.584491117180383924.stgit@warthog.procyon.org.uk> User-Agent: StGit/unknown-version MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Wed, 05 Sep 2018 15:55:25 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Wed, 05 Sep 2018 15:55:25 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'dhowells@redhat.com' RCPT:'' Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP nilfs2 exports a load of inline functions to userspace that call kernel byteswapping functions that don't exist in UAPI. Fix this by making it #include asm/byteorder.h and use the functions declared there. A better way is probably to remove these inline functions from the nilfs2 header since they are technically broken. Signed-off-by: David Howells cc: Ryusuke Konishi cc: linux-nilfs@vger.kernel.org cc: linux-fsdevel@vger.kernel.org --- include/uapi/linux/nilfs2_ondisk.h | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/include/uapi/linux/nilfs2_ondisk.h b/include/uapi/linux/nilfs2_ondisk.h index a7e66ab11d1d..d3bd2fe08791 100644 --- a/include/uapi/linux/nilfs2_ondisk.h +++ b/include/uapi/linux/nilfs2_ondisk.h @@ -29,6 +29,7 @@ #include #include +#include #define NILFS_INODE_BMAP_SIZE 7 @@ -533,19 +534,19 @@ enum { static inline void \ nilfs_checkpoint_set_##name(struct nilfs_checkpoint *cp) \ { \ - cp->cp_flags = cpu_to_le32(le32_to_cpu(cp->cp_flags) | \ + cp->cp_flags = __cpu_to_le32(__le32_to_cpu(cp->cp_flags) | \ (1UL << NILFS_CHECKPOINT_##flag)); \ } \ static inline void \ nilfs_checkpoint_clear_##name(struct nilfs_checkpoint *cp) \ { \ - cp->cp_flags = cpu_to_le32(le32_to_cpu(cp->cp_flags) & \ + cp->cp_flags = __cpu_to_le32(__le32_to_cpu(cp->cp_flags) & \ ~(1UL << NILFS_CHECKPOINT_##flag)); \ } \ static inline int \ nilfs_checkpoint_##name(const struct nilfs_checkpoint *cp) \ { \ - return !!(le32_to_cpu(cp->cp_flags) & \ + return !!(__le32_to_cpu(cp->cp_flags) & \ (1UL << NILFS_CHECKPOINT_##flag)); \ } @@ -595,20 +596,20 @@ enum { static inline void \ nilfs_segment_usage_set_##name(struct nilfs_segment_usage *su) \ { \ - su->su_flags = cpu_to_le32(le32_to_cpu(su->su_flags) | \ + su->su_flags = __cpu_to_le32(__le32_to_cpu(su->su_flags) | \ (1UL << NILFS_SEGMENT_USAGE_##flag));\ } \ static inline void \ nilfs_segment_usage_clear_##name(struct nilfs_segment_usage *su) \ { \ su->su_flags = \ - cpu_to_le32(le32_to_cpu(su->su_flags) & \ + __cpu_to_le32(__le32_to_cpu(su->su_flags) & \ ~(1UL << NILFS_SEGMENT_USAGE_##flag)); \ } \ static inline int \ nilfs_segment_usage_##name(const struct nilfs_segment_usage *su) \ { \ - return !!(le32_to_cpu(su->su_flags) & \ + return !!(__le32_to_cpu(su->su_flags) & \ (1UL << NILFS_SEGMENT_USAGE_##flag)); \ } @@ -619,15 +620,15 @@ NILFS_SEGMENT_USAGE_FNS(ERROR, error) static inline void nilfs_segment_usage_set_clean(struct nilfs_segment_usage *su) { - su->su_lastmod = cpu_to_le64(0); - su->su_nblocks = cpu_to_le32(0); - su->su_flags = cpu_to_le32(0); + su->su_lastmod = __cpu_to_le64(0); + su->su_nblocks = __cpu_to_le32(0); + su->su_flags = __cpu_to_le32(0); } static inline int nilfs_segment_usage_clean(const struct nilfs_segment_usage *su) { - return !le32_to_cpu(su->su_flags); + return !__le32_to_cpu(su->su_flags); } /** From patchwork Wed Sep 5 15:55:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 10589095 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E7C26112B for ; Wed, 5 Sep 2018 15:55:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D6A5D28844 for ; Wed, 5 Sep 2018 15:55:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CAF0628A08; Wed, 5 Sep 2018 15:55:40 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 2EEF228844 for ; Wed, 5 Sep 2018 15:55:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727834AbeIEU0W (ORCPT ); Wed, 5 Sep 2018 16:26:22 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:33756 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726189AbeIEU0V (ORCPT ); Wed, 5 Sep 2018 16:26:21 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6A1857DAC2; Wed, 5 Sep 2018 15:55:32 +0000 (UTC) Received: from warthog.procyon.org.uk (ovpn-123-84.rdu2.redhat.com [10.10.123.84]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7308D2027EB7; Wed, 5 Sep 2018 15:55:31 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 Subject: [PATCH 08/11] UAPI: sound: Fix use of u32 and co. in UAPI headers From: David Howells To: linux-api@vger.kernel.org, linux-kbuild@vger.kernel.org Cc: Jaroslav Kysela , Takashi Iwai , moderated for non-subscribers , linux-kernel@vger.kernel.org, dhowells@redhat.com Date: Wed, 05 Sep 2018 16:55:30 +0100 Message-ID: <153616293089.23468.13515059526628668970.stgit@warthog.procyon.org.uk> In-Reply-To: <153616286704.23468.584491117180383924.stgit@warthog.procyon.org.uk> References: <153616286704.23468.584491117180383924.stgit@warthog.procyon.org.uk> User-Agent: StGit/unknown-version MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Wed, 05 Sep 2018 15:55:32 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Wed, 05 Sep 2018 15:55:32 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'dhowells@redhat.com' RCPT:'' Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Fix the use of u32 and co. in UAPI headers as these are not defined. Switch to using the __u32-style equivalents instead. Signed-off-by: David Howells cc: Jaroslav Kysela cc: Takashi Iwai cc: alsa-devel@alsa-project.org (moderated for non-subscribers) --- include/uapi/sound/skl-tplg-interface.h | 106 ++++++++++++++++--------------- 1 file changed, 54 insertions(+), 52 deletions(-) diff --git a/include/uapi/sound/skl-tplg-interface.h b/include/uapi/sound/skl-tplg-interface.h index f58cafa42f18..f39352cef382 100644 --- a/include/uapi/sound/skl-tplg-interface.h +++ b/include/uapi/sound/skl-tplg-interface.h @@ -10,6 +10,8 @@ #ifndef __HDA_TPLG_INTERFACE_H__ #define __HDA_TPLG_INTERFACE_H__ +#include + /* * Default types range from 0~12. type can range from 0 to 0xff * SST types start at higher to avoid any overlapping in future @@ -143,10 +145,10 @@ enum skl_module_param_type { }; struct skl_dfw_algo_data { - u32 set_params:2; - u32 rsvd:30; - u32 param_id; - u32 max; + __u32 set_params:2; + __u32 rsvd:30; + __u32 param_id; + __u32 max; char params[0]; } __packed; @@ -163,68 +165,68 @@ enum skl_tuple_type { /* v4 configuration data */ struct skl_dfw_v4_module_pin { - u16 module_id; - u16 instance_id; + __u16 module_id; + __u16 instance_id; } __packed; struct skl_dfw_v4_module_fmt { - u32 channels; - u32 freq; - u32 bit_depth; - u32 valid_bit_depth; - u32 ch_cfg; - u32 interleaving_style; - u32 sample_type; - u32 ch_map; + __u32 channels; + __u32 freq; + __u32 bit_depth; + __u32 valid_bit_depth; + __u32 ch_cfg; + __u32 interleaving_style; + __u32 sample_type; + __u32 ch_map; } __packed; struct skl_dfw_v4_module_caps { - u32 set_params:2; - u32 rsvd:30; - u32 param_id; - u32 caps_size; - u32 caps[HDA_SST_CFG_MAX]; + __u32 set_params:2; + __u32 rsvd:30; + __u32 param_id; + __u32 caps_size; + __u32 caps[HDA_SST_CFG_MAX]; } __packed; struct skl_dfw_v4_pipe { - u8 pipe_id; - u8 pipe_priority; - u16 conn_type:4; - u16 rsvd:4; - u16 memory_pages:8; + __u8 pipe_id; + __u8 pipe_priority; + __u16 conn_type:4; + __u16 rsvd:4; + __u16 memory_pages:8; } __packed; struct skl_dfw_v4_module { char uuid[SKL_UUID_STR_SZ]; - u16 module_id; - u16 instance_id; - u32 max_mcps; - u32 mem_pages; - u32 obs; - u32 ibs; - u32 vbus_id; - - u32 max_in_queue:8; - u32 max_out_queue:8; - u32 time_slot:8; - u32 core_id:4; - u32 rsvd1:4; - - u32 module_type:8; - u32 conn_type:4; - u32 dev_type:4; - u32 hw_conn_type:4; - u32 rsvd2:12; - - u32 params_fixup:8; - u32 converter:8; - u32 input_pin_type:1; - u32 output_pin_type:1; - u32 is_dynamic_in_pin:1; - u32 is_dynamic_out_pin:1; - u32 is_loadable:1; - u32 rsvd3:11; + __u16 module_id; + __u16 instance_id; + __u32 max_mcps; + __u32 mem_pages; + __u32 obs; + __u32 ibs; + __u32 vbus_id; + + __u32 max_in_queue:8; + __u32 max_out_queue:8; + __u32 time_slot:8; + __u32 core_id:4; + __u32 rsvd1:4; + + __u32 module_type:8; + __u32 conn_type:4; + __u32 dev_type:4; + __u32 hw_conn_type:4; + __u32 rsvd2:12; + + __u32 params_fixup:8; + __u32 converter:8; + __u32 input_pin_type:1; + __u32 output_pin_type:1; + __u32 is_dynamic_in_pin:1; + __u32 is_dynamic_out_pin:1; + __u32 is_loadable:1; + __u32 rsvd3:11; struct skl_dfw_v4_pipe pipe; struct skl_dfw_v4_module_fmt in_fmt[MAX_IN_QUEUE]; From patchwork Wed Sep 5 15:55:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 10589101 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B4504112B for ; Wed, 5 Sep 2018 15:55:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9DE2728844 for ; Wed, 5 Sep 2018 15:55:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8EFA32895F; Wed, 5 Sep 2018 15:55:45 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=unavailable 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 33DAD28844 for ; Wed, 5 Sep 2018 15:55:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727860AbeIEU01 (ORCPT ); Wed, 5 Sep 2018 16:26:27 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:50592 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726189AbeIEU01 (ORCPT ); Wed, 5 Sep 2018 16:26:27 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 09A9D4026128; Wed, 5 Sep 2018 15:55:39 +0000 (UTC) Received: from warthog.procyon.org.uk (ovpn-123-84.rdu2.redhat.com [10.10.123.84]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2082F2156701; Wed, 5 Sep 2018 15:55:38 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 Subject: [PATCH 09/11] UAPI: ndctl: Fix g++-unsupported initialisation in headers From: David Howells To: linux-api@vger.kernel.org, linux-kbuild@vger.kernel.org Cc: Dan Williams , linux-nvdimm@lists.01.org, linux-kernel@vger.kernel.org, dhowells@redhat.com Date: Wed, 05 Sep 2018 16:55:37 +0100 Message-ID: <153616293757.23468.13765050528392604035.stgit@warthog.procyon.org.uk> In-Reply-To: <153616286704.23468.584491117180383924.stgit@warthog.procyon.org.uk> References: <153616286704.23468.584491117180383924.stgit@warthog.procyon.org.uk> User-Agent: StGit/unknown-version MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Wed, 05 Sep 2018 15:55:39 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Wed, 05 Sep 2018 15:55:39 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'dhowells@redhat.com' RCPT:'' Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The following code in the linux/ndctl header file: static inline const char *nvdimm_bus_cmd_name(unsigned cmd) { static const char * const names[] = { [ND_CMD_ARS_CAP] = "ars_cap", [ND_CMD_ARS_START] = "ars_start", [ND_CMD_ARS_STATUS] = "ars_status", [ND_CMD_CLEAR_ERROR] = "clear_error", [ND_CMD_CALL] = "cmd_call", }; if (cmd < ARRAY_SIZE(names) && names[cmd]) return names[cmd]; return "unknown"; } is broken in a number of ways: (1) ARRAY_SIZE() is not generally defined. Fix this by defining a label in the enum that indicates the number of commands. (2) g++ does not support "non-trivial" array initialisers fully yet. Fix this by defining the missing intermediate values. (3) Every file that calls this function will acquire a copy of names[]. The same goes for nvdimm_cmd_name(). A better way would be to remove these functions and their arrays from the header entirely. Signed-off-by: David Howells cc: Dan Williams cc: linux-nvdimm@lists.01.org --- include/uapi/linux/ndctl.h | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/include/uapi/linux/ndctl.h b/include/uapi/linux/ndctl.h index 7e27070b9440..9c89159f6a0f 100644 --- a/include/uapi/linux/ndctl.h +++ b/include/uapi/linux/ndctl.h @@ -117,6 +117,7 @@ enum { ND_CMD_VENDOR_EFFECT_LOG = 8, ND_CMD_VENDOR = 9, ND_CMD_CALL = 10, + nr__ND_CMD = 11 }; enum { @@ -128,22 +129,29 @@ enum { static inline const char *nvdimm_bus_cmd_name(unsigned cmd) { - static const char * const names[] = { + static const char * const names[nr__ND_CMD] = { + [0] = NULL, [ND_CMD_ARS_CAP] = "ars_cap", [ND_CMD_ARS_START] = "ars_start", [ND_CMD_ARS_STATUS] = "ars_status", [ND_CMD_CLEAR_ERROR] = "clear_error", + [5] = NULL, + [6] = NULL, + [7] = NULL, + [8] = NULL, + [9] = NULL, [ND_CMD_CALL] = "cmd_call", }; - if (cmd < ARRAY_SIZE(names) && names[cmd]) + if (cmd < nr__ND_CMD && names[cmd]) return names[cmd]; return "unknown"; } static inline const char *nvdimm_cmd_name(unsigned cmd) { - static const char * const names[] = { + static const char * const names[nr__ND_CMD] = { + [0] = NULL, [ND_CMD_SMART] = "smart", [ND_CMD_SMART_THRESHOLD] = "smart_thresh", [ND_CMD_DIMM_FLAGS] = "flags", @@ -156,7 +164,7 @@ static inline const char *nvdimm_cmd_name(unsigned cmd) [ND_CMD_CALL] = "cmd_call", }; - if (cmd < ARRAY_SIZE(names) && names[cmd]) + if (cmd < nr__ND_CMD && names[cmd]) return names[cmd]; return "unknown"; } From patchwork Wed Sep 5 15:55:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 10589103 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3CA3B112B for ; Wed, 5 Sep 2018 15:55:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2A3CD28844 for ; Wed, 5 Sep 2018 15:55:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1E2CC28AF9; Wed, 5 Sep 2018 15:55:47 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 B825C288B9 for ; Wed, 5 Sep 2018 15:55:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727876AbeIEU0d (ORCPT ); Wed, 5 Sep 2018 16:26:33 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:34108 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726189AbeIEU0d (ORCPT ); Wed, 5 Sep 2018 16:26:33 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 81C7A40216E3; Wed, 5 Sep 2018 15:55:45 +0000 (UTC) Received: from warthog.procyon.org.uk (ovpn-123-84.rdu2.redhat.com [10.10.123.84]) by smtp.corp.redhat.com (Postfix) with ESMTP id AFD782156701; Wed, 5 Sep 2018 15:55:44 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 Subject: [PATCH 10/11] UAPI: ndctl: Remove use of PAGE_SIZE From: David Howells To: linux-api@vger.kernel.org, linux-kbuild@vger.kernel.org Cc: Dan Williams , linux-nvdimm@lists.01.org, linux-kernel@vger.kernel.org, dhowells@redhat.com Date: Wed, 05 Sep 2018 16:55:44 +0100 Message-ID: <153616294415.23468.9444162145650526598.stgit@warthog.procyon.org.uk> In-Reply-To: <153616286704.23468.584491117180383924.stgit@warthog.procyon.org.uk> References: <153616286704.23468.584491117180383924.stgit@warthog.procyon.org.uk> User-Agent: StGit/unknown-version MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Wed, 05 Sep 2018 15:55:45 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Wed, 05 Sep 2018 15:55:45 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'dhowells@redhat.com' RCPT:'' Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The macro PAGE_SIZE isn't valid outside of the kernel, so it should not appear in UAPI headers. Furthermore, the actual machine page size could theoretically change from an application's point of view if it's running in a container that gets migrated to another machine (say 4K/ppc64 to 64K/ppc64). Fixes: f2ba5a5baecf ("libnvdimm, namespace: make min namespace size 4K") Signed-off-by: David Howells cc: Dan Williams cc: linux-nvdimm@lists.01.org --- include/linux/ndctl.h | 22 ++++++++++++++++++++++ include/uapi/linux/ndctl.h | 4 ---- 2 files changed, 22 insertions(+), 4 deletions(-) create mode 100644 include/linux/ndctl.h diff --git a/include/linux/ndctl.h b/include/linux/ndctl.h new file mode 100644 index 000000000000..cd5a293ce3ae --- /dev/null +++ b/include/linux/ndctl.h @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2014-2016, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU Lesser General Public License, + * version 2.1, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for + * more details. + */ +#ifndef _LINUX_NDCTL_H +#define _LINUX_NDCTL_H + +#include + +enum { + ND_MIN_NAMESPACE_SIZE = PAGE_SIZE, +}; + +#endif /* _LINUX_NDCTL_H */ diff --git a/include/uapi/linux/ndctl.h b/include/uapi/linux/ndctl.h index 9c89159f6a0f..bcda968e6d80 100644 --- a/include/uapi/linux/ndctl.h +++ b/include/uapi/linux/ndctl.h @@ -216,10 +216,6 @@ enum nd_driver_flags { ND_DRIVER_DAX_PMEM = 1 << ND_DEVICE_DAX_PMEM, }; -enum { - ND_MIN_NAMESPACE_SIZE = PAGE_SIZE, -}; - enum ars_masks { ARS_STATUS_MASK = 0x0000FFFF, ARS_EXT_STATUS_SHIFT = 16, From patchwork Wed Sep 5 15:55:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 10589107 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 604D9174C for ; Wed, 5 Sep 2018 15:55:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4CA1C28844 for ; Wed, 5 Sep 2018 15:55:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3E6E92895F; Wed, 5 Sep 2018 15:55:55 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 8287728844 for ; Wed, 5 Sep 2018 15:55:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727201AbeIEU0l (ORCPT ); Wed, 5 Sep 2018 16:26:41 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:51494 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726189AbeIEU0l (ORCPT ); Wed, 5 Sep 2018 16:26:41 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2138587927; Wed, 5 Sep 2018 15:55:52 +0000 (UTC) Received: from warthog.procyon.org.uk (ovpn-123-84.rdu2.redhat.com [10.10.123.84]) by smtp.corp.redhat.com (Postfix) with ESMTP id 350332166BA1; Wed, 5 Sep 2018 15:55:51 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 Subject: [PATCH 11/11] UAPI: Check headers build for C++ From: David Howells To: linux-api@vger.kernel.org, linux-kbuild@vger.kernel.org Cc: Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org, dhowells@redhat.com Date: Wed, 05 Sep 2018 16:55:50 +0100 Message-ID: <153616295066.23468.6133013878008690375.stgit@warthog.procyon.org.uk> In-Reply-To: <153616286704.23468.584491117180383924.stgit@warthog.procyon.org.uk> References: <153616286704.23468.584491117180383924.stgit@warthog.procyon.org.uk> User-Agent: StGit/unknown-version MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Wed, 05 Sep 2018 15:55:52 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Wed, 05 Sep 2018 15:55:52 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'dhowells@redhat.com' RCPT:'' Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Check that all the headers can be included from one file and built for C++, thereby catching the use of C++ reserved words and bits of unimplemented C++ in the UAPI headers. Note that certain headers are excluded from the build, including: (1) Any header ending in "_32.h", "_64.h" or "_x32.h" as these are expected to be multiarch variant headers. (2) Endianness variant headers. (3) asm-generic/ headers (they're used conditionally by the asm/ headers and shouldn't be used directly). (4) netfilter_ipv*/ip*t_LOG.h headers. They emit a warning indicating they're going to be removed soon. Signed-off-by: David Howells cc: Masahiro Yamada cc: Michal Marek cc: linux-kbuild@vger.kernel.org --- Makefile | 1 scripts/headers-c++.sh | 124 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 125 insertions(+) create mode 100755 scripts/headers-c++.sh diff --git a/Makefile b/Makefile index 2b458801ba74..f3c36c2bb4cf 100644 --- a/Makefile +++ b/Makefile @@ -1183,6 +1183,7 @@ headers_install: __headers $(error Headers not exportable for the $(SRCARCH) architecture)) $(Q)$(MAKE) $(hdr-inst)=include/uapi dst=include $(Q)$(MAKE) $(hdr-inst)=arch/$(SRCARCH)/include/uapi $(hdr-dst) + $(Q)$(CONFIG_SHELL) $(srctree)/scripts/headers-c++.sh check PHONY += headers_check_all headers_check_all: headers_install_all diff --git a/scripts/headers-c++.sh b/scripts/headers-c++.sh new file mode 100755 index 000000000000..7e56913629f8 --- /dev/null +++ b/scripts/headers-c++.sh @@ -0,0 +1,124 @@ +#!/bin/sh +# SPDX-License-Identifier: GPL-2.0 +# Run headers_$1 command for all suitable architectures + +# Stop on error +set -e + +if ! $CC -x c++ -c - -o /dev/null /dev/null +then + echo " CHECK C++ HEADER COMPILATION [SKIPPED]" + exit 0 +fi + +echo " CHECK C++ HEADER COMPILATION" + +mkdir -p hdr-check +cd hdr-check + +mkdir -p include/sys +mkdir -p include/arpa +mkdir -p include/xen/interface +echo >include/endian.h +echo >include/limits.h +echo >include/stdint.h +echo >include/stdlib.h +echo >include/stdio.h +echo >include/string.h +echo >include/time.h +echo >include/unistd.h +echo >include/arpa/inet.h +echo >include/sys/ioctl.h +echo >include/sys/types.h +echo >include/sys/time.h +echo >include/sys/socket.h +echo >include/xen/interface/xen.h + +cat >test.h < +#include +#include + +typedef __s8 int8_t; +typedef __s16 int16_t; +typedef __s32 int32_t; +typedef __s64 int64_t; +typedef __u8 uint8_t; +typedef __u16 uint16_t; +typedef __u32 uint32_t; +typedef __u64 uint64_t; +typedef long int intptr_t; +typedef unsigned long int uintptr_t; +typedef unsigned short u_short; +typedef unsigned int u_int; +typedef unsigned long u_long; +typedef char *caddr_t; + +typedef __kernel_clockid_t clockid_t; +typedef __kernel_ino_t ino_t; +typedef __kernel_pid_t pid_t; +typedef __kernel_sa_family_t sa_family_t; +typedef __kernel_size_t size_t; +typedef __kernel_uid_t uid_t; + +typedef unsigned long elf_greg_t; +typedef elf_greg_t elf_gregset_t[1]; +typedef unsigned long long elf_fpregset_t[1]; +typedef unsigned long long elf_fpxregset_t[1]; + +#define INT_MIN ((int)0x80000000) +#define INT_MAX ((int)0x7fffffff) + +extern size_t strlen(const char *); +extern void *memset(void *, int, size_t); +extern void *memcpy(void *, const void *, size_t); +extern __u16 ntohs(__u16); +extern __u16 htons(__u16); +extern __u32 ntohl(__u32); +extern __u32 htonl(__u32); + +typedef uint32_t grant_ref_t; +typedef uint16_t domid_t; +typedef unsigned long xen_pfn_t; + +#define MSG_FIN 0x200 + +typedef int SVGA3dMSPattern; +typedef int SVGA3dMSQualityLevel; + +struct sockaddr +{ + sa_family_t sa_family; + char sa_data[14]; +}; +#define sockaddr_storage __kernel_sockaddr_storage + +#define _LINUX_PATCHKEY_H_INDIRECT + +EOF + +find ../usr/include -name '*.h' | + grep -v 'linux/byteorder/big_endian.h' | + grep -v 'linux/byteorder/little_endian.h' | + grep -v '_\(32\|64\|x32\)[.]h$' | + grep -v '/asm-generic/' | + # ip*t_LOG.h are deprecated + grep -v 'linux/netfilter_ipv4/ipt_LOG[.]h' | + grep -v 'linux/netfilter_ipv6/ip6t_LOG[.]h' | + sed -e 's!../usr/include/!#include !' >>test.h + +echo '#include "test.h"' >test.cpp + +$CC -x c++ -o /dev/null -c test.cpp \ + -nostdinc \ + -isystem ./include \ + -isystem ../usr/include \ + -fpermissive \ + -D PAGE_SIZE='#PAGE_SIZE_IS_NOT_VALID_OUTSIDE_OF_KERNEL'