From fa027c2a0a0d6d1df6b29ee99048502c93da0dd4 Mon Sep 17 00:00:00 2001 From: Arjan van de Ven Date: Mon, 12 Feb 2007 00:55:33 -0800 Subject: [PATCH] mark struct file_operations const 4 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. [akpm@sdl.org: dvb fix] Signed-off-by: Arjan van de Ven Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/media/radio/dsbr100.c | 2 +- drivers/media/radio/miropcm20-radio.c | 2 +- drivers/media/radio/miropcm20-rds.c | 2 +- drivers/media/radio/radio-aimslab.c | 2 +- drivers/media/radio/radio-aztech.c | 2 +- drivers/media/radio/radio-cadet.c | 2 +- drivers/media/radio/radio-gemtek-pci.c | 2 +- drivers/media/radio/radio-gemtek.c | 2 +- drivers/media/radio/radio-maestro.c | 2 +- drivers/media/radio/radio-maxiradio.c | 2 +- drivers/media/radio/radio-rtrack2.c | 2 +- drivers/media/radio/radio-sf16fmi.c | 2 +- drivers/media/radio/radio-sf16fmr2.c | 2 +- drivers/media/radio/radio-terratec.c | 2 +- drivers/media/radio/radio-trust.c | 2 +- drivers/media/radio/radio-typhoon.c | 2 +- drivers/media/radio/radio-zoltrix.c | 2 +- 17 files changed, 17 insertions(+), 17 deletions(-) (limited to 'drivers/media/radio') diff --git a/drivers/media/radio/dsbr100.c b/drivers/media/radio/dsbr100.c index db865a0667e5..df8d0520d1d1 100644 --- a/drivers/media/radio/dsbr100.c +++ b/drivers/media/radio/dsbr100.c @@ -144,7 +144,7 @@ struct dsbr100_device { /* File system interface */ -static struct file_operations usb_dsbr100_fops = { +static const struct file_operations usb_dsbr100_fops = { .owner = THIS_MODULE, .open = usb_dsbr100_open, .release = usb_dsbr100_close, diff --git a/drivers/media/radio/miropcm20-radio.c b/drivers/media/radio/miropcm20-radio.c index c4312fa0e2f5..c7c9d1dc0690 100644 --- a/drivers/media/radio/miropcm20-radio.c +++ b/drivers/media/radio/miropcm20-radio.c @@ -216,7 +216,7 @@ static struct pcm20_device pcm20_unit = { .muted = 1, }; -static struct file_operations pcm20_fops = { +static const struct file_operations pcm20_fops = { .owner = THIS_MODULE, .open = video_exclusive_open, .release = video_exclusive_release, diff --git a/drivers/media/radio/miropcm20-rds.c b/drivers/media/radio/miropcm20-rds.c index c1b1db65e668..c93490ec96bb 100644 --- a/drivers/media/radio/miropcm20-rds.c +++ b/drivers/media/radio/miropcm20-rds.c @@ -105,7 +105,7 @@ static ssize_t rds_f_read(struct file *file, char __user *buffer, size_t length, } } -static struct file_operations rds_fops = { +static const struct file_operations rds_fops = { .owner = THIS_MODULE, .read = rds_f_read, .open = rds_f_open, diff --git a/drivers/media/radio/radio-aimslab.c b/drivers/media/radio/radio-aimslab.c index 3368a89bfadb..b2e88ad28977 100644 --- a/drivers/media/radio/radio-aimslab.c +++ b/drivers/media/radio/radio-aimslab.c @@ -358,7 +358,7 @@ static int rt_ioctl(struct inode *inode, struct file *file, static struct rt_device rtrack_unit; -static struct file_operations rtrack_fops = { +static const struct file_operations rtrack_fops = { .owner = THIS_MODULE, .open = video_exclusive_open, .release = video_exclusive_release, diff --git a/drivers/media/radio/radio-aztech.c b/drivers/media/radio/radio-aztech.c index 3ba5fa8cf7e6..19d45cc940b5 100644 --- a/drivers/media/radio/radio-aztech.c +++ b/drivers/media/radio/radio-aztech.c @@ -314,7 +314,7 @@ static int az_ioctl(struct inode *inode, struct file *file, static struct az_device aztech_unit; -static struct file_operations aztech_fops = { +static const struct file_operations aztech_fops = { .owner = THIS_MODULE, .open = video_exclusive_open, .release = video_exclusive_release, diff --git a/drivers/media/radio/radio-cadet.c b/drivers/media/radio/radio-cadet.c index 69d4b7919c5a..8fbf0d8bd278 100644 --- a/drivers/media/radio/radio-cadet.c +++ b/drivers/media/radio/radio-cadet.c @@ -507,7 +507,7 @@ cadet_poll(struct file *file, struct poll_table_struct *wait) } -static struct file_operations cadet_fops = { +static const struct file_operations cadet_fops = { .owner = THIS_MODULE, .open = cadet_open, .release = cadet_release, diff --git a/drivers/media/radio/radio-gemtek-pci.c b/drivers/media/radio/radio-gemtek-pci.c index eb14106f66fa..05e5aa77025f 100644 --- a/drivers/media/radio/radio-gemtek-pci.c +++ b/drivers/media/radio/radio-gemtek-pci.c @@ -346,7 +346,7 @@ MODULE_DEVICE_TABLE( pci, gemtek_pci_id ); static int mx = 1; -static struct file_operations gemtek_pci_fops = { +static const struct file_operations gemtek_pci_fops = { .owner = THIS_MODULE, .open = video_exclusive_open, .release = video_exclusive_release, diff --git a/drivers/media/radio/radio-gemtek.c b/drivers/media/radio/radio-gemtek.c index 730fe16126cb..36c4be6622c7 100644 --- a/drivers/media/radio/radio-gemtek.c +++ b/drivers/media/radio/radio-gemtek.c @@ -296,7 +296,7 @@ static int gemtek_ioctl(struct inode *inode, struct file *file, static struct gemtek_device gemtek_unit; -static struct file_operations gemtek_fops = { +static const struct file_operations gemtek_fops = { .owner = THIS_MODULE, .open = video_exclusive_open, .release = video_exclusive_release, diff --git a/drivers/media/radio/radio-maestro.c b/drivers/media/radio/radio-maestro.c index e8ce5f75cf12..9bba6eb10925 100644 --- a/drivers/media/radio/radio-maestro.c +++ b/drivers/media/radio/radio-maestro.c @@ -99,7 +99,7 @@ static struct pci_driver maestro_r_driver = { .remove = __devexit_p(maestro_remove), }; -static struct file_operations maestro_fops = { +static const struct file_operations maestro_fops = { .owner = THIS_MODULE, .open = video_exclusive_open, .release = video_exclusive_release, diff --git a/drivers/media/radio/radio-maxiradio.c b/drivers/media/radio/radio-maxiradio.c index c2eeae7a10d0..00a2f31d2af3 100644 --- a/drivers/media/radio/radio-maxiradio.c +++ b/drivers/media/radio/radio-maxiradio.c @@ -91,7 +91,7 @@ module_param(radio_nr, int, 0); static int radio_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg); -static struct file_operations maxiradio_fops = { +static const struct file_operations maxiradio_fops = { .owner = THIS_MODULE, .open = video_exclusive_open, .release = video_exclusive_release, diff --git a/drivers/media/radio/radio-rtrack2.c b/drivers/media/radio/radio-rtrack2.c index b9e98483e58d..f6683872251e 100644 --- a/drivers/media/radio/radio-rtrack2.c +++ b/drivers/media/radio/radio-rtrack2.c @@ -262,7 +262,7 @@ static int rt_ioctl(struct inode *inode, struct file *file, static struct rt_device rtrack2_unit; -static struct file_operations rtrack2_fops = { +static const struct file_operations rtrack2_fops = { .owner = THIS_MODULE, .open = video_exclusive_open, .release = video_exclusive_release, diff --git a/drivers/media/radio/radio-sf16fmi.c b/drivers/media/radio/radio-sf16fmi.c index ecc854b4ba38..f4619e4dda4f 100644 --- a/drivers/media/radio/radio-sf16fmi.c +++ b/drivers/media/radio/radio-sf16fmi.c @@ -265,7 +265,7 @@ static int fmi_ioctl(struct inode *inode, struct file *file, static struct fmi_device fmi_unit; -static struct file_operations fmi_fops = { +static const struct file_operations fmi_fops = { .owner = THIS_MODULE, .open = video_exclusive_open, .release = video_exclusive_release, diff --git a/drivers/media/radio/radio-sf16fmr2.c b/drivers/media/radio/radio-sf16fmr2.c index 4444dce864a9..b96fafe1f9da 100644 --- a/drivers/media/radio/radio-sf16fmr2.c +++ b/drivers/media/radio/radio-sf16fmr2.c @@ -410,7 +410,7 @@ static int fmr2_ioctl(struct inode *inode, struct file *file, static struct fmr2_device fmr2_unit; -static struct file_operations fmr2_fops = { +static const struct file_operations fmr2_fops = { .owner = THIS_MODULE, .open = video_exclusive_open, .release = video_exclusive_release, diff --git a/drivers/media/radio/radio-terratec.c b/drivers/media/radio/radio-terratec.c index f539491a0d76..d59a27accb84 100644 --- a/drivers/media/radio/radio-terratec.c +++ b/drivers/media/radio/radio-terratec.c @@ -338,7 +338,7 @@ static int tt_ioctl(struct inode *inode, struct file *file, static struct tt_device terratec_unit; -static struct file_operations terratec_fops = { +static const struct file_operations terratec_fops = { .owner = THIS_MODULE, .open = video_exclusive_open, .release = video_exclusive_release, diff --git a/drivers/media/radio/radio-trust.c b/drivers/media/radio/radio-trust.c index bb03ad5a2033..6d7f1e7116ea 100644 --- a/drivers/media/radio/radio-trust.c +++ b/drivers/media/radio/radio-trust.c @@ -325,7 +325,7 @@ static int tr_ioctl(struct inode *inode, struct file *file, return video_usercopy(inode, file, cmd, arg, tr_do_ioctl); } -static struct file_operations trust_fops = { +static const struct file_operations trust_fops = { .owner = THIS_MODULE, .open = video_exclusive_open, .release = video_exclusive_release, diff --git a/drivers/media/radio/radio-typhoon.c b/drivers/media/radio/radio-typhoon.c index 4a72b4d4e62a..3031fef178cb 100644 --- a/drivers/media/radio/radio-typhoon.c +++ b/drivers/media/radio/radio-typhoon.c @@ -318,7 +318,7 @@ static struct typhoon_device typhoon_unit = .mutefreq = CONFIG_RADIO_TYPHOON_MUTEFREQ, }; -static struct file_operations typhoon_fops = { +static const struct file_operations typhoon_fops = { .owner = THIS_MODULE, .open = video_exclusive_open, .release = video_exclusive_release, diff --git a/drivers/media/radio/radio-zoltrix.c b/drivers/media/radio/radio-zoltrix.c index 671fe1b1e5bc..ec08491fb7c5 100644 --- a/drivers/media/radio/radio-zoltrix.c +++ b/drivers/media/radio/radio-zoltrix.c @@ -373,7 +373,7 @@ static int zol_ioctl(struct inode *inode, struct file *file, static struct zol_device zoltrix_unit; -static struct file_operations zoltrix_fops = +static const struct file_operations zoltrix_fops = { .owner = THIS_MODULE, .open = video_exclusive_open, -- cgit v1.2.3