Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 15ad7cdc authored by Helge Deller's avatar Helge Deller Committed by Linus Torvalds
Browse files

[PATCH] struct seq_operations and struct file_operations constification



 - move some file_operations structs into the .rodata section

 - move static strings from policy_types[] array into the .rodata section

 - fix generic seq_operations usages, so that those structs may be defined
   as "const" as well

[akpm@osdl.org: couple of fixes]
Signed-off-by: default avatarHelge Deller <deller@gmx.de>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 4a08a9f6
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -26,7 +26,7 @@
 *	ERR_PTR(error).  In the end of sequence they return %NULL. ->show()
 *	returns 0 in case of success and negative number in case of error.
 */
int seq_open(struct file *file, struct seq_operations *op)
int seq_open(struct file *file, const struct seq_operations *op)
{
	struct seq_file *p = file->private_data;

@@ -408,7 +408,7 @@ EXPORT_SYMBOL(single_open);

int single_release(struct inode *inode, struct file *file)
{
	struct seq_operations *op = ((struct seq_file *)file->private_data)->op;
	const struct seq_operations *op = ((struct seq_file *)file->private_data)->op;
	int res = seq_release(inode, file);
	kfree(op);
	return res;
+1 −1
Original line number Diff line number Diff line
@@ -46,7 +46,7 @@ extern int cpuset_excl_nodes_overlap(const struct task_struct *p);
extern int cpuset_memory_pressure_enabled;
extern void __cpuset_memory_pressure_bump(void);

extern struct file_operations proc_cpuset_operations;
extern const struct file_operations proc_cpuset_operations;
extern char *cpuset_task_status_allowed(struct task_struct *task, char *buffer);

extern void cpuset_lock(void);
+1 −1
Original line number Diff line number Diff line
@@ -278,7 +278,7 @@ struct zone {
	/*
	 * rarely used fields:
	 */
	char			*name;
	const char		*name;
} ____cacheline_internodealigned_in_smp;

/*
+1 −1
Original line number Diff line number Diff line
@@ -274,7 +274,7 @@ static inline void subbuf_start_reserve(struct rchan_buf *buf,
/*
 * exported relay file operations, kernel/relay.c
 */
extern struct file_operations relay_file_operations;
extern const struct file_operations relay_file_operations;

#endif /* _LINUX_RELAY_H */
+1 −1
Original line number Diff line number Diff line
@@ -573,7 +573,7 @@ struct sched_info {
#endif /* defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT) */

#ifdef CONFIG_SCHEDSTATS
extern struct file_operations proc_schedstat_operations;
extern const struct file_operations proc_schedstat_operations;
#endif /* CONFIG_SCHEDSTATS */

#ifdef CONFIG_TASK_DELAY_ACCT
Loading