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

Configure Feed

Select the types of activity you want to include in your feed.

kernel/user.c: Use list_for_each_entry instead of list_for_each

kernel/user.c: Convert list_for_each to list_for_each_entry in
uid_hash_find()

Signed-off-by: Matthias Kaehlcke <matthias.kaehlcke@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Matthias Kaehlcke and committed by
Linus Torvalds
d8a4821d ef2b02d3

+2 -6
+2 -6
kernel/user.c
··· 67 67 68 68 static inline struct user_struct *uid_hash_find(uid_t uid, struct list_head *hashent) 69 69 { 70 - struct list_head *up; 70 + struct user_struct *user; 71 71 72 - list_for_each(up, hashent) { 73 - struct user_struct *user; 74 - 75 - user = list_entry(up, struct user_struct, uidhash_list); 76 - 72 + list_for_each_entry(user, hashent, uidhash_list) { 77 73 if(user->uid == uid) { 78 74 atomic_inc(&user->__count); 79 75 return user;