From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konstantin Ryabitsev Date: Thu, 01 Sep 2022 15:28:53 -0400 Subject: [PATCH v5 08/21] psci: Fix the function type for psci_initcall_t MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Message-Id: <20220901-kcfi_support-v5-8-be2007d8da63@linuxfoundation.org> References: <20220901-kcfi_support-v5-0-be2007d8da63@linuxfoundation.org> In-Reply-To: <20220901-kcfi_support-v5-0-be2007d8da63@linuxfoundation.org> To: mricon@kernel.org X-Mailer: b4 0.10.0-dev-03aea X-Developer-Signature: v=1; a=openpgp-sha256; l=1652; i=konstantin@linuxfoundation.org; h=from:subject:message-id; bh=VQyqr/oVocdsEsziUvpbjifYbypg4sUuWX/HDGRqAT8=; b=owGbwMvMwCW27YjM47CUmTmMp9WSGJIF2X+tqWD1nMnrU20oNPVM7TXX53o3wqf6XJx4YlZsS6bp xjeyHaUsDGJcDLJiiixl+2I3BRU+9JBL7zGFmcPKBDKEgYtTACYSb8vIMPXXnY2e+68EGmjNOjp1/d ror3kPZi6fN2/ZIma9x5+vRvAyMizpOJ+z995znfgilUelh64eSYk9cOaKvrHz0uNZf6dsKmMAAA== X-Developer-Key: i=konstantin@linuxfoundation.org; a=openpgp; fpr=DE0E66E32F1FDD0902666B96E63EDCA9329DD07E X-Endpoint-Received: by B4 Submission Endpoint for konstantin@linuxfoundation.org/default with auth_id=3 List-Id: B4 Web Endpoint Patches From: Sami Tolvanen Functions called through a psci_initcall_t pointer all have non-const arguments. Fix the type definition to avoid tripping indirect call checks with CFI_CLANG. Suggested-by: Mark Rutland Signed-off-by: Sami Tolvanen Reviewed-by: Kees Cook Tested-by: Kees Cook diff --git a/drivers/firmware/psci/psci.c b/drivers/firmware/psci/psci.c index cfb448eabdaa..75ef784a3789 100644 --- a/drivers/firmware/psci/psci.c +++ b/drivers/firmware/psci/psci.c @@ -274,7 +274,7 @@ static void set_conduit(enum arm_smccc_conduit conduit) psci_conduit = conduit; } -static int get_set_conduit_method(struct device_node *np) +static int get_set_conduit_method(const struct device_node *np) { const char *method; @@ -528,7 +528,7 @@ typedef int (*psci_initcall_t)(const struct device_node *); * * Probe based on PSCI PSCI_VERSION function */ -static int __init psci_0_2_init(struct device_node *np) +static int __init psci_0_2_init(const struct device_node *np) { int err; @@ -549,7 +549,7 @@ static int __init psci_0_2_init(struct device_node *np) /* * PSCI < v0.2 get PSCI Function IDs via DT. */ -static int __init psci_0_1_init(struct device_node *np) +static int __init psci_0_1_init(const struct device_node *np) { u32 id; int err; @@ -585,7 +585,7 @@ static int __init psci_0_1_init(struct device_node *np) return 0; } -static int __init psci_1_0_init(struct device_node *np) +static int __init psci_1_0_init(const struct device_node *np) { int err; -- b4 0.10.0-dev-03aea