mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
fs: constify tree_descr arrays passed to simple_fill_super()
simple_fill_super() is passed an array of tree_descr structures which describe the files to create in the filesystem's root directory. Since these arrays are never modified intentionally, they should be 'const' so that they are placed in .rodata and benefit from memory protection. This patch updates the function signature and all users, and also constifies tree_descr.name. Signed-off-by: Eric Biggers <[email protected]> Signed-off-by: Al Viro <[email protected]>
This commit is contained in:
parent
a0c111b49b
commit
cda37124f4
13 changed files with 17 additions and 16 deletions
|
|
@ -44,14 +44,14 @@ static const struct file_operations capabilities_file_ops = {
|
|||
|
||||
static int xenfs_fill_super(struct super_block *sb, void *data, int silent)
|
||||
{
|
||||
static struct tree_descr xenfs_files[] = {
|
||||
static const struct tree_descr xenfs_files[] = {
|
||||
[2] = { "xenbus", &xen_xenbus_fops, S_IRUSR|S_IWUSR },
|
||||
{ "capabilities", &capabilities_file_ops, S_IRUGO },
|
||||
{ "privcmd", &xen_privcmd_fops, S_IRUSR|S_IWUSR },
|
||||
{""},
|
||||
};
|
||||
|
||||
static struct tree_descr xenfs_init_files[] = {
|
||||
static const struct tree_descr xenfs_init_files[] = {
|
||||
[2] = { "xenbus", &xen_xenbus_fops, S_IRUSR|S_IWUSR },
|
||||
{ "capabilities", &capabilities_file_ops, S_IRUGO },
|
||||
{ "privcmd", &xen_privcmd_fops, S_IRUSR|S_IWUSR },
|
||||
|
|
|
|||
Loading…
Reference in a new issue