lkml.org 
[lkml]   [2007]   [Jul]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH 3/5] 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>

--

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@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2007-07-22 20:53    [W:0.046 / U:0.352 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site