From 9bdabdaa8467f3f56359598434e0f6f254c100e9 Mon Sep 17 00:00:00 2001 From: Charles Manning Date: Wed, 27 Oct 2010 15:15:00 +1300 Subject: [PATCH 1/1] yaffs: Fix some 64-bit issues Not previously compiling cleanly for 64-bit. Signed-off-by: Charles Manning --- yaffs_vfs.c | 8 ++++---- yaffs_vfs_multi.c | 17 ++++++++++++----- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/yaffs_vfs.c b/yaffs_vfs.c index 371ddd1..b1b6840 100644 --- a/yaffs_vfs.c +++ b/yaffs_vfs.c @@ -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) { diff --git a/yaffs_vfs_multi.c b/yaffs_vfs_multi.c index d6c25b5..3bd5aea 100644 --- a/yaffs_vfs_multi.c +++ b/yaffs_vfs_multi.c @@ -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 } -- 2.30.2