* [PATCH] intel_telemetry: constify telemetry_core_ops structures
@ 2016-05-01 20:11 Julia Lawall
2016-05-05 21:01 ` Darren Hart
0 siblings, 1 reply; 2+ messages in thread
From: Julia Lawall @ 2016-05-01 20:11 UTC (permalink / raw)
To: linux-kernel
Cc: kernel-janitors, platform-driver-x86, Darren Hart,
Souvik Kumar Chakravarty, Thomas Gleixner, Ingo Molnar,
H. Peter Anvin, x86
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>
---
arch/x86/include/asm/intel_telemetry.h | 2 +-
drivers/platform/x86/intel_telemetry_core.c | 6 +++---
drivers/platform/x86/intel_telemetry_pltdrv.c | 2 +-
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/platform/x86/intel_telemetry_core.c b/drivers/platform/x86/intel_telemetry_core.c
index a695a43..0d4c380 100644
--- a/drivers/platform/x86/intel_telemetry_core.c
+++ b/drivers/platform/x86/intel_telemetry_core.c
@@ -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)
diff --git a/drivers/platform/x86/intel_telemetry_pltdrv.c b/drivers/platform/x86/intel_telemetry_pltdrv.c
index 781bd10..09c84a2 100644
--- a/drivers/platform/x86/intel_telemetry_pltdrv.c
+++ b/drivers/platform/x86/intel_telemetry_pltdrv.c
@@ -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,
diff --git a/arch/x86/include/asm/intel_telemetry.h b/arch/x86/include/asm/intel_telemetry.h
index ed65fe7..85029b5 100644
--- a/arch/x86/include/asm/intel_telemetry.h
+++ b/arch/x86/include/asm/intel_telemetry.h
@@ -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);
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] intel_telemetry: constify telemetry_core_ops structures
2016-05-01 20:11 [PATCH] intel_telemetry: constify telemetry_core_ops structures Julia Lawall
@ 2016-05-05 21:01 ` Darren Hart
0 siblings, 0 replies; 2+ messages in thread
From: Darren Hart @ 2016-05-05 21:01 UTC (permalink / raw)
To: Julia Lawall
Cc: linux-kernel, kernel-janitors, platform-driver-x86,
Souvik Kumar Chakravarty, Thomas Gleixner, Ingo Molnar,
H. Peter Anvin, x86
On Sun, May 01, 2016 at 10:11:59PM +0200, Julia Lawall wrote:
> 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>
Queued, thank you.
--
Darren Hart
Intel Open Source Technology Center
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-05-05 21:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-01 20:11 [PATCH] intel_telemetry: constify telemetry_core_ops structures Julia Lawall
2016-05-05 21:01 ` Darren Hart
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®