Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp1382633ybm; Sat, 30 May 2020 07:15:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxjSpIGbUJn4xxnJXFlBxUEaK+Y8GM+/TsxI9vEgUikeX3cnzrKrOTBzhTnB5i2YmKydJCR X-Received: by 2002:a17:906:1c4a:: with SMTP id l10mr11280112ejg.499.1590848138886; Sat, 30 May 2020 07:15:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590848138; cv=none; d=google.com; s=arc-20160816; b=samRqEwt7irySiYR0c7G1eCWOwLt2T+XPBamCPLgArgvaJjG2Im4IVglltKTEWBMf/ DVEKbHghQR62erpsgG2KbACQ5XGGfNQY4qQJ7iFJapCfOc6QqbjZebq3ASY+SEGEJ4nD pNNZC7A6wGyiKkmPTiBe32DxYhaVcGo/y2NRNb6bjJ7jzVxNeCXaDmXOsAega9QO6PAX urOlziFEPsV8fg4KEmL6YKlm8Qpo/jQimoZeiblRVbTT7MmfxwQ0iLxWKo9EsK6Fk+uf iNjS8I4GY6eINY7K7RW8kuxZaM0JYBFtB3jsDN+KquDGE2taoBc1f58Mwf9t8v0fv5fU UR2Q== 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 :dkim-signature; bh=hsGRpXVRieG8saSK6jka4x09LP2ZvOJ079PBWsk4HSA=; b=DsybSuTyo9UJn8nql1JlFjbg/qvH/CVZnKI2m2bjy6mn3F8yET+ssGpmxOGkIb4E+U mKGbZCFweQfnoUQ9iv7l6dwSrsIMpe6CHuBrH1dVxPTkvnDb+AYcPjjFhwPaMUNKJQOf o6s70hfW/LnIcYcNdQ8AIYL5WXWt+InIFby6cFSu00UjP3tzAcvfasp0MLlQZvEVGizq TPSNJedNVU3lk/PcFrTd8TXmJmY4wcRJC9D5+ezqQcFCMpc0l7uUabTSJtNsieZz64GM 1NhkVi3tjVv5272+r1onkK68U1u3gGjbKKQ+ZFMTTrgvB2eZuGEwpHFFjIisF9N8MvZY caaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=SXoQBLmA; 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 f4si7081239ejb.362.2020.05.30.07.15.16; Sat, 30 May 2020 07:15:38 -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; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=SXoQBLmA; 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 S1729096AbgE3ONR (ORCPT + 99 others); Sat, 30 May 2020 10:13:17 -0400 Received: from mout.gmx.net ([212.227.15.19]:42551 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727851AbgE3ONN (ORCPT ); Sat, 30 May 2020 10:13:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1590847972; bh=WpWBS1h4iFsnXoGPg78caQDYyu6KqHawDxsVmNiamSU=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=SXoQBLmAwSGqo4tCeYU/Zx9q0f8qgnTmsZDu0G7HdehPbWQCuNOyWD4hlShL3v1wU V4kvaRPWDV8F03mTCEs9zNuwGmN5D5Ta3KTD6Lz2yK0ctUboEri3uCTOLlm5ypOuya 41N0gKDM6Bu8g+tk8Cer+K8PeREDkRODuJ/oc7SY= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([83.52.229.196]) by mail.gmx.com (mrgmx005 [212.227.17.184]) with ESMTPSA (Nemesis) id 1M3lY1-1jelFI3W2V-000xcB; Sat, 30 May 2020 16:12:52 +0200 From: Oscar Carter To: Kees Cook , Thomas Gleixner , Jason Cooper , Marc Zyngier , "Rafael J. Wysocki" , Len Brown Cc: Oscar Carter , kernel-hardening@lists.openwall.com, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org Subject: [PATCH v4 1/3] drivers/acpi: Add new macro ACPI_DECLARE_SUBTABLE_PROBE_ENTRY Date: Sat, 30 May 2020 16:12:16 +0200 Message-Id: <20200530141218.4690-2-oscar.carter@gmx.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200530141218.4690-1-oscar.carter@gmx.com> References: <20200530141218.4690-1-oscar.carter@gmx.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:/rzWHQBS9mAF5Dq69ySv2ghKTMSNoHsXtrY06FlbNlCLctBog2h GquuZ3gO8MDe6A8Z2BaeYjzuJ3fh0mT886iSp+41lefypofuNPMxqsapdxBE/HvGX24Ad+c x01aB3qMVALCkK4+nFlABsd3pJnKDuOUSKfFoUNRwgnmSU04m+fnLHMLN9HJoOvAEV5W+Ev aexHAq7rgG/Pz+XyFr/ZQ== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:rZJg1BspP+4=:g9tGS7uJEgIj9WdvSdDiK5 eJGRfi22XrohexF0AwzPv1+wsZtsv3A5+ArDMBs8BzoRlBQ//i9qJQnzC4uaA19S+tINecsYU B0Yf9/pnsP8FRRqouS6MW5Nc8Eere+xEh88Er04vnu5SacWm3uFp2y1HGTb73EINDQ2c1thb/ Pz5urOY1VyPyy+DHe0Txhz0V8E639SStcjTVUIHzY6zvGGNJCfwCKwk9m7Arm8ArWOSQW9LXN ybRUWSmBZAPJiFVBqI7WkY13i0CTebH/dAIk0462nnEunCZ5E64LQQv4J6LGYPMBKvDQ0+WvR lRUK2MxwSUFGeUvigQBJdQ2QybiS0dOe5vYHcbn/ahpfbAPUub/razB5lOWwb/xKvqjIXKQYW tBLSv7k8dSf63PlrvG2wR0r6YbLan53+GCYNY1kwvNRj98/vS7lXZEv7ps2BZvlIrSE3DE0yN N4i9tAsjGoA/PAfs6YBO6KqNHANA4hyL3NCmL4h/vTfjDksKXXKGPuSO42nGrucLI1abHl/xX 2mthkRQfb0Wf7BBWVhkXiPNgJavDKmfgzj5WSv/zHkwORdvS3OPLN2QcupgSxvudMzaW3TDFr nLm37xUgf7JRFZaxer5RKDE4tIKIo0im/ZnBsEy2QTkJau+pXpwaKo4Gm7b0C7YqLra5XRIyi bd6r6cZnQEG32eQ8hlZJtmeQGBdD2dpluaeA82CNVchtd/l6/bZ8gLKfLX1lKbmLSOftGiCzI aFaXA5l3eo5Ar9kYQyKeWEwa6WgHRBt3vtrCKU+PeNMzjuqW004WZ8dccclcrkQE8/V9LJL0i JLFBoUy86NzTfw7ONaDYgoJPXqIKUcyOYq13ZLmhE5CtBSS48D0RGiiNbTS78newGnjkq+8bQ V3ZDeVM6UVtDWW7aIttkpsugnBkIOy5sHxJtjUgeQtFXKAhR6JoUhzKuINzkcT3IxMG7ZL/V9 tTYltu9MYlbXO0w+Ag6mKEiTQIzHohiQCeR2vfJW+IdtWwTz49HVnlKT4aQ45kdF1RH2PSu62 /bY+fMKsErE9Aj2aRx9DbZUaWC5cCJirEhaz+w5pt0gOcFm4eGvl2+RZvbCbZuNmGkUH41BFB 5E+kIWR6gfaOZxFr/gVWmXzI02dIeHXBxxutqTiZMQKR6xnSfyj0twurmm+m5Nk6ETzVAqso1 3KhjSLlShUEdFu3+YEjFuVODEvpO6CJCSaPmonG3Y4M64nF+3EHphKxjjpoQHfJca+gmdzdRD Xk2glYlcudPVNtjTT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In an effort to enable -Wcast-function-type in the top-level Makefile to support Control Flow Integrity builds, there are the need to remove all the function callback casts. To do this, create a new macro called ACPI_DECLARE_SUBTABLE_PROBE_ENTRY to initialize the acpi_probe_entry struct using the probe_subtbl field instead of the probe_table field. This is a previous work to be able to modify the IRQCHIP_ACPI_DECLARE macro to use this new defined macro. Even though these two commented fields are part of a union, this is necessary to avoid function cast mismatches. That is, due to the IRQCHIP_ACPI_DECLARE invocations use as last parameter a function with the protoype "int (*func)(struct acpi_subtable_header *, const unsigned long)" it's necessary that this macro initialize the probe_subtbl field of the acpi_probe_entry struct and not the probe_table field. Signed-off-by: Oscar Carter =2D-- include/linux/acpi.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/include/linux/acpi.h b/include/linux/acpi.h index d661cd0ee64d..cf74e044a570 100644 =2D-- a/include/linux/acpi.h +++ b/include/linux/acpi.h @@ -1154,6 +1154,17 @@ struct acpi_probe_entry { .driver_data =3D data, \ } +#define ACPI_DECLARE_SUBTABLE_PROBE_ENTRY(table, name, table_id, \ + subtable, valid, data, fn) \ + static const struct acpi_probe_entry __acpi_probe_##name \ + __used __section(__##table##_acpi_probe_table) =3D { \ + .id =3D table_id, \ + .type =3D subtable, \ + .subtable_valid =3D valid, \ + .probe_subtbl =3D fn, \ + .driver_data =3D data, \ + } + #define ACPI_PROBE_TABLE(name) __##name##_acpi_probe_table #define ACPI_PROBE_TABLE_END(name) __##name##_acpi_probe_table_end =2D- 2.20.1