aboutsummaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorJeroen Hofstee2014-07-12 15:16:52 +0200
committerTom Rini2014-07-18 17:53:23 -0400
commit862c93e96ec2f092f2a16a0f8b4a0a1ecaab6d13 (patch)
tree52de26354e61fbbe5c49a5512f51a0d560ff937b /fs
parente803fa2c4b9313a9efc7b9f87a49839d542d9615 (diff)
yaffs2: preprocessor cleanup
Current code uses the preprocessor to change an else case to a statement without any if condition at all. Although this works, change the optional code to return early, so all optional code is contained within a single #ifdef. Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
Diffstat (limited to 'fs')
-rw-r--r--fs/yaffs2/yaffs_guts.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/fs/yaffs2/yaffs_guts.c b/fs/yaffs2/yaffs_guts.c
index 1fa59105c1c..32e6ff2a040 100644
--- a/fs/yaffs2/yaffs_guts.c
+++ b/fs/yaffs2/yaffs_guts.c
@@ -3203,19 +3203,18 @@ static void yaffs_load_name_from_oh(struct yaffs_dev *dev, YCHAR *name,
} else {
yaffs_strncpy(name, oh_name + 1, buff_size - 1);
}
- } else {
-#else
- {
-#endif
- yaffs_strncpy(name, oh_name, buff_size - 1);
+
+ return;
}
+#endif
+
+ yaffs_strncpy(name, oh_name, buff_size - 1);
}
static void yaffs_load_oh_from_name(struct yaffs_dev *dev, YCHAR *oh_name,
const YCHAR *name)
{
#ifdef CONFIG_YAFFS_AUTO_UNICODE
-
int is_ascii;
YCHAR *w;
@@ -3246,12 +3245,12 @@ static void yaffs_load_oh_from_name(struct yaffs_dev *dev, YCHAR *oh_name,
*oh_name = 0;
yaffs_strncpy(oh_name + 1, name, YAFFS_MAX_NAME_LENGTH - 2);
}
- } else {
-#else
- {
-#endif
- yaffs_strncpy(oh_name, name, YAFFS_MAX_NAME_LENGTH - 1);
+
+ return;
}
+#endif
+
+ yaffs_strncpy(oh_name, name, YAFFS_MAX_NAME_LENGTH - 1);
}
/* UpdateObjectHeader updates the header on NAND for an object.