aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2010-08-15 12:52:59 -0400
committerArnd Bergmann <arnd@arndb.de>2010-10-15 09:53:27 -0400
commit6038f373a3dc1f1c26496e60b6c40b164716f07e (patch)
treea0d3bbd026eea41b9fc36b8c722cbaf56cd9f825 /drivers/net
parent1ec5584e3edf9c4bf2c88c846534d19cf986ba11 (diff)
llseek: automatically add .llseek fop
All file_operations should get a .llseek operation so we can make nonseekable_open the default for future file operations without a .llseek pointer. The three cases that we can automatically detect are no_llseek, seq_lseek and default_llseek. For cases where we can we can automatically prove that the file offset is always ignored, we use noop_llseek, which maintains the current behavior of not returning an error from a seek. New drivers should normally not use noop_llseek but instead use no_llseek and call nonseekable_open at open time. Existing drivers can be converted to do the same when the maintainer knows for certain that no user code relies on calling seek on the device file. The generated code is often incorrectly indented and right now contains comments that clarify for each added line why a specific variant was chosen. In the version that gets submitted upstream, the comments will be gone and I will manually fix the indentation, because there does not seem to be a way to do that using coccinelle. Some amount of new code is currently sitting in linux-next that should get the same modifications, which I will do at the end of the merge window. Many thanks to Julia Lawall for helping me learn to write a semantic patch that does all this. ===== begin semantic patch ===== // This adds an llseek= method to all file operations, // as a preparation for making no_llseek the default. // // The rules are // - use no_llseek explicitly if we do nonseekable_open // - use seq_lseek for sequential files // - use default_llseek if we know we access f_pos // - use noop_llseek if we know we don't access f_pos, // but we still want to allow users to call lseek // @ open1 exists @ identifier nested_open; @@ nested_open(...) { <+... nonseekable_open(...) ...+> } @ open exists@ identifier open_f; identifier i, f; identifier open1.nested_open; @@ int open_f(struct inode *i, struct file *f) { <+... ( nonseekable_open(...) | nested_open(...) ) ...+> } @ read disable optional_qualifier exists @ identifier read_f; identifier f, p, s, off; type ssize_t, size_t, loff_t; expression E; identifier func; @@ ssize_t read_f(struct file *f, char *p, size_t s, loff_t *off) { <+... ( *off = E | *off += E | func(..., off, ...) | E = *off ) ...+> } @ read_no_fpos disable optional_qualifier exists @ identifier read_f; identifier f, p, s, off; type ssize_t, size_t, loff_t; @@ ssize_t read_f(struct file *f, char *p, size_t s, loff_t *off) { ... when != off } @ write @ identifier write_f; identifier f, p, s, off; type ssize_t, size_t, loff_t; expression E; identifier func; @@ ssize_t write_f(struct file *f, const char *p, size_t s, loff_t *off) { <+... ( *off = E | *off += E | func(..., off, ...) | E = *off ) ...+> } @ write_no_fpos @ identifier write_f; identifier f, p, s, off; type ssize_t, size_t, loff_t; @@ ssize_t write_f(struct file *f, const char *p, size_t s, loff_t *off) { ... when != off } @ fops0 @ identifier fops; @@ struct file_operations fops = { ... }; @ has_llseek depends on fops0 @ identifier fops0.fops; identifier llseek_f; @@ struct file_operations fops = { ... .llseek = llseek_f, ... }; @ has_read depends on fops0 @ identifier fops0.fops; identifier read_f; @@ struct file_operations fops = { ... .read = read_f, ... }; @ has_write depends on fops0 @ identifier fops0.fops; identifier write_f; @@ struct file_operations fops = { ... .write = write_f, ... }; @ has_open depends on fops0 @ identifier fops0.fops; identifier open_f; @@ struct file_operations fops = { ... .open = open_f, ... }; // use no_llseek if we call nonseekable_open //////////////////////////////////////////// @ nonseekable1 depends on !has_llseek && has_open @ identifier fops0.fops; identifier nso ~= "nonseekable_open"; @@ struct file_operations fops = { ... .open = nso, ... +.llseek = no_llseek, /* nonseekable */ }; @ nonseekable2 depends on !has_llseek @ identifier fops0.fops; identifier open.open_f; @@ struct file_operations fops = { ... .open = open_f, ... +.llseek = no_llseek, /* open uses nonseekable */ }; // use seq_lseek for sequential files ///////////////////////////////////// @ seq depends on !has_llseek @ identifier fops0.fops; identifier sr ~= "seq_read"; @@ struct file_operations fops = { ... .read = sr, ... +.llseek = seq_lseek, /* we have seq_read */ }; // use default_llseek if there is a readdir /////////////////////////////////////////// @ fops1 depends on !has_llseek && !nonseekable1 && !nonseekable2 && !seq @ identifier fops0.fops; identifier readdir_e; @@ // any other fop is used that changes pos struct file_operations fops = { ... .readdir = readdir_e, ... +.llseek = default_llseek, /* readdir is present */ }; // use default_llseek if at least one of read/write touches f_pos ///////////////////////////////////////////////////////////////// @ fops2 depends on !fops1 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @ identifier fops0.fops; identifier read.read_f; @@ // read fops use offset struct file_operations fops = { ... .read = read_f, ... +.llseek = default_llseek, /* read accesses f_pos */ }; @ fops3 depends on !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @ identifier fops0.fops; identifier write.write_f; @@ // write fops use offset struct file_operations fops = { ... .write = write_f, ... + .llseek = default_llseek, /* write accesses f_pos */ }; // Use noop_llseek if neither read nor write accesses f_pos /////////////////////////////////////////////////////////// @ fops4 depends on !fops1 && !fops2 && !fops3 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @ identifier fops0.fops; identifier read_no_fpos.read_f; identifier write_no_fpos.write_f; @@ // write fops use offset struct file_operations fops = { ... .write = write_f, .read = read_f, ... +.llseek = noop_llseek, /* read and write both use no f_pos */ }; @ depends on has_write && !has_read && !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @ identifier fops0.fops; identifier write_no_fpos.write_f; @@ struct file_operations fops = { ... .write = write_f, ... +.llseek = noop_llseek, /* write uses no f_pos */ }; @ depends on has_read && !has_write && !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @ identifier fops0.fops; identifier read_no_fpos.read_f; @@ struct file_operations fops = { ... .read = read_f, ... +.llseek = noop_llseek, /* read uses no f_pos */ }; @ depends on !has_read && !has_write && !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @ identifier fops0.fops; @@ struct file_operations fops = { ... +.llseek = noop_llseek, /* no read or write fn */ }; ===== End semantic patch ===== Signed-off-by: Arnd Bergmann <arnd@arndb.de> Cc: Julia Lawall <julia@diku.dk> Cc: Christoph Hellwig <hch@infradead.org>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/caif/caif_spi.c6
-rw-r--r--drivers/net/cxgb4/cxgb4_main.c1
-rw-r--r--drivers/net/ppp_generic.c3
-rw-r--r--drivers/net/wimax/i2400m/debugfs.c2
-rw-r--r--drivers/net/wireless/airo.c24
-rw-r--r--drivers/net/wireless/ath/ath5k/debug.c7
-rw-r--r--drivers/net/wireless/ath/ath9k/debug.c33
-rw-r--r--drivers/net/wireless/ath/ath9k/htc_drv_main.c9
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-3945-rs.c1
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-rs.c3
-rw-r--r--drivers/net/wireless/iwmc3200wifi/debugfs.c4
-rw-r--r--drivers/net/wireless/iwmc3200wifi/sdio.c1
-rw-r--r--drivers/net/wireless/libertas/debugfs.c1
-rw-r--r--drivers/net/wireless/ray_cs.c2
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00debug.c4
-rw-r--r--drivers/net/wireless/wl12xx/wl1251_debugfs.c2
-rw-r--r--drivers/net/wireless/wl12xx/wl1271_debugfs.c4
17 files changed, 81 insertions, 26 deletions
diff --git a/drivers/net/caif/caif_spi.c b/drivers/net/caif/caif_spi.c
index f5058ff2b210..8427533fe313 100644
--- a/drivers/net/caif/caif_spi.c
+++ b/drivers/net/caif/caif_spi.c
@@ -240,13 +240,15 @@ static ssize_t dbgfs_frame(struct file *file, char __user *user_buf,
240static const struct file_operations dbgfs_state_fops = { 240static const struct file_operations dbgfs_state_fops = {
241 .open = dbgfs_open, 241 .open = dbgfs_open,
242 .read = dbgfs_state, 242 .read = dbgfs_state,
243 .owner = THIS_MODULE 243 .owner = THIS_MODULE,
244 .llseek = default_llseek,
244}; 245};
245 246
246static const struct file_operations dbgfs_frame_fops = { 247static const struct file_operations dbgfs_frame_fops = {
247 .open = dbgfs_open, 248 .open = dbgfs_open,
248 .read = dbgfs_frame, 249 .read = dbgfs_frame,
249 .owner = THIS_MODULE 250 .owner = THIS_MODULE,
251 .llseek = default_llseek,
250}; 252};
251 253
252static inline void dev_debugfs_add(struct cfspi *cfspi) 254static inline void dev_debugfs_add(struct cfspi *cfspi)
diff --git a/drivers/net/cxgb4/cxgb4_main.c b/drivers/net/cxgb4/cxgb4_main.c
index c327527fbbc8..e2bf10d90add 100644
--- a/drivers/net/cxgb4/cxgb4_main.c
+++ b/drivers/net/cxgb4/cxgb4_main.c
@@ -2026,6 +2026,7 @@ static const struct file_operations mem_debugfs_fops = {
2026 .owner = THIS_MODULE, 2026 .owner = THIS_MODULE,
2027 .open = mem_open, 2027 .open = mem_open,
2028 .read = mem_read, 2028 .read = mem_read,
2029 .llseek = default_llseek,
2029}; 2030};
2030 2031
2031static void __devinit add_debugfs_mem(struct adapter *adap, const char *name, 2032static void __devinit add_debugfs_mem(struct adapter *adap, const char *name,
diff --git a/drivers/net/ppp_generic.c b/drivers/net/ppp_generic.c
index 6695a51e09e9..323e81e9e808 100644
--- a/drivers/net/ppp_generic.c
+++ b/drivers/net/ppp_generic.c
@@ -856,7 +856,8 @@ static const struct file_operations ppp_device_fops = {
856 .poll = ppp_poll, 856 .poll = ppp_poll,
857 .unlocked_ioctl = ppp_ioctl, 857 .unlocked_ioctl = ppp_ioctl,
858 .open = ppp_open, 858 .open = ppp_open,
859 .release = ppp_release 859 .release = ppp_release,
860 .llseek = noop_llseek,
860}; 861};
861 862
862static __net_init int ppp_init_net(struct net *net) 863static __net_init int ppp_init_net(struct net *net)
diff --git a/drivers/net/wimax/i2400m/debugfs.c b/drivers/net/wimax/i2400m/debugfs.c
index b1aec3e1892f..9c70b5fa3f51 100644
--- a/drivers/net/wimax/i2400m/debugfs.c
+++ b/drivers/net/wimax/i2400m/debugfs.c
@@ -119,6 +119,7 @@ const struct file_operations i2400m_rx_stats_fops = {
119 .open = i2400m_stats_open, 119 .open = i2400m_stats_open,
120 .read = i2400m_rx_stats_read, 120 .read = i2400m_rx_stats_read,
121 .write = i2400m_rx_stats_write, 121 .write = i2400m_rx_stats_write,
122 .llseek = default_llseek,
122}; 123};
123 124
124 125
@@ -171,6 +172,7 @@ const struct file_operations i2400m_tx_stats_fops = {
171 .open = i2400m_stats_open, 172 .open = i2400m_stats_open,
172 .read = i2400m_tx_stats_read, 173 .read = i2400m_tx_stats_read,
173 .write = i2400m_tx_stats_write, 174 .write = i2400m_tx_stats_write,
175 .llseek = default_llseek,
174}; 176};
175 177
176 178
diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c
index 1d05445d4ba3..ce77575e88b3 100644
--- a/drivers/net/wireless/airo.c
+++ b/drivers/net/wireless/airo.c
@@ -4430,21 +4430,24 @@ static const struct file_operations proc_statsdelta_ops = {
4430 .owner = THIS_MODULE, 4430 .owner = THIS_MODULE,
4431 .read = proc_read, 4431 .read = proc_read,
4432 .open = proc_statsdelta_open, 4432 .open = proc_statsdelta_open,
4433 .release = proc_close 4433 .release = proc_close,
4434 .llseek = default_llseek,
4434}; 4435};
4435 4436
4436static const struct file_operations proc_stats_ops = { 4437static const struct file_operations proc_stats_ops = {
4437 .owner = THIS_MODULE, 4438 .owner = THIS_MODULE,
4438 .read = proc_read, 4439 .read = proc_read,
4439 .open = proc_stats_open, 4440 .open = proc_stats_open,
4440 .release = proc_close 4441 .release = proc_close,
4442 .llseek = default_llseek,
4441}; 4443};
4442 4444
4443static const struct file_operations proc_status_ops = { 4445static const struct file_operations proc_status_ops = {
4444 .owner = THIS_MODULE, 4446 .owner = THIS_MODULE,
4445 .read = proc_read, 4447 .read = proc_read,
4446 .open = proc_status_open, 4448 .open = proc_status_open,
4447 .release = proc_close 4449 .release = proc_close,
4450 .llseek = default_llseek,
4448}; 4451};
4449 4452
4450static const struct file_operations proc_SSID_ops = { 4453static const struct file_operations proc_SSID_ops = {
@@ -4452,7 +4455,8 @@ static const struct file_operations proc_SSID_ops = {
4452 .read = proc_read, 4455 .read = proc_read,
4453 .write = proc_write, 4456 .write = proc_write,
4454 .open = proc_SSID_open, 4457 .open = proc_SSID_open,
4455 .release = proc_close 4458 .release = proc_close,
4459 .llseek = default_llseek,
4456}; 4460};
4457 4461
4458static const struct file_operations proc_BSSList_ops = { 4462static const struct file_operations proc_BSSList_ops = {
@@ -4460,7 +4464,8 @@ static const struct file_operations proc_BSSList_ops = {
4460 .read = proc_read, 4464 .read = proc_read,
4461 .write = proc_write, 4465 .write = proc_write,
4462 .open = proc_BSSList_open, 4466 .open = proc_BSSList_open,
4463 .release = proc_close 4467 .release = proc_close,
4468 .llseek = default_llseek,
4464}; 4469};
4465 4470
4466static const struct file_operations proc_APList_ops = { 4471static const struct file_operations proc_APList_ops = {
@@ -4468,7 +4473,8 @@ static const struct file_operations proc_APList_ops = {
4468 .read = proc_read, 4473 .read = proc_read,
4469 .write = proc_write, 4474 .write = proc_write,
4470 .open = proc_APList_open, 4475 .open = proc_APList_open,
4471 .release = proc_close 4476 .release = proc_close,
4477 .llseek = default_llseek,
4472}; 4478};
4473 4479
4474static const struct file_operations proc_config_ops = { 4480static const struct file_operations proc_config_ops = {
@@ -4476,7 +4482,8 @@ static const struct file_operations proc_config_ops = {
4476 .read = proc_read, 4482 .read = proc_read,
4477 .write = proc_write, 4483 .write = proc_write,
4478 .open = proc_config_open, 4484 .open = proc_config_open,
4479 .release = proc_close 4485 .release = proc_close,
4486 .llseek = default_llseek,
4480}; 4487};
4481 4488
4482static const struct file_operations proc_wepkey_ops = { 4489static const struct file_operations proc_wepkey_ops = {
@@ -4484,7 +4491,8 @@ static const struct file_operations proc_wepkey_ops = {
4484 .read = proc_read, 4491 .read = proc_read,
4485 .write = proc_write, 4492 .write = proc_write,
4486 .open = proc_wepkey_open, 4493 .open = proc_wepkey_open,
4487 .release = proc_close 4494 .release = proc_close,
4495 .llseek = default_llseek,
4488}; 4496};
4489 4497
4490static struct proc_dir_entry *airo_entry; 4498static struct proc_dir_entry *airo_entry;
diff --git a/drivers/net/wireless/ath/ath5k/debug.c b/drivers/net/wireless/ath/ath5k/debug.c
index 4cccc29964f6..fb339c3852ee 100644
--- a/drivers/net/wireless/ath/ath5k/debug.c
+++ b/drivers/net/wireless/ath/ath5k/debug.c
@@ -271,6 +271,7 @@ static const struct file_operations fops_beacon = {
271 .write = write_file_beacon, 271 .write = write_file_beacon,
272 .open = ath5k_debugfs_open, 272 .open = ath5k_debugfs_open,
273 .owner = THIS_MODULE, 273 .owner = THIS_MODULE,
274 .llseek = default_llseek,
274}; 275};
275 276
276 277
@@ -290,6 +291,7 @@ static const struct file_operations fops_reset = {
290 .write = write_file_reset, 291 .write = write_file_reset,
291 .open = ath5k_debugfs_open, 292 .open = ath5k_debugfs_open,
292 .owner = THIS_MODULE, 293 .owner = THIS_MODULE,
294 .llseek = noop_llseek,
293}; 295};
294 296
295 297
@@ -369,6 +371,7 @@ static const struct file_operations fops_debug = {
369 .write = write_file_debug, 371 .write = write_file_debug,
370 .open = ath5k_debugfs_open, 372 .open = ath5k_debugfs_open,
371 .owner = THIS_MODULE, 373 .owner = THIS_MODULE,
374 .llseek = default_llseek,
372}; 375};
373 376
374 377
@@ -480,6 +483,7 @@ static const struct file_operations fops_antenna = {
480 .write = write_file_antenna, 483 .write = write_file_antenna,
481 .open = ath5k_debugfs_open, 484 .open = ath5k_debugfs_open,
482 .owner = THIS_MODULE, 485 .owner = THIS_MODULE,
486 .llseek = default_llseek,
483}; 487};
484 488
485 489
@@ -591,6 +595,7 @@ static const struct file_operations fops_frameerrors = {
591 .write = write_file_frameerrors, 595 .write = write_file_frameerrors,
592 .open = ath5k_debugfs_open, 596 .open = ath5k_debugfs_open,
593 .owner = THIS_MODULE, 597 .owner = THIS_MODULE,
598 .llseek = default_llseek,
594}; 599};
595 600
596 601
@@ -748,6 +753,7 @@ static const struct file_operations fops_ani = {
748 .write = write_file_ani, 753 .write = write_file_ani,
749 .open = ath5k_debugfs_open, 754 .open = ath5k_debugfs_open,
750 .owner = THIS_MODULE, 755 .owner = THIS_MODULE,
756 .llseek = default_llseek,
751}; 757};
752 758
753 759
@@ -811,6 +817,7 @@ static const struct file_operations fops_queue = {
811 .write = write_file_queue, 817 .write = write_file_queue,
812 .open = ath5k_debugfs_open, 818 .open = ath5k_debugfs_open,
813 .owner = THIS_MODULE, 819 .owner = THIS_MODULE,
820 .llseek = default_llseek,
814}; 821};
815 822
816 823
diff --git a/drivers/net/wireless/ath/ath9k/debug.c b/drivers/net/wireless/ath/ath9k/debug.c
index 54aae931424e..cf500bf25ad5 100644
--- a/drivers/net/wireless/ath/ath9k/debug.c
+++ b/drivers/net/wireless/ath/ath9k/debug.c
@@ -71,7 +71,8 @@ static const struct file_operations fops_debug = {
71 .read = read_file_debug, 71 .read = read_file_debug,
72 .write = write_file_debug, 72 .write = write_file_debug,
73 .open = ath9k_debugfs_open, 73 .open = ath9k_debugfs_open,
74 .owner = THIS_MODULE 74 .owner = THIS_MODULE,
75 .llseek = default_llseek,
75}; 76};
76 77
77#endif 78#endif
@@ -116,7 +117,8 @@ static const struct file_operations fops_tx_chainmask = {
116 .read = read_file_tx_chainmask, 117 .read = read_file_tx_chainmask,
117 .write = write_file_tx_chainmask, 118 .write = write_file_tx_chainmask,
118 .open = ath9k_debugfs_open, 119 .open = ath9k_debugfs_open,
119 .owner = THIS_MODULE 120 .owner = THIS_MODULE,
121 .llseek = default_llseek,
120}; 122};
121 123
122 124
@@ -158,7 +160,8 @@ static const struct file_operations fops_rx_chainmask = {
158 .read = read_file_rx_chainmask, 160 .read = read_file_rx_chainmask,
159 .write = write_file_rx_chainmask, 161 .write = write_file_rx_chainmask,
160 .open = ath9k_debugfs_open, 162 .open = ath9k_debugfs_open,
161 .owner = THIS_MODULE 163 .owner = THIS_MODULE,
164 .llseek = default_llseek,
162}; 165};
163 166
164 167
@@ -259,7 +262,8 @@ static ssize_t read_file_dma(struct file *file, char __user *user_buf,
259static const struct file_operations fops_dma = { 262static const struct file_operations fops_dma = {
260 .read = read_file_dma, 263 .read = read_file_dma,
261 .open = ath9k_debugfs_open, 264 .open = ath9k_debugfs_open,
262 .owner = THIS_MODULE 265 .owner = THIS_MODULE,
266 .llseek = default_llseek,
263}; 267};
264 268
265 269
@@ -375,7 +379,8 @@ static ssize_t read_file_interrupt(struct file *file, char __user *user_buf,
375static const struct file_operations fops_interrupt = { 379static const struct file_operations fops_interrupt = {
376 .read = read_file_interrupt, 380 .read = read_file_interrupt,
377 .open = ath9k_debugfs_open, 381 .open = ath9k_debugfs_open,
378 .owner = THIS_MODULE 382 .owner = THIS_MODULE,
383 .llseek = default_llseek,
379}; 384};
380 385
381void ath_debug_stat_rc(struct ath_softc *sc, int final_rate) 386void ath_debug_stat_rc(struct ath_softc *sc, int final_rate)
@@ -464,7 +469,8 @@ static ssize_t read_file_rcstat(struct file *file, char __user *user_buf,
464static const struct file_operations fops_rcstat = { 469static const struct file_operations fops_rcstat = {
465 .read = read_file_rcstat, 470 .read = read_file_rcstat,
466 .open = ath9k_debugfs_open, 471 .open = ath9k_debugfs_open,
467 .owner = THIS_MODULE 472 .owner = THIS_MODULE,
473 .llseek = default_llseek,
468}; 474};
469 475
470static const char * ath_wiphy_state_str(enum ath_wiphy_state state) 476static const char * ath_wiphy_state_str(enum ath_wiphy_state state)
@@ -623,7 +629,8 @@ static const struct file_operations fops_wiphy = {
623 .read = read_file_wiphy, 629 .read = read_file_wiphy,
624 .write = write_file_wiphy, 630 .write = write_file_wiphy,
625 .open = ath9k_debugfs_open, 631 .open = ath9k_debugfs_open,
626 .owner = THIS_MODULE 632 .owner = THIS_MODULE,
633 .llseek = default_llseek,
627}; 634};
628 635
629#define PR(str, elem) \ 636#define PR(str, elem) \
@@ -702,7 +709,8 @@ void ath_debug_stat_tx(struct ath_softc *sc, struct ath_txq *txq,
702static const struct file_operations fops_xmit = { 709static const struct file_operations fops_xmit = {
703 .read = read_file_xmit, 710 .read = read_file_xmit,
704 .open = ath9k_debugfs_open, 711 .open = ath9k_debugfs_open,
705 .owner = THIS_MODULE 712 .owner = THIS_MODULE,
713 .llseek = default_llseek,
706}; 714};
707 715
708static ssize_t read_file_recv(struct file *file, char __user *user_buf, 716static ssize_t read_file_recv(struct file *file, char __user *user_buf,
@@ -814,7 +822,8 @@ void ath_debug_stat_rx(struct ath_softc *sc, struct ath_rx_status *rs)
814static const struct file_operations fops_recv = { 822static const struct file_operations fops_recv = {
815 .read = read_file_recv, 823 .read = read_file_recv,
816 .open = ath9k_debugfs_open, 824 .open = ath9k_debugfs_open,
817 .owner = THIS_MODULE 825 .owner = THIS_MODULE,
826 .llseek = default_llseek,
818}; 827};
819 828
820static ssize_t read_file_regidx(struct file *file, char __user *user_buf, 829static ssize_t read_file_regidx(struct file *file, char __user *user_buf,
@@ -852,7 +861,8 @@ static const struct file_operations fops_regidx = {
852 .read = read_file_regidx, 861 .read = read_file_regidx,
853 .write = write_file_regidx, 862 .write = write_file_regidx,
854 .open = ath9k_debugfs_open, 863 .open = ath9k_debugfs_open,
855 .owner = THIS_MODULE 864 .owner = THIS_MODULE,
865 .llseek = default_llseek,
856}; 866};
857 867
858static ssize_t read_file_regval(struct file *file, char __user *user_buf, 868static ssize_t read_file_regval(struct file *file, char __user *user_buf,
@@ -894,7 +904,8 @@ static const struct file_operations fops_regval = {
894 .read = read_file_regval, 904 .read = read_file_regval,
895 .write = write_file_regval, 905 .write = write_file_regval,
896 .open = ath9k_debugfs_open, 906 .open = ath9k_debugfs_open,
897 .owner = THIS_MODULE 907 .owner = THIS_MODULE,
908 .llseek = default_llseek,
898}; 909};
899 910
900int ath9k_init_debug(struct ath_hw *ah) 911int ath9k_init_debug(struct ath_hw *ah)
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
index 7d09b4b17bbd..bc2ca7d898e9 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
@@ -536,7 +536,8 @@ static ssize_t read_file_tgt_stats(struct file *file, char __user *user_buf,
536static const struct file_operations fops_tgt_stats = { 536static const struct file_operations fops_tgt_stats = {
537 .read = read_file_tgt_stats, 537 .read = read_file_tgt_stats,
538 .open = ath9k_debugfs_open, 538 .open = ath9k_debugfs_open,
539 .owner = THIS_MODULE 539 .owner = THIS_MODULE,
540 .llseek = default_llseek,
540}; 541};
541 542
542static ssize_t read_file_xmit(struct file *file, char __user *user_buf, 543static ssize_t read_file_xmit(struct file *file, char __user *user_buf,
@@ -584,7 +585,8 @@ static ssize_t read_file_xmit(struct file *file, char __user *user_buf,
584static const struct file_operations fops_xmit = { 585static const struct file_operations fops_xmit = {
585 .read = read_file_xmit, 586 .read = read_file_xmit,
586 .open = ath9k_debugfs_open, 587 .open = ath9k_debugfs_open,
587 .owner = THIS_MODULE 588 .owner = THIS_MODULE,
589 .llseek = default_llseek,
588}; 590};
589 591
590static ssize_t read_file_recv(struct file *file, char __user *user_buf, 592static ssize_t read_file_recv(struct file *file, char __user *user_buf,
@@ -613,7 +615,8 @@ static ssize_t read_file_recv(struct file *file, char __user *user_buf,
613static const struct file_operations fops_recv = { 615static const struct file_operations fops_recv = {
614 .read = read_file_recv, 616 .read = read_file_recv,
615 .open = ath9k_debugfs_open, 617 .open = ath9k_debugfs_open,
616 .owner = THIS_MODULE 618 .owner = THIS_MODULE,
619 .llseek = default_llseek,
617}; 620};
618 621
619int ath9k_htc_init_debug(struct ath_hw *ah) 622int ath9k_htc_init_debug(struct ath_hw *ah)
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945-rs.c b/drivers/net/wireless/iwlwifi/iwl-3945-rs.c
index 8e84a08ff951..293e1dbc166c 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945-rs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-3945-rs.c
@@ -873,6 +873,7 @@ static ssize_t iwl3945_sta_dbgfs_stats_table_read(struct file *file,
873static const struct file_operations rs_sta_dbgfs_stats_table_ops = { 873static const struct file_operations rs_sta_dbgfs_stats_table_ops = {
874 .read = iwl3945_sta_dbgfs_stats_table_read, 874 .read = iwl3945_sta_dbgfs_stats_table_read,
875 .open = iwl3945_open_file_generic, 875 .open = iwl3945_open_file_generic,
876 .llseek = default_llseek,
876}; 877};
877 878
878static void iwl3945_add_debugfs(void *priv, void *priv_sta, 879static void iwl3945_add_debugfs(void *priv, void *priv_sta,
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
index 23e5c42e7d7e..a4378ba31ef6 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
@@ -2873,6 +2873,7 @@ static const struct file_operations rs_sta_dbgfs_scale_table_ops = {
2873 .write = rs_sta_dbgfs_scale_table_write, 2873 .write = rs_sta_dbgfs_scale_table_write,
2874 .read = rs_sta_dbgfs_scale_table_read, 2874 .read = rs_sta_dbgfs_scale_table_read,
2875 .open = open_file_generic, 2875 .open = open_file_generic,
2876 .llseek = default_llseek,
2876}; 2877};
2877static ssize_t rs_sta_dbgfs_stats_table_read(struct file *file, 2878static ssize_t rs_sta_dbgfs_stats_table_read(struct file *file,
2878 char __user *user_buf, size_t count, loff_t *ppos) 2879 char __user *user_buf, size_t count, loff_t *ppos)
@@ -2915,6 +2916,7 @@ static ssize_t rs_sta_dbgfs_stats_table_read(struct file *file,
2915static const struct file_operations rs_sta_dbgfs_stats_table_ops = { 2916static const struct file_operations rs_sta_dbgfs_stats_table_ops = {
2916 .read = rs_sta_dbgfs_stats_table_read, 2917 .read = rs_sta_dbgfs_stats_table_read,
2917 .open = open_file_generic, 2918 .open = open_file_generic,
2919 .llseek = default_llseek,
2918}; 2920};
2919 2921
2920static ssize_t rs_sta_dbgfs_rate_scale_data_read(struct file *file, 2922static ssize_t rs_sta_dbgfs_rate_scale_data_read(struct file *file,
@@ -2946,6 +2948,7 @@ static ssize_t rs_sta_dbgfs_rate_scale_data_read(struct file *file,
2946static const struct file_operations rs_sta_dbgfs_rate_scale_data_ops = { 2948static const struct file_operations rs_sta_dbgfs_rate_scale_data_ops = {
2947 .read = rs_sta_dbgfs_rate_scale_data_read, 2949 .read = rs_sta_dbgfs_rate_scale_data_read,
2948 .open = open_file_generic, 2950 .open = open_file_generic,
2951 .llseek = default_llseek,
2949}; 2952};
2950 2953
2951static void rs_add_debugfs(void *priv, void *priv_sta, 2954static void rs_add_debugfs(void *priv, void *priv_sta,
diff --git a/drivers/net/wireless/iwmc3200wifi/debugfs.c b/drivers/net/wireless/iwmc3200wifi/debugfs.c
index 53b0b7711f02..0a0cc9667cd6 100644
--- a/drivers/net/wireless/iwmc3200wifi/debugfs.c
+++ b/drivers/net/wireless/iwmc3200wifi/debugfs.c
@@ -402,24 +402,28 @@ static const struct file_operations iwm_debugfs_txq_fops = {
402 .owner = THIS_MODULE, 402 .owner = THIS_MODULE,
403 .open = iwm_generic_open, 403 .open = iwm_generic_open,
404 .read = iwm_debugfs_txq_read, 404 .read = iwm_debugfs_txq_read,
405 .llseek = default_llseek,
405}; 406};
406 407
407static const struct file_operations iwm_debugfs_tx_credit_fops = { 408static const struct file_operations iwm_debugfs_tx_credit_fops = {
408 .owner = THIS_MODULE, 409 .owner = THIS_MODULE,
409 .open = iwm_generic_open, 410 .open = iwm_generic_open,
410 .read = iwm_debugfs_tx_credit_read, 411 .read = iwm_debugfs_tx_credit_read,
412 .llseek = default_llseek,
411}; 413};
412 414
413static const struct file_operations iwm_debugfs_rx_ticket_fops = { 415static const struct file_operations iwm_debugfs_rx_ticket_fops = {
414 .owner = THIS_MODULE, 416 .owner = THIS_MODULE,
415 .open = iwm_generic_open, 417 .open = iwm_generic_open,
416 .read = iwm_debugfs_rx_ticket_read, 418 .read = iwm_debugfs_rx_ticket_read,
419 .llseek = default_llseek,
417}; 420};
418 421
419static const struct file_operations iwm_debugfs_fw_err_fops = { 422static const struct file_operations iwm_debugfs_fw_err_fops = {
420 .owner = THIS_MODULE, 423 .owner = THIS_MODULE,
421 .open = iwm_generic_open, 424 .open = iwm_generic_open,
422 .read = iwm_debugfs_fw_err_read, 425 .read = iwm_debugfs_fw_err_read,
426 .llseek = default_llseek,
423}; 427};
424 428
425void iwm_debugfs_init(struct iwm_priv *iwm) 429void iwm_debugfs_init(struct iwm_priv *iwm)
diff --git a/drivers/net/wireless/iwmc3200wifi/sdio.c b/drivers/net/wireless/iwmc3200wifi/sdio.c
index edcb52330cf5..56383e7be835 100644
--- a/drivers/net/wireless/iwmc3200wifi/sdio.c
+++ b/drivers/net/wireless/iwmc3200wifi/sdio.c
@@ -364,6 +364,7 @@ static const struct file_operations iwm_debugfs_sdio_fops = {
364 .owner = THIS_MODULE, 364 .owner = THIS_MODULE,
365 .open = iwm_debugfs_sdio_open, 365 .open = iwm_debugfs_sdio_open,
366 .read = iwm_debugfs_sdio_read, 366 .read = iwm_debugfs_sdio_read,
367 .llseek = default_llseek,
367}; 368};
368 369
369static void if_sdio_debugfs_init(struct iwm_priv *iwm, struct dentry *parent_dir) 370static void if_sdio_debugfs_init(struct iwm_priv *iwm, struct dentry *parent_dir)
diff --git a/drivers/net/wireless/libertas/debugfs.c b/drivers/net/wireless/libertas/debugfs.c
index 74e94cc10e01..fbf3b0332bb7 100644
--- a/drivers/net/wireless/libertas/debugfs.c
+++ b/drivers/net/wireless/libertas/debugfs.c
@@ -962,6 +962,7 @@ static const struct file_operations lbs_debug_fops = {
962 .open = open_file_generic, 962 .open = open_file_generic,
963 .write = lbs_debugfs_write, 963 .write = lbs_debugfs_write,
964 .read = lbs_debugfs_read, 964 .read = lbs_debugfs_read,
965 .llseek = default_llseek,
965}; 966};
966 967
967/** 968/**
diff --git a/drivers/net/wireless/ray_cs.c b/drivers/net/wireless/ray_cs.c
index 88560d0ae50a..dab30a8c7470 100644
--- a/drivers/net/wireless/ray_cs.c
+++ b/drivers/net/wireless/ray_cs.c
@@ -2802,6 +2802,7 @@ static ssize_t ray_cs_essid_proc_write(struct file *file,
2802static const struct file_operations ray_cs_essid_proc_fops = { 2802static const struct file_operations ray_cs_essid_proc_fops = {
2803 .owner = THIS_MODULE, 2803 .owner = THIS_MODULE,
2804 .write = ray_cs_essid_proc_write, 2804 .write = ray_cs_essid_proc_write,
2805 .llseek = noop_llseek,
2805}; 2806};
2806 2807
2807static ssize_t int_proc_write(struct file *file, const char __user *buffer, 2808static ssize_t int_proc_write(struct file *file, const char __user *buffer,
@@ -2835,6 +2836,7 @@ static ssize_t int_proc_write(struct file *file, const char __user *buffer,
2835static const struct file_operations int_proc_fops = { 2836static const struct file_operations int_proc_fops = {
2836 .owner = THIS_MODULE, 2837 .owner = THIS_MODULE,
2837 .write = int_proc_write, 2838 .write = int_proc_write,
2839 .llseek = noop_llseek,
2838}; 2840};
2839#endif 2841#endif
2840 2842
diff --git a/drivers/net/wireless/rt2x00/rt2x00debug.c b/drivers/net/wireless/rt2x00/rt2x00debug.c
index 7d6f19a2805e..cea81e4c5c82 100644
--- a/drivers/net/wireless/rt2x00/rt2x00debug.c
+++ b/drivers/net/wireless/rt2x00/rt2x00debug.c
@@ -315,6 +315,7 @@ static const struct file_operations rt2x00debug_fop_queue_dump = {
315 .poll = rt2x00debug_poll_queue_dump, 315 .poll = rt2x00debug_poll_queue_dump,
316 .open = rt2x00debug_open_queue_dump, 316 .open = rt2x00debug_open_queue_dump,
317 .release = rt2x00debug_release_queue_dump, 317 .release = rt2x00debug_release_queue_dump,
318 .llseek = default_llseek,
318}; 319};
319 320
320static ssize_t rt2x00debug_read_queue_stats(struct file *file, 321static ssize_t rt2x00debug_read_queue_stats(struct file *file,
@@ -371,6 +372,7 @@ static const struct file_operations rt2x00debug_fop_queue_stats = {
371 .read = rt2x00debug_read_queue_stats, 372 .read = rt2x00debug_read_queue_stats,
372 .open = rt2x00debug_file_open, 373 .open = rt2x00debug_file_open,
373 .release = rt2x00debug_file_release, 374 .release = rt2x00debug_file_release,
375 .llseek = default_llseek,
374}; 376};
375 377
376#ifdef CONFIG_RT2X00_LIB_CRYPTO 378#ifdef CONFIG_RT2X00_LIB_CRYPTO
@@ -423,6 +425,7 @@ static const struct file_operations rt2x00debug_fop_crypto_stats = {
423 .read = rt2x00debug_read_crypto_stats, 425 .read = rt2x00debug_read_crypto_stats,
424 .open = rt2x00debug_file_open, 426 .open = rt2x00debug_file_open,
425 .release = rt2x00debug_file_release, 427 .release = rt2x00debug_file_release,
428 .llseek = default_llseek,
426}; 429};
427#endif 430#endif
428 431
@@ -543,6 +546,7 @@ static const struct file_operations rt2x00debug_fop_dev_flags = {
543 .read = rt2x00debug_read_dev_flags, 546 .read = rt2x00debug_read_dev_flags,
544 .open = rt2x00debug_file_open, 547 .open = rt2x00debug_file_open,
545 .release = rt2x00debug_file_release, 548 .release = rt2x00debug_file_release,
549 .llseek = default_llseek,
546}; 550};
547 551
548static struct dentry *rt2x00debug_create_file_driver(const char *name, 552static struct dentry *rt2x00debug_create_file_driver(const char *name,
diff --git a/drivers/net/wireless/wl12xx/wl1251_debugfs.c b/drivers/net/wireless/wl12xx/wl1251_debugfs.c
index a4ae7c4d94b5..fa620a5e5303 100644
--- a/drivers/net/wireless/wl12xx/wl1251_debugfs.c
+++ b/drivers/net/wireless/wl12xx/wl1251_debugfs.c
@@ -238,6 +238,7 @@ static ssize_t tx_queue_len_read(struct file *file, char __user *userbuf,
238static const struct file_operations tx_queue_len_ops = { 238static const struct file_operations tx_queue_len_ops = {
239 .read = tx_queue_len_read, 239 .read = tx_queue_len_read,
240 .open = wl1251_open_file_generic, 240 .open = wl1251_open_file_generic,
241 .llseek = generic_file_llseek,
241}; 242};
242 243
243static ssize_t tx_queue_status_read(struct file *file, char __user *userbuf, 244static ssize_t tx_queue_status_read(struct file *file, char __user *userbuf,
@@ -259,6 +260,7 @@ static ssize_t tx_queue_status_read(struct file *file, char __user *userbuf,
259static const struct file_operations tx_queue_status_ops = { 260static const struct file_operations tx_queue_status_ops = {
260 .read = tx_queue_status_read, 261 .read = tx_queue_status_read,
261 .open = wl1251_open_file_generic, 262 .open = wl1251_open_file_generic,
263 .llseek = generic_file_llseek,
262}; 264};
263 265
264static void wl1251_debugfs_delete_files(struct wl1251 *wl) 266static void wl1251_debugfs_delete_files(struct wl1251 *wl)
diff --git a/drivers/net/wireless/wl12xx/wl1271_debugfs.c b/drivers/net/wireless/wl12xx/wl1271_debugfs.c
index 6e25303a8e7f..66c2b90ddfd4 100644
--- a/drivers/net/wireless/wl12xx/wl1271_debugfs.c
+++ b/drivers/net/wireless/wl12xx/wl1271_debugfs.c
@@ -239,6 +239,7 @@ static ssize_t tx_queue_len_read(struct file *file, char __user *userbuf,
239static const struct file_operations tx_queue_len_ops = { 239static const struct file_operations tx_queue_len_ops = {
240 .read = tx_queue_len_read, 240 .read = tx_queue_len_read,
241 .open = wl1271_open_file_generic, 241 .open = wl1271_open_file_generic,
242 .llseek = default_llseek,
242}; 243};
243 244
244static ssize_t gpio_power_read(struct file *file, char __user *user_buf, 245static ssize_t gpio_power_read(struct file *file, char __user *user_buf,
@@ -293,7 +294,8 @@ out:
293static const struct file_operations gpio_power_ops = { 294static const struct file_operations gpio_power_ops = {
294 .read = gpio_power_read, 295 .read = gpio_power_read,
295 .write = gpio_power_write, 296 .write = gpio_power_write,
296 .open = wl1271_open_file_generic 297 .open = wl1271_open_file_generic,
298 .llseek = default_llseek,
297}; 299};
298 300
299static void wl1271_debugfs_delete_files(struct wl1271 *wl) 301static void wl1271_debugfs_delete_files(struct wl1271 *wl)