Skip to content

Commit a4ef389

Browse files
Alexey Dobriyantorvalds
authored andcommitted
proc: use "unsigned int" in proc_fill_cache()
All those lengths are unsigned as they should be. Link: http://lkml.kernel.org/r/20180423213751.GC9043@avx2 Signed-off-by: Alexey Dobriyan <[email protected]> Reviewed-by: Andrew Morton <[email protected]> Cc: Al Viro <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 9411692 commit a4ef389

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

fs/proc/base.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1846,7 +1846,7 @@ const struct dentry_operations pid_dentry_operations =
18461846
* by stat.
18471847
*/
18481848
bool proc_fill_cache(struct file *file, struct dir_context *ctx,
1849-
const char *name, int len,
1849+
const char *name, unsigned int len,
18501850
instantiate_t instantiate, struct task_struct *task, const void *ptr)
18511851
{
18521852
struct dentry *child, *dir = file->f_path.dentry;
@@ -3222,7 +3222,7 @@ int proc_pid_readdir(struct file *file, struct dir_context *ctx)
32223222
iter.task;
32233223
iter.tgid += 1, iter = next_tgid(ns, iter)) {
32243224
char name[10 + 1];
3225-
int len;
3225+
unsigned int len;
32263226

32273227
cond_resched();
32283228
if (!has_pid_permissions(ns, iter.task, HIDEPID_INVISIBLE))
@@ -3549,7 +3549,7 @@ static int proc_task_readdir(struct file *file, struct dir_context *ctx)
35493549
task;
35503550
task = next_tid(task), ctx->pos++) {
35513551
char name[10 + 1];
3552-
int len;
3552+
unsigned int len;
35533553
tid = task_pid_nr_ns(task, ns);
35543554
len = snprintf(name, sizeof(name), "%u", tid);
35553555
if (!proc_fill_cache(file, ctx, name, len,

fs/proc/fd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ static int proc_readfd_common(struct file *file, struct dir_context *ctx,
248248
struct file *f;
249249
struct fd_data data;
250250
char name[10 + 1];
251-
int len;
251+
unsigned int len;
252252

253253
f = fcheck_files(files, fd);
254254
if (!f)

fs/proc/internal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ extern loff_t mem_lseek(struct file *, loff_t, int);
163163
/* Lookups */
164164
typedef struct dentry *instantiate_t(struct dentry *,
165165
struct task_struct *, const void *);
166-
extern bool proc_fill_cache(struct file *, struct dir_context *, const char *, int,
166+
bool proc_fill_cache(struct file *, struct dir_context *, const char *, unsigned int,
167167
instantiate_t, struct task_struct *, const void *);
168168

169169
/*

0 commit comments

Comments
 (0)