1
0
Fork 0

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: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
hifive-unleashed-5.1
Julia Lawall 2016-05-01 22:11:59 +02:00 committed by Darren Hart
parent 575b245d90
commit 775d054aba
3 changed files with 5 additions and 5 deletions

View File

@ -99,7 +99,7 @@ struct telemetry_core_ops {
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);
int telemetry_clear_pltdata(void);

View File

@ -25,7 +25,7 @@
struct telemetry_core_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;
@ -95,7 +95,7 @@ static int telemetry_def_reset_events(void)
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,
.get_sampling_period = telemetry_def_get_sampling_period,
.get_trace_verbosity = telemetry_def_get_trace_verbosity,
@ -332,7 +332,7 @@ EXPORT_SYMBOL_GPL(telemetry_set_trace_verbosity);
*
* 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)
{
if (ops)

View File

@ -1081,7 +1081,7 @@ out:
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,
.set_trace_verbosity = telemetry_plt_set_trace_verbosity,
.set_sampling_period = telemetry_plt_set_sampling_period,