[PATCH 3/5] kernel/user.c: Use list_for_each_entry instead of list_for_each

From: Matthias Kaehlcke
Date: Sun Jul 22 2007 - 14:51:12 EST


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

Signed-off-by: Matthias Kaehlcke <matthias.kaehlcke@xxxxxxxxx>

--

diff --git a/kernel/user.c b/kernel/user.c
index 4869563..d0363d1 100644
--- a/kernel/user.c
+++ b/kernel/user.c
@@ -68,13 +68,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;

--
Matthias Kaehlcke
Linux Application Developer
Barcelona


Usually when people are sad, they don't do anything. They just cry over
their condition. But when they get angry, they bring about a change
(Malcolm X)
.''`.
using free software / Debian GNU/Linux | http://debian.org : :' :
`. `'`
gpg --keyserver pgp.mit.edu --recv-keys 47D8E5D4 `-
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/