Skip to content

Commit

Permalink
Remove unused variables from fs/proc/base.c
Browse files Browse the repository at this point in the history
When removing the explicit task_struct->pid usage I found that
proc_readfd_common() and proc_pident_readdir() get this field, but do not
use it at all.  So this cleanup is a cheap help with the task_struct->pid
isolation.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Pavel Emelyanov authored and Linus Torvalds committed Oct 19, 2007
1 parent 19c5870 commit 457c251
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions fs/proc/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -1519,7 +1519,7 @@ static int proc_readfd_common(struct file * filp, void * dirent,
struct dentry *dentry = filp->f_path.dentry;
struct inode *inode = dentry->d_inode;
struct task_struct *p = get_proc_task(inode);
unsigned int fd, tid, ino;
unsigned int fd, ino;
int retval;
struct files_struct * files;
struct fdtable *fdt;
Expand All @@ -1528,7 +1528,6 @@ static int proc_readfd_common(struct file * filp, void * dirent,
if (!p)
goto out_no_task;
retval = 0;
tid = p->pid;

fd = filp->f_pos;
switch (fd) {
Expand Down Expand Up @@ -1763,7 +1762,6 @@ static int proc_pident_readdir(struct file *filp,
const struct pid_entry *ents, unsigned int nents)
{
int i;
int pid;
struct dentry *dentry = filp->f_path.dentry;
struct inode *inode = dentry->d_inode;
struct task_struct *task = get_proc_task(inode);
Expand All @@ -1776,7 +1774,6 @@ static int proc_pident_readdir(struct file *filp,
goto out_no_task;

ret = 0;
pid = task->pid;
i = filp->f_pos;
switch (i) {
case 0:
Expand Down

0 comments on commit 457c251

Please sign in to comment.