diff mbox

[3/3] ARM64: make of_device_ids const

Message ID 1410337579-23466-4-git-send-email-u.kleine-koenig@pengutronix.de
State New
Headers show

Commit Message

Uwe Kleine-König Sept. 10, 2014, 8:26 a.m. UTC
of_device_ids (i.e. compatible strings and the respective data) are not
supposed to change at runtime. All functions working with of_device_ids
provided by <linux/of.h> work with const of_device_ids. So mark the
only non-const struct in arch/arm64 as const, too.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 arch/arm64/kernel/perf_event.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Catalin Marinas Sept. 15, 2014, 1:11 p.m. UTC | #1
On Wed, Sep 10, 2014 at 09:26:19AM +0100, Uwe Kleine-König wrote:
> of_device_ids (i.e. compatible strings and the respective data) are not
> supposed to change at runtime. All functions working with of_device_ids
> provided by <linux/of.h> work with const of_device_ids. So mark the
> only non-const struct in arch/arm64 as const, too.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
>  arch/arm64/kernel/perf_event.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arm64/kernel/perf_event.c b/arch/arm64/kernel/perf_event.c
> index baf5afb7e6a0..aa29ecb4f800 100644
> --- a/arch/arm64/kernel/perf_event.c
> +++ b/arch/arm64/kernel/perf_event.c
> @@ -1276,7 +1276,7 @@ arch_initcall(cpu_pmu_reset);
>  /*
>   * PMU platform driver and devicetree bindings.
>   */
> -static struct of_device_id armpmu_of_device_ids[] = {
> +static const struct of_device_id armpmu_of_device_ids[] = {
>  	{.compatible = "arm,armv8-pmuv3"},
>  	{},
>  };

Acked-by: Catalin Marinas <catalin.marinas@arm.com>

(I guess you could upstream the patches via the arm-soc tree)
diff mbox

Patch

diff --git a/arch/arm64/kernel/perf_event.c b/arch/arm64/kernel/perf_event.c
index baf5afb7e6a0..aa29ecb4f800 100644
--- a/arch/arm64/kernel/perf_event.c
+++ b/arch/arm64/kernel/perf_event.c
@@ -1276,7 +1276,7 @@  arch_initcall(cpu_pmu_reset);
 /*
  * PMU platform driver and devicetree bindings.
  */
-static struct of_device_id armpmu_of_device_ids[] = {
+static const struct of_device_id armpmu_of_device_ids[] = {
 	{.compatible = "arm,armv8-pmuv3"},
 	{},
 };