Commit 775d054a authored by Julia Lawall's avatar Julia Lawall Committed by Darren Hart

intel_telemetry: Constify telemetry_core_ops structures

The telemetry_core_ops structures are never modified, so declare them as
const.

Done with the help of Coccinelle.
Signed-off-by: default avatarJulia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: default avatarDarren Hart <dvhart@linux.intel.com>
parent 575b245d
...@@ -99,7 +99,7 @@ struct telemetry_core_ops { ...@@ -99,7 +99,7 @@ struct telemetry_core_ops {
int (*reset_events)(void); int (*reset_events)(void);
}; };
int telemetry_set_pltdata(struct telemetry_core_ops *ops, int telemetry_set_pltdata(const struct telemetry_core_ops *ops,
struct telemetry_plt_config *pltconfig); struct telemetry_plt_config *pltconfig);
int telemetry_clear_pltdata(void); int telemetry_clear_pltdata(void);
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
struct telemetry_core_config { struct telemetry_core_config {
struct telemetry_plt_config *plt_config; struct telemetry_plt_config *plt_config;
struct telemetry_core_ops *telem_ops; const struct telemetry_core_ops *telem_ops;
}; };
static struct telemetry_core_config telm_core_conf; static struct telemetry_core_config telm_core_conf;
...@@ -95,7 +95,7 @@ static int telemetry_def_reset_events(void) ...@@ -95,7 +95,7 @@ static int telemetry_def_reset_events(void)
return 0; return 0;
} }
static struct telemetry_core_ops telm_defpltops = { static const struct telemetry_core_ops telm_defpltops = {
.set_sampling_period = telemetry_def_set_sampling_period, .set_sampling_period = telemetry_def_set_sampling_period,
.get_sampling_period = telemetry_def_get_sampling_period, .get_sampling_period = telemetry_def_get_sampling_period,
.get_trace_verbosity = telemetry_def_get_trace_verbosity, .get_trace_verbosity = telemetry_def_get_trace_verbosity,
...@@ -332,7 +332,7 @@ EXPORT_SYMBOL_GPL(telemetry_set_trace_verbosity); ...@@ -332,7 +332,7 @@ EXPORT_SYMBOL_GPL(telemetry_set_trace_verbosity);
* *
* Return: 0 success, < 0 for failure * Return: 0 success, < 0 for failure
*/ */
int telemetry_set_pltdata(struct telemetry_core_ops *ops, int telemetry_set_pltdata(const struct telemetry_core_ops *ops,
struct telemetry_plt_config *pltconfig) struct telemetry_plt_config *pltconfig)
{ {
if (ops) if (ops)
......
...@@ -1081,7 +1081,7 @@ static int telemetry_plt_set_trace_verbosity(enum telemetry_unit telem_unit, ...@@ -1081,7 +1081,7 @@ static int telemetry_plt_set_trace_verbosity(enum telemetry_unit telem_unit,
return ret; return ret;
} }
static struct telemetry_core_ops telm_pltops = { static const struct telemetry_core_ops telm_pltops = {
.get_trace_verbosity = telemetry_plt_get_trace_verbosity, .get_trace_verbosity = telemetry_plt_get_trace_verbosity,
.set_trace_verbosity = telemetry_plt_set_trace_verbosity, .set_trace_verbosity = telemetry_plt_set_trace_verbosity,
.set_sampling_period = telemetry_plt_set_sampling_period, .set_sampling_period = telemetry_plt_set_sampling_period,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment