Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <adobriyan@gmail.com>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Alexey Dobriyan and committed by
Linus Torvalds
a4ef3895 94116929

+5 -5
+3 -3
fs/proc/base.c
··· 1846 1846 * by stat. 1847 1847 */ 1848 1848 bool proc_fill_cache(struct file *file, struct dir_context *ctx, 1849 - const char *name, int len, 1849 + const char *name, unsigned int len, 1850 1850 instantiate_t instantiate, struct task_struct *task, const void *ptr) 1851 1851 { 1852 1852 struct dentry *child, *dir = file->f_path.dentry; ··· 3222 3222 iter.task; 3223 3223 iter.tgid += 1, iter = next_tgid(ns, iter)) { 3224 3224 char name[10 + 1]; 3225 - int len; 3225 + unsigned int len; 3226 3226 3227 3227 cond_resched(); 3228 3228 if (!has_pid_permissions(ns, iter.task, HIDEPID_INVISIBLE)) ··· 3549 3549 task; 3550 3550 task = next_tid(task), ctx->pos++) { 3551 3551 char name[10 + 1]; 3552 - int len; 3552 + unsigned int len; 3553 3553 tid = task_pid_nr_ns(task, ns); 3554 3554 len = snprintf(name, sizeof(name), "%u", tid); 3555 3555 if (!proc_fill_cache(file, ctx, name, len,
+1 -1
fs/proc/fd.c
··· 248 248 struct file *f; 249 249 struct fd_data data; 250 250 char name[10 + 1]; 251 - int len; 251 + unsigned int len; 252 252 253 253 f = fcheck_files(files, fd); 254 254 if (!f)
+1 -1
fs/proc/internal.h
··· 163 163 /* Lookups */ 164 164 typedef struct dentry *instantiate_t(struct dentry *, 165 165 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, 167 167 instantiate_t, struct task_struct *, const void *); 168 168 169 169 /*