[U-Boot] [PATCH 2/2] yaffs2: preprocessor cleanup
Jeroen Hofstee
jeroen at myspectrum.nl
Sat Jun 21 20:58:56 CEST 2014
Current code uses the preprocessor to and else case
to an statement without an if condition at all. Although
this works, change the optional code to return early, so
it is contained within the #ifdef.
Signed-off-by: Jeroen Hofstee <jeroen at myspectrum.nl>
---
fs/yaffs2/yaffs_guts.c | 21 ++++++++++-----------
1 file changed, 10 insertions(+), 11 deletions(-)
diff --git a/fs/yaffs2/yaffs_guts.c b/fs/yaffs2/yaffs_guts.c
index 1fa5910..32e6ff2 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.
--
1.8.3.2
More information about the U-Boot
mailing list