aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/cpu/resctrl/rdtgroup.c
diff options
context:
space:
mode:
authorRikard Falkeborn <rikard.falkeborn@gmail.com>2020-11-11 00:02:28 +0100
committerBorislav Petkov <bp@suse.de>2020-11-19 18:23:45 +0100
commit2002d2951398317d0f46e64ae6d8dd58ed541c6d (patch)
treedd28082b2122907e0e59e46ca3ee41621aa30c1a /arch/x86/kernel/cpu/resctrl/rdtgroup.c
parentx86/resctrl: Correct MBM total and local values (diff)
downloadlinux-dev-2002d2951398317d0f46e64ae6d8dd58ed541c6d.tar.xz
linux-dev-2002d2951398317d0f46e64ae6d8dd58ed541c6d.zip
x86/resctrl: Constify kernfs_ops
The only usage of the kf_ops field in the rftype struct is to pass it as argument to __kernfs_create_file(), which accepts a pointer to const. Make it a pointer to const. This makes it possible to make rdtgroup_kf_single_ops and kf_mondata_ops const, which allows the compiler to put them in read-only memory. Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com> Signed-off-by: Borislav Petkov <bp@suse.de> Acked-by: Reinette Chatre <reinette.chatre@intel.com> Link: https://lkml.kernel.org/r/20201110230228.801785-1-rikard.falkeborn@gmail.com
Diffstat (limited to '')
-rw-r--r--arch/x86/kernel/cpu/resctrl/rdtgroup.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/resctrl/rdtgroup.c
index af323e2e3100..78dcbb8e0172 100644
--- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c
+++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c
@@ -240,13 +240,13 @@ static ssize_t rdtgroup_file_write(struct kernfs_open_file *of, char *buf,
return -EINVAL;
}
-static struct kernfs_ops rdtgroup_kf_single_ops = {
+static const struct kernfs_ops rdtgroup_kf_single_ops = {
.atomic_write_len = PAGE_SIZE,
.write = rdtgroup_file_write,
.seq_show = rdtgroup_seqfile_show,
};
-static struct kernfs_ops kf_mondata_ops = {
+static const struct kernfs_ops kf_mondata_ops = {
.atomic_write_len = PAGE_SIZE,
.seq_show = rdtgroup_mondata_show,
};