Skip to content

Commit

Permalink
kernel/user.c: Use list_for_each_entry instead of list_for_each
Browse files Browse the repository at this point in the history
kernel/user.c: Convert list_for_each to list_for_each_entry in
uid_hash_find()

Signed-off-by: Matthias Kaehlcke <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Matthias Kaehlcke authored and Linus Torvalds committed Sep 19, 2007
1 parent ef2b02d commit d8a4821
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions kernel/user.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,9 @@ static inline void uid_hash_remove(struct user_struct *up)

static inline struct user_struct *uid_hash_find(uid_t uid, struct list_head *hashent)
{
struct list_head *up;

list_for_each(up, hashent) {
struct user_struct *user;

user = list_entry(up, struct user_struct, uidhash_list);
struct user_struct *user;

list_for_each_entry(user, hashent, uidhash_list) {
if(user->uid == uid) {
atomic_inc(&user->__count);
return user;
Expand Down

0 comments on commit d8a4821

Please sign in to comment.