drm/amd/powerplay: Mark pem_event_action chains as const
authorNils Wallménius <nils.wallmenius@gmail.com>
Sun, 10 Apr 2016 14:30:02 +0000 (16:30 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 5 May 2016 00:20:13 +0000 (20:20 -0400)
As these arrays were of pointer to pointer type, they were
pointer to pointer to const. Make them pointer to const
pointer to const.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Nils Wallménius <nils.wallmenius@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/powerplay/eventmgr/eventactionchains.c
drivers/gpu/drm/amd/powerplay/eventmgr/eventmanagement.c
drivers/gpu/drm/amd/powerplay/inc/eventmgr.h

index 56856a2864d108c89cb2a961398f8f3613159fcc..d6635cc4b0fc046bcee3ebf5885dfd9b23229f6b 100644 (file)
@@ -24,7 +24,7 @@
 #include "eventactionchains.h"
 #include "eventsubchains.h"
 
-static const pem_event_action *initialize_event[] = {
+static const pem_event_action * const initialize_event[] = {
        block_adjust_power_state_tasks,
        power_budget_tasks,
        system_config_tasks,
@@ -45,7 +45,7 @@ const struct action_chain initialize_action_chain = {
        initialize_event
 };
 
-static const pem_event_action *uninitialize_event[] = {
+static const pem_event_action * const uninitialize_event[] = {
        ungate_all_display_phys_tasks,
        uninitialize_display_phy_access_tasks,
        disable_gfx_voltage_island_power_gating_tasks,
@@ -64,7 +64,7 @@ const struct action_chain uninitialize_action_chain = {
        uninitialize_event
 };
 
-static const pem_event_action *power_source_change_event_pp_enabled[] = {
+static const pem_event_action * const power_source_change_event_pp_enabled[] = {
        set_power_source_tasks,
        set_power_saving_state_tasks,
        adjust_power_state_tasks,
@@ -79,7 +79,7 @@ const struct action_chain power_source_change_action_chain_pp_enabled = {
        power_source_change_event_pp_enabled
 };
 
-static const pem_event_action *power_source_change_event_pp_disabled[] = {
+static const pem_event_action * const power_source_change_event_pp_disabled[] = {
        set_power_source_tasks,
        set_nbmcu_state_tasks,
        NULL
@@ -90,7 +90,7 @@ const struct action_chain power_source_changes_action_chain_pp_disabled = {
        power_source_change_event_pp_disabled
 };
 
-static const pem_event_action *power_source_change_event_hardware_dc[] = {
+static const pem_event_action * const power_source_change_event_hardware_dc[] = {
        set_power_source_tasks,
        set_power_saving_state_tasks,
        adjust_power_state_tasks,
@@ -106,7 +106,7 @@ const struct action_chain power_source_change_action_chain_hardware_dc = {
        power_source_change_event_hardware_dc
 };
 
-static const pem_event_action *suspend_event[] = {
+static const pem_event_action * const suspend_event[] = {
        reset_display_phy_access_tasks,
        unregister_interrupt_tasks,
        disable_gfx_voltage_island_power_gating_tasks,
@@ -130,7 +130,7 @@ const struct action_chain suspend_action_chain = {
        suspend_event
 };
 
-static const pem_event_action *resume_event[] = {
+static const pem_event_action * const resume_event[] = {
        unblock_hw_access_tasks,
        resume_connected_standby_tasks,
        notify_smu_resume_tasks,
@@ -164,7 +164,7 @@ const struct action_chain resume_action_chain = {
        resume_event
 };
 
-static const pem_event_action *complete_init_event[] = {
+static const pem_event_action * const complete_init_event[] = {
        unblock_adjust_power_state_tasks,
        adjust_power_state_tasks,
        enable_gfx_clock_gating_tasks,
@@ -178,7 +178,7 @@ const struct action_chain complete_init_action_chain = {
        complete_init_event
 };
 
-static const pem_event_action *enable_gfx_clock_gating_event[] = {
+static const pem_event_action * const enable_gfx_clock_gating_event[] = {
        enable_gfx_clock_gating_tasks,
        NULL
 };
@@ -188,7 +188,7 @@ const struct action_chain enable_gfx_clock_gating_action_chain = {
        enable_gfx_clock_gating_event
 };
 
-static const pem_event_action *disable_gfx_clock_gating_event[] = {
+static const pem_event_action * const disable_gfx_clock_gating_event[] = {
        disable_gfx_clock_gating_tasks,
        NULL
 };
@@ -198,7 +198,7 @@ const struct action_chain disable_gfx_clock_gating_action_chain = {
        disable_gfx_clock_gating_event
 };
 
-static const pem_event_action *enable_cgpg_event[] = {
+static const pem_event_action * const enable_cgpg_event[] = {
        enable_cgpg_tasks,
        NULL
 };
@@ -208,7 +208,7 @@ const struct action_chain enable_cgpg_action_chain = {
        enable_cgpg_event
 };
 
-static const pem_event_action *disable_cgpg_event[] = {
+static const pem_event_action * const disable_cgpg_event[] = {
        disable_cgpg_tasks,
        NULL
 };
@@ -221,7 +221,7 @@ const struct action_chain disable_cgpg_action_chain = {
 
 /* Enable user _2d performance and activate */
 
-static const pem_event_action *enable_user_state_event[] = {
+static const pem_event_action * const enable_user_state_event[] = {
        create_new_user_performance_state_tasks,
        adjust_power_state_tasks,
        NULL
@@ -232,7 +232,7 @@ const struct action_chain enable_user_state_action_chain = {
        enable_user_state_event
 };
 
-static const pem_event_action *enable_user_2d_performance_event[] = {
+static const pem_event_action * const enable_user_2d_performance_event[] = {
        enable_user_2d_performance_tasks,
        add_user_2d_performance_state_tasks,
        set_performance_state_tasks,
@@ -247,7 +247,7 @@ const struct action_chain enable_user_2d_performance_action_chain = {
 };
 
 
-static const pem_event_action *disable_user_2d_performance_event[] = {
+static const pem_event_action * const disable_user_2d_performance_event[] = {
        disable_user_2d_performance_tasks,
        delete_user_2d_performance_state_tasks,
        NULL
@@ -259,7 +259,7 @@ const struct action_chain disable_user_2d_performance_action_chain = {
 };
 
 
-static const pem_event_action *display_config_change_event[] = {
+static const pem_event_action * const display_config_change_event[] = {
        /* countDisplayConfigurationChangeEventTasks, */
        unblock_adjust_power_state_tasks,
        set_cpu_power_state,
@@ -278,7 +278,7 @@ const struct action_chain display_config_change_action_chain = {
        display_config_change_event
 };
 
-static const pem_event_action *readjust_power_state_event[] = {
+static const pem_event_action * const readjust_power_state_event[] = {
        adjust_power_state_tasks,
        NULL
 };
index 1e2ad5603080152f9fa7831b2c5c22ee7a0aa3c9..cd1ca07ef7f72deaa10d171c241d1308dc9d1869 100644 (file)
@@ -62,7 +62,7 @@ int pem_init_event_action_chains(struct pp_eventmgr *eventmgr)
 
 int pem_excute_event_chain(struct pp_eventmgr *eventmgr, const struct action_chain *event_chain, struct pem_event_data *event_data)
 {
-       const pem_event_action **paction_chain;
+       const pem_event_action * const *paction_chain;
        const pem_event_action *psub_chain;
        int tmp_result = 0;
        int result = 0;
index 10437dcfd365941791b6b4f004dba7fed60874f5..d63ef83b2628a068a80eff01b1b6137499d8b166 100644 (file)
@@ -37,7 +37,7 @@ typedef int (*pem_event_action)(struct pp_eventmgr *eventmgr,
 
 struct action_chain {
        const char *description;  /* action chain description for debugging purpose */
-       const pem_event_action **action_chain; /* pointer to chain of event actions */
+       const pem_event_action * const *action_chain; /* pointer to chain of event actions */
 };
 
 struct pem_power_source_ui_state_info {