diff options
author | Rikard Falkeborn <rikard.falkeborn@gmail.com> | 2020-11-11 02:02:28 +0300 |
---|---|---|
committer | Borislav Petkov <bp@suse.de> | 2020-11-19 20:23:45 +0300 |
commit | 2002d2951398317d0f46e64ae6d8dd58ed541c6d (patch) | |
tree | dd28082b2122907e0e59e46ca3ee41621aa30c1a /arch/x86/kernel/cpu/resctrl/internal.h | |
parent | 4868a61d498af3627c3b571aa48107a845001e51 (diff) | |
download | linux-2002d2951398317d0f46e64ae6d8dd58ed541c6d.tar.xz |
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 'arch/x86/kernel/cpu/resctrl/internal.h')
-rw-r--r-- | arch/x86/kernel/cpu/resctrl/internal.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/kernel/cpu/resctrl/internal.h b/arch/x86/kernel/cpu/resctrl/internal.h index 6cb068fcf501..5540b025880c 100644 --- a/arch/x86/kernel/cpu/resctrl/internal.h +++ b/arch/x86/kernel/cpu/resctrl/internal.h @@ -264,7 +264,7 @@ void __exit rdtgroup_exit(void); struct rftype { char *name; umode_t mode; - struct kernfs_ops *kf_ops; + const struct kernfs_ops *kf_ops; unsigned long flags; unsigned long fflags; |