yaffs: Fix some 64-bit issues linux-mainline-rc-01
authorCharles Manning <cdhmanning@gmail.com>
Wed, 27 Oct 2010 02:15:00 +0000 (15:15 +1300)
committerCharles Manning <cdhmanning@gmail.com>
Wed, 27 Oct 2010 02:15:00 +0000 (15:15 +1300)
Not previously compiling cleanly for 64-bit.

Signed-off-by: Charles Manning <cdhmanning@gmail.com>
yaffs_vfs.c
yaffs_vfs_multi.c

index 371ddd1..b1b6840 100644 (file)
@@ -512,7 +512,7 @@ static int yaffs_readlink(struct dentry *dentry, char __user *buffer,
 static void *yaffs_follow_link(struct dentry *dentry, struct nameidata *nd)
 {
        unsigned char *alias;
-       int ret;
+       void *ret;
        yaffs_dev_t *dev = yaffs_dentry_to_obj(dentry)->my_dev;
 
        yaffs_gross_lock(dev);
@@ -521,14 +521,14 @@ static void *yaffs_follow_link(struct dentry *dentry, struct nameidata *nd)
        yaffs_gross_unlock(dev);
 
        if (!alias) {
-               ret = -ENOMEM;
+               ret = ERR_PTR(-ENOMEM);
                goto out;
        }
 
        nd_set_link(nd, alias);
-       ret = (int)alias;
+       ret = (void *)alias;
 out:
-       return ERR_PTR(ret);
+       return ret;
 }
 
 void yaffs_put_link(struct dentry *dentry, struct nameidata *nd, void *alias) {
index d6c25b5..3bd5aea 100644 (file)
@@ -730,12 +730,15 @@ static int yaffs_readlink(struct dentry *dentry, char __user *buffer,
 
 #if (YAFFS_NEW_FOLLOW_LINK == 1)
 static void *yaffs_follow_link(struct dentry *dentry, struct nameidata *nd)
+{
+       void *ret;
 #else
 static int yaffs_follow_link(struct dentry *dentry, struct nameidata *nd)
-#endif
 {
+       int ret
+#endif
        unsigned char *alias;
-       int ret;
+       int ret_int = 0;
        yaffs_dev_t *dev = yaffs_dentry_to_obj(dentry)->my_dev;
 
        yaffs_gross_lock(dev);
@@ -744,19 +747,23 @@ static int yaffs_follow_link(struct dentry *dentry, struct nameidata *nd)
        yaffs_gross_unlock(dev);
 
        if (!alias) {
-               ret = -ENOMEM;
+               ret_int = -ENOMEM;
                goto out;
        }
 
 #if (YAFFS_NEW_FOLLOW_LINK == 1)
        nd_set_link(nd, alias);
-       ret = (int)alias;
+       ret = alias;
 out:
-       return ERR_PTR(ret);
+       if(ret_int)
+               ret = ERR_PTR(ret_int);
+       return ret;
 #else
        ret = vfs_follow_link(nd, alias);
        kfree(alias);
 out:
+       if(ret_int)
+               ret = ret_int;
        return ret;
 #endif
 }