]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - fs/ncpfs/dir.c
Merge tag 'mac80211-for-john-2014-10-23' of git://git.kernel.org/pub/scm/linux/kernel...
[karo-tx-linux.git] / fs / ncpfs / dir.c
index 08b8ea8c353edaf4966fe0f385e1cc22691851dd..7cb751dfbeef0a86d94237292d09e591e249f4e7 100644 (file)
@@ -388,7 +388,6 @@ static struct dentry *
 ncp_dget_fpos(struct dentry *dentry, struct dentry *parent, unsigned long fpos)
 {
        struct dentry *dent = dentry;
-       struct list_head *next;
 
        if (d_validate(dent, parent)) {
                if (dent->d_name.len <= NCP_MAXPATHLEN &&
@@ -404,9 +403,7 @@ ncp_dget_fpos(struct dentry *dentry, struct dentry *parent, unsigned long fpos)
 
        /* If a pointer is invalid, we search the dentry. */
        spin_lock(&parent->d_lock);
-       next = parent->d_subdirs.next;
-       while (next != &parent->d_subdirs) {
-               dent = list_entry(next, struct dentry, d_u.d_child);
+       list_for_each_entry(dent, &parent->d_subdirs, d_u.d_child) {
                if ((unsigned long)dent->d_fsdata == fpos) {
                        if (dent->d_inode)
                                dget(dent);
@@ -415,7 +412,6 @@ ncp_dget_fpos(struct dentry *dentry, struct dentry *parent, unsigned long fpos)
                        spin_unlock(&parent->d_lock);
                        goto out;
                }
-               next = next->next;
        }
        spin_unlock(&parent->d_lock);
        return NULL;
@@ -1182,9 +1178,6 @@ static int day_n[] =
 {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 0, 0, 0, 0};
 /* Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec */
 
-
-extern struct timezone sys_tz;
-
 static int utc2local(int time)
 {
        return time - sys_tz.tz_minuteswest * 60;