diff options
author | Christophe JAILLET <christophe.jaillet@wanadoo.fr> | 2024-06-23 22:17:54 +0200 |
---|---|---|
committer | Song Liu <song@kernel.org> | 2024-07-04 08:20:27 +0200 |
commit | 1f4a72ff00cafa74b43b0c8a37573c78f86ed1a8 (patch) | |
tree | f1a729d6518ac2daaa0a2d63b72e460661eebc4f /drivers/md/md.c | |
parent | md: Remove unneeded semicolon (diff) | |
download | linux-1f4a72ff00cafa74b43b0c8a37573c78f86ed1a8.tar.xz linux-1f4a72ff00cafa74b43b0c8a37573c78f86ed1a8.zip |
md-cluster: Constify struct md_cluster_operations
'struct md_cluster_operations' is not modified in this driver.
Constifying this structure moves some data to a read-only section, so
increase overall security.
On a x86_64, with allmodconfig, as an example:
Before:
======
text data bss dec hex filename
51941 1442 80 53463 d0d7 drivers/md/md-cluster.o
After:
=====
text data bss dec hex filename
52133 1246 80 53459 d0d3 drivers/md/md-cluster.o
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Song Liu <song@kernel.org>
Link: https://lore.kernel.org/r/3727f3ce9693cae4e62ae6778ea13971df805479.1719173852.git.christophe.jaillet@wanadoo.fr
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r-- | drivers/md/md.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c index 149be072546a..b50721ddf5d3 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -85,7 +85,7 @@ static DEFINE_SPINLOCK(pers_lock); static const struct kobj_type md_ktype; -struct md_cluster_operations *md_cluster_ops; +const struct md_cluster_operations *md_cluster_ops; EXPORT_SYMBOL(md_cluster_ops); static struct module *md_cluster_mod; @@ -8543,7 +8543,7 @@ int unregister_md_personality(struct md_personality *p) } EXPORT_SYMBOL(unregister_md_personality); -int register_md_cluster_operations(struct md_cluster_operations *ops, +int register_md_cluster_operations(const struct md_cluster_operations *ops, struct module *module) { int ret = 0; |