Skip to content

Commit 76df0c2

Browse files
Alexey DobriyanLinus Torvalds
authored andcommitted
proc: simplify function prototypes
Move code around so as to reduce the number of forward-declarations. Signed-off-by: Alexey Dobriyan <adobriyan@sw.ru> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 4237e0d commit 76df0c2

2 files changed

Lines changed: 6 additions & 15 deletions

File tree

fs/proc/generic.c

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,6 @@
2525

2626
#include "internal.h"
2727

28-
static ssize_t proc_file_read(struct file *file, char __user *buf,
29-
size_t nbytes, loff_t *ppos);
30-
static ssize_t proc_file_write(struct file *file, const char __user *buffer,
31-
size_t count, loff_t *ppos);
32-
static loff_t proc_file_lseek(struct file *, loff_t, int);
33-
3428
DEFINE_SPINLOCK(proc_subdir_lock);
3529

3630
static int proc_match(int len, const char *name, struct proc_dir_entry *de)
@@ -40,12 +34,6 @@ static int proc_match(int len, const char *name, struct proc_dir_entry *de)
4034
return !memcmp(name, de->name, len);
4135
}
4236

43-
static const struct file_operations proc_file_operations = {
44-
.llseek = proc_file_lseek,
45-
.read = proc_file_read,
46-
.write = proc_file_write,
47-
};
48-
4937
/* buffer size is one page but our output routines use some slack for overruns */
5038
#define PROC_BLOCK_SIZE (PAGE_SIZE - 1024)
5139

@@ -233,6 +221,12 @@ proc_file_lseek(struct file *file, loff_t offset, int orig)
233221
return retval;
234222
}
235223

224+
static const struct file_operations proc_file_operations = {
225+
.llseek = proc_file_lseek,
226+
.read = proc_file_read,
227+
.write = proc_file_write,
228+
};
229+
236230
static int proc_notify_change(struct dentry *dentry, struct iattr *iattr)
237231
{
238232
struct inode *inode = dentry->d_inode;

fs/proc/proc_tty.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@
1515
#include <linux/seq_file.h>
1616
#include <linux/bitops.h>
1717

18-
static int tty_ldiscs_read_proc(char *page, char **start, off_t off,
19-
int count, int *eof, void *data);
20-
2118
/*
2219
* The /proc/tty directory inodes...
2320
*/

0 commit comments

Comments
 (0)