Commit 321bb472 authored by Randy Dunlap's avatar Randy Dunlap Committed by Linus Torvalds

[PATCH] Fix sparse warning in fs/proc/base.c

From: Mika Kukkonen <mika@osdl.org>
Signed-off-by: default avatarRandy Dunlap <rddunlap@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 55449851
...@@ -1463,7 +1463,8 @@ static struct inode_operations proc_tid_attr_inode_operations = { ...@@ -1463,7 +1463,8 @@ static struct inode_operations proc_tid_attr_inode_operations = {
/* /*
* /proc/self: * /proc/self:
*/ */
static int proc_self_readlink(struct dentry *dentry, char *buffer, int buflen) static int proc_self_readlink(struct dentry *dentry, char __user *buffer,
int buflen)
{ {
char tmp[30]; char tmp[30];
sprintf(tmp, "%d", current->tgid); sprintf(tmp, "%d", current->tgid);
...@@ -1747,7 +1748,9 @@ int proc_pid_readdir(struct file * filp, void * dirent, filldir_t filldir) ...@@ -1747,7 +1748,9 @@ int proc_pid_readdir(struct file * filp, void * dirent, filldir_t filldir)
ino_t ino = fake_ino(tgid,PROC_TGID_INO); ino_t ino = fake_ino(tgid,PROC_TGID_INO);
unsigned long j = PROC_NUMBUF; unsigned long j = PROC_NUMBUF;
do buf[--j] = '0' + (tgid % 10); while (tgid/=10); do
buf[--j] = '0' + (tgid % 10);
while ((tgid /= 10) != 0);
if (filldir(dirent, buf+j, PROC_NUMBUF-j, filp->f_pos, ino, DT_DIR) < 0) { if (filldir(dirent, buf+j, PROC_NUMBUF-j, filp->f_pos, ino, DT_DIR) < 0) {
filp->f_version = tgid; filp->f_version = tgid;
...@@ -1799,7 +1802,7 @@ static int proc_task_readdir(struct file * filp, void * dirent, filldir_t filldi ...@@ -1799,7 +1802,7 @@ static int proc_task_readdir(struct file * filp, void * dirent, filldir_t filldi
do do
buf[--j] = '0' + (tid % 10); buf[--j] = '0' + (tid % 10);
while (tid /= 10); while ((tid /= 10) != 0);
if (filldir(dirent, buf+j, PROC_NUMBUF-j, pos, ino, DT_DIR) < 0) if (filldir(dirent, buf+j, PROC_NUMBUF-j, pos, ino, DT_DIR) < 0)
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment