[PATCH] make more file_operation structs static
Mark the static struct file_operations in drivers/char as const. Making them const prevents accidental bugs, and moves them to the .rodata section so that they no longer do any false sharing; in addition with the proper debug option they are then protected against corruption.. [akpm@osdl.org: build fix] Signed-off-by: Arjan van de Ven <arjan@linux.intel.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
committed by
Linus Torvalds
parent
d459ec0baa
commit
62322d2554
@@ -116,7 +116,7 @@ static u8 tpm_atml_status(struct tpm_chip *chip)
|
||||
return ioread8(chip->vendor.iobase + 1);
|
||||
}
|
||||
|
||||
static struct file_operations atmel_ops = {
|
||||
static const struct file_operations atmel_ops = {
|
||||
.owner = THIS_MODULE,
|
||||
.llseek = no_llseek,
|
||||
.open = tpm_open,
|
||||
|
@@ -338,7 +338,7 @@ static struct attribute *inf_attrs[] = {
|
||||
|
||||
static struct attribute_group inf_attr_grp = {.attrs = inf_attrs };
|
||||
|
||||
static struct file_operations inf_ops = {
|
||||
static const struct file_operations inf_ops = {
|
||||
.owner = THIS_MODULE,
|
||||
.llseek = no_llseek,
|
||||
.open = tpm_open,
|
||||
|
@@ -226,7 +226,7 @@ static u8 tpm_nsc_status(struct tpm_chip *chip)
|
||||
return inb(chip->vendor.base + NSC_STATUS);
|
||||
}
|
||||
|
||||
static struct file_operations nsc_ops = {
|
||||
static const struct file_operations nsc_ops = {
|
||||
.owner = THIS_MODULE,
|
||||
.llseek = no_llseek,
|
||||
.open = tpm_open,
|
||||
|
@@ -330,7 +330,7 @@ out_err:
|
||||
return rc;
|
||||
}
|
||||
|
||||
static struct file_operations tis_ops = {
|
||||
static const struct file_operations tis_ops = {
|
||||
.owner = THIS_MODULE,
|
||||
.llseek = no_llseek,
|
||||
.open = tpm_open,
|
||||
|
Reference in New Issue
Block a user