Commit 74254647 authored by Jeremy Kerr's avatar Jeremy Kerr Committed by Benjamin Herrenschmidt

powerpc/spufs: Constify context contents and coredump callback constants

The spufs context directory contents definitions are not changed after
initialisation, so we can declare them as const. We can do the same
with the spu coredump reader callbacks too.
Signed-off-by: default avatarJeremy Kerr <jk@ozlabs.org>
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
parent 3688b46b
...@@ -2665,7 +2665,7 @@ static const struct file_operations spufs_ctx_fops = { ...@@ -2665,7 +2665,7 @@ static const struct file_operations spufs_ctx_fops = {
.release = single_release, .release = single_release,
}; };
struct spufs_tree_descr spufs_dir_contents[] = { const struct spufs_tree_descr spufs_dir_contents[] = {
{ "capabilities", &spufs_caps_fops, 0444, }, { "capabilities", &spufs_caps_fops, 0444, },
{ "mem", &spufs_mem_fops, 0666, LS_SIZE, }, { "mem", &spufs_mem_fops, 0666, LS_SIZE, },
{ "regs", &spufs_regs_fops, 0666, sizeof(struct spu_reg128[128]), }, { "regs", &spufs_regs_fops, 0666, sizeof(struct spu_reg128[128]), },
...@@ -2706,7 +2706,7 @@ struct spufs_tree_descr spufs_dir_contents[] = { ...@@ -2706,7 +2706,7 @@ struct spufs_tree_descr spufs_dir_contents[] = {
{}, {},
}; };
struct spufs_tree_descr spufs_dir_nosched_contents[] = { const struct spufs_tree_descr spufs_dir_nosched_contents[] = {
{ "capabilities", &spufs_caps_fops, 0444, }, { "capabilities", &spufs_caps_fops, 0444, },
{ "mem", &spufs_mem_fops, 0666, LS_SIZE, }, { "mem", &spufs_mem_fops, 0666, LS_SIZE, },
{ "mbox", &spufs_mbox_fops, 0444, }, { "mbox", &spufs_mbox_fops, 0444, },
...@@ -2731,12 +2731,12 @@ struct spufs_tree_descr spufs_dir_nosched_contents[] = { ...@@ -2731,12 +2731,12 @@ struct spufs_tree_descr spufs_dir_nosched_contents[] = {
{}, {},
}; };
struct spufs_tree_descr spufs_dir_debug_contents[] = { const struct spufs_tree_descr spufs_dir_debug_contents[] = {
{ ".ctx", &spufs_ctx_fops, 0444, }, { ".ctx", &spufs_ctx_fops, 0444, },
{}, {},
}; };
struct spufs_coredump_reader spufs_coredump_read[] = { const struct spufs_coredump_reader spufs_coredump_read[] = {
{ "regs", __spufs_regs_read, NULL, sizeof(struct spu_reg128[128])}, { "regs", __spufs_regs_read, NULL, sizeof(struct spu_reg128[128])},
{ "fpcr", __spufs_fpcr_read, NULL, sizeof(struct spu_reg128) }, { "fpcr", __spufs_fpcr_read, NULL, sizeof(struct spu_reg128) },
{ "lslr", NULL, spufs_lslr_get, 19 }, { "lslr", NULL, spufs_lslr_get, 19 },
......
...@@ -186,8 +186,9 @@ static int spufs_rmdir(struct inode *parent, struct dentry *dir) ...@@ -186,8 +186,9 @@ static int spufs_rmdir(struct inode *parent, struct dentry *dir)
return simple_rmdir(parent, dir); return simple_rmdir(parent, dir);
} }
static int spufs_fill_dir(struct dentry *dir, struct spufs_tree_descr *files, static int spufs_fill_dir(struct dentry *dir,
int mode, struct spu_context *ctx) const struct spufs_tree_descr *files, int mode,
struct spu_context *ctx)
{ {
struct dentry *dentry, *tmp; struct dentry *dentry, *tmp;
int ret; int ret;
......
...@@ -241,9 +241,9 @@ struct spufs_tree_descr { ...@@ -241,9 +241,9 @@ struct spufs_tree_descr {
size_t size; size_t size;
}; };
extern struct spufs_tree_descr spufs_dir_contents[]; extern const struct spufs_tree_descr spufs_dir_contents[];
extern struct spufs_tree_descr spufs_dir_nosched_contents[]; extern const struct spufs_tree_descr spufs_dir_nosched_contents[];
extern struct spufs_tree_descr spufs_dir_debug_contents[]; extern const struct spufs_tree_descr spufs_dir_debug_contents[];
/* system call implementation */ /* system call implementation */
extern struct spufs_calls spufs_calls; extern struct spufs_calls spufs_calls;
...@@ -358,7 +358,7 @@ struct spufs_coredump_reader { ...@@ -358,7 +358,7 @@ struct spufs_coredump_reader {
u64 (*get)(struct spu_context *ctx); u64 (*get)(struct spu_context *ctx);
size_t size; size_t size;
}; };
extern struct spufs_coredump_reader spufs_coredump_read[]; extern const struct spufs_coredump_reader spufs_coredump_read[];
extern int spufs_coredump_num_notes; extern int spufs_coredump_num_notes;
extern int spu_init_csa(struct spu_state *csa); extern int spu_init_csa(struct spu_state *csa);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment