Skip to content

Commit 44f665b

Browse files
samitolvanenkees
authored andcommitted
psci: Fix the function type for psci_initcall_t
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 <[email protected]> Signed-off-by: Sami Tolvanen <[email protected]> Reviewed-by: Kees Cook <[email protected]> Tested-by: Kees Cook <[email protected]> Tested-by: Nathan Chancellor <[email protected]> Acked-by: Peter Zijlstra (Intel) <[email protected]> Tested-by: Peter Zijlstra (Intel) <[email protected]> Signed-off-by: Kees Cook <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent cf90d03 commit 44f665b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/firmware/psci/psci.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ static void set_conduit(enum arm_smccc_conduit conduit)
274274
psci_conduit = conduit;
275275
}
276276

277-
static int get_set_conduit_method(struct device_node *np)
277+
static int get_set_conduit_method(const struct device_node *np)
278278
{
279279
const char *method;
280280

@@ -528,7 +528,7 @@ typedef int (*psci_initcall_t)(const struct device_node *);
528528
*
529529
* Probe based on PSCI PSCI_VERSION function
530530
*/
531-
static int __init psci_0_2_init(struct device_node *np)
531+
static int __init psci_0_2_init(const struct device_node *np)
532532
{
533533
int err;
534534

@@ -549,7 +549,7 @@ static int __init psci_0_2_init(struct device_node *np)
549549
/*
550550
* PSCI < v0.2 get PSCI Function IDs via DT.
551551
*/
552-
static int __init psci_0_1_init(struct device_node *np)
552+
static int __init psci_0_1_init(const struct device_node *np)
553553
{
554554
u32 id;
555555
int err;
@@ -585,7 +585,7 @@ static int __init psci_0_1_init(struct device_node *np)
585585
return 0;
586586
}
587587

588-
static int __init psci_1_0_init(struct device_node *np)
588+
static int __init psci_1_0_init(const struct device_node *np)
589589
{
590590
int err;
591591

0 commit comments

Comments
 (0)