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

Commit da7071d7 authored by Arjan van de Ven's avatar Arjan van de Ven Committed by Linus Torvalds
Browse files

[PATCH] mark struct file_operations const 8



Many struct file_operations in the kernel can be "const".  Marking them const
moves these to the .rodata section, which avoids false sharing with potential
dirty data.  In addition it'll catch accidental writes at compile time to
these shared resources.

Signed-off-by: default avatarArjan van de Ven <arjan@linux.intel.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 9a32144e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -56,7 +56,7 @@ static void ircomm_control_indication(struct ircomm_cb *self,
extern struct proc_dir_entry *proc_irda;
static int ircomm_seq_open(struct inode *, struct file *);

static struct file_operations ircomm_proc_fops = {
static const struct file_operations ircomm_proc_fops = {
	.owner		= THIS_MODULE,
	.open           = ircomm_seq_open,
	.read           = seq_read,
+1 −1
Original line number Diff line number Diff line
@@ -1080,7 +1080,7 @@ static int irias_seq_open(struct inode *inode, struct file *file)
	return seq_open(file, &irias_seq_ops);
}

struct file_operations irias_seq_fops = {
const struct file_operations irias_seq_fops = {
	.owner		= THIS_MODULE,
	.open           = irias_seq_open,
	.read           = seq_read,
+1 −1
Original line number Diff line number Diff line
@@ -93,7 +93,7 @@ extern struct proc_dir_entry *proc_irda;

static int irlan_seq_open(struct inode *inode, struct file *file);

static struct file_operations irlan_fops = {
static const struct file_operations irlan_fops = {
	.owner	 = THIS_MODULE,
	.open    = irlan_seq_open,
	.read    = seq_read,
+1 −1
Original line number Diff line number Diff line
@@ -1244,7 +1244,7 @@ out_kfree:
	goto out;
}

struct file_operations irlap_seq_fops = {
const struct file_operations irlap_seq_fops = {
	.owner		= THIS_MODULE,
	.open           = irlap_seq_open,
	.read           = seq_read,
+1 −1
Original line number Diff line number Diff line
@@ -2026,7 +2026,7 @@ out_kfree:
	goto out;
}

struct file_operations irlmp_seq_fops = {
const struct file_operations irlmp_seq_fops = {
	.owner		= THIS_MODULE,
	.open           = irlmp_seq_open,
	.read           = seq_read,
Loading