Commit 862c93e96ec2f092f2a16a0f8b4a0a1ecaab6d13
Committed by
Tom Rini
1 parent
e803fa2c4b
Exists in
v2017.01-smarct4x
and in
37 other branches
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>
Showing 1 changed file with 10 additions and 11 deletions Side-by-side Diff
fs/yaffs2/yaffs_guts.c
... | ... | @@ -3203,19 +3203,18 @@ |
3203 | 3203 | } else { |
3204 | 3204 | yaffs_strncpy(name, oh_name + 1, buff_size - 1); |
3205 | 3205 | } |
3206 | - } else { | |
3207 | -#else | |
3208 | - { | |
3209 | -#endif | |
3210 | - yaffs_strncpy(name, oh_name, buff_size - 1); | |
3206 | + | |
3207 | + return; | |
3211 | 3208 | } |
3209 | +#endif | |
3210 | + | |
3211 | + yaffs_strncpy(name, oh_name, buff_size - 1); | |
3212 | 3212 | } |
3213 | 3213 | |
3214 | 3214 | static void yaffs_load_oh_from_name(struct yaffs_dev *dev, YCHAR *oh_name, |
3215 | 3215 | const YCHAR *name) |
3216 | 3216 | { |
3217 | 3217 | #ifdef CONFIG_YAFFS_AUTO_UNICODE |
3218 | - | |
3219 | 3218 | int is_ascii; |
3220 | 3219 | YCHAR *w; |
3221 | 3220 | |
3222 | 3221 | |
... | ... | @@ -3246,12 +3245,12 @@ |
3246 | 3245 | *oh_name = 0; |
3247 | 3246 | yaffs_strncpy(oh_name + 1, name, YAFFS_MAX_NAME_LENGTH - 2); |
3248 | 3247 | } |
3249 | - } else { | |
3250 | -#else | |
3251 | - { | |
3252 | -#endif | |
3253 | - yaffs_strncpy(oh_name, name, YAFFS_MAX_NAME_LENGTH - 1); | |
3248 | + | |
3249 | + return; | |
3254 | 3250 | } |
3251 | +#endif | |
3252 | + | |
3253 | + yaffs_strncpy(oh_name, name, YAFFS_MAX_NAME_LENGTH - 1); | |
3255 | 3254 | } |
3256 | 3255 | |
3257 | 3256 | /* UpdateObjectHeader updates the header on NAND for an object. |