Skip to content

Commit 5ca1b99

Browse files
Stephen Hemmingerdavem330
authored andcommitted
net: file_operations should be const
All instances of file_operations should be const. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 3b401a8 commit 5ca1b99

7 files changed

Lines changed: 14 additions & 14 deletions

File tree

‎net/ipv6/ip6mr.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ static int ip6mr_vif_open(struct inode *inode, struct file *file)
217217
sizeof(struct ipmr_vif_iter));
218218
}
219219

220-
static struct file_operations ip6mr_vif_fops = {
220+
static const struct file_operations ip6mr_vif_fops = {
221221
.owner = THIS_MODULE,
222222
.open = ip6mr_vif_open,
223223
.read = seq_read,
@@ -341,7 +341,7 @@ static int ipmr_mfc_open(struct inode *inode, struct file *file)
341341
sizeof(struct ipmr_mfc_iter));
342342
}
343343

344-
static struct file_operations ip6mr_mfc_fops = {
344+
static const struct file_operations ip6mr_mfc_fops = {
345345
.owner = THIS_MODULE,
346346
.open = ipmr_mfc_open,
347347
.read = seq_read,

‎net/irda/irnet/irnet_ppp.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ static int
9595
/**************************** VARIABLES ****************************/
9696

9797
/* Filesystem callbacks (to call us) */
98-
static struct file_operations irnet_device_fops =
98+
static const struct file_operations irnet_device_fops =
9999
{
100100
.owner = THIS_MODULE,
101101
.read = dev_irnet_read,

‎net/irda/irproc.c‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,21 +34,21 @@
3434
#include <net/irda/irlap.h>
3535
#include <net/irda/irlmp.h>
3636

37-
extern struct file_operations discovery_seq_fops;
38-
extern struct file_operations irlap_seq_fops;
39-
extern struct file_operations irlmp_seq_fops;
40-
extern struct file_operations irttp_seq_fops;
41-
extern struct file_operations irias_seq_fops;
37+
extern const struct file_operations discovery_seq_fops;
38+
extern const struct file_operations irlap_seq_fops;
39+
extern const struct file_operations irlmp_seq_fops;
40+
extern const struct file_operations irttp_seq_fops;
41+
extern const struct file_operations irias_seq_fops;
4242

4343
struct irda_entry {
4444
const char *name;
45-
struct file_operations *fops;
45+
const struct file_operations *fops;
4646
};
4747

4848
struct proc_dir_entry *proc_irda;
4949
EXPORT_SYMBOL(proc_irda);
5050

51-
static struct irda_entry irda_dirs[] = {
51+
static const struct irda_entry irda_dirs[] = {
5252
{"discovery", &discovery_seq_fops},
5353
{"irttp", &irttp_seq_fops},
5454
{"irlmp", &irlmp_seq_fops},

‎net/key/af_key.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3718,7 +3718,7 @@ static int pfkey_seq_open(struct inode *inode, struct file *file)
37183718
sizeof(struct seq_net_private));
37193719
}
37203720

3721-
static struct file_operations pfkey_proc_ops = {
3721+
static const struct file_operations pfkey_proc_ops = {
37223722
.open = pfkey_seq_open,
37233723
.read = seq_read,
37243724
.llseek = seq_lseek,

‎net/mac80211/rc80211_minstrel_debugfs.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ minstrel_stats_release(struct inode *inode, struct file *file)
139139
return 0;
140140
}
141141

142-
static struct file_operations minstrel_stat_fops = {
142+
static const struct file_operations minstrel_stat_fops = {
143143
.owner = THIS_MODULE,
144144
.open = minstrel_stats_open,
145145
.read = minstrel_stats_read,

‎net/mac80211/rc80211_pid_debugfs.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ static ssize_t rate_control_pid_events_read(struct file *file, char __user *buf,
198198

199199
#undef RC_PID_PRINT_BUF_SIZE
200200

201-
static struct file_operations rc_pid_fop_events = {
201+
static const struct file_operations rc_pid_fop_events = {
202202
.owner = THIS_MODULE,
203203
.read = rate_control_pid_events_read,
204204
.poll = rate_control_pid_events_poll,

‎net/xfrm/xfrm_proc.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ static int xfrm_statistics_seq_open(struct inode *inode, struct file *file)
6060
return single_open_net(inode, file, xfrm_statistics_seq_show);
6161
}
6262

63-
static struct file_operations xfrm_statistics_seq_fops = {
63+
static const struct file_operations xfrm_statistics_seq_fops = {
6464
.owner = THIS_MODULE,
6565
.open = xfrm_statistics_seq_open,
6666
.read = seq_read,

0 commit comments

Comments
 (0)