summaryrefslogtreecommitdiffstats
path: root/fs/fat/fat_write.c
diff options
context:
space:
mode:
authorRichard Genoud <richard.genoud@gmail.com>2012-12-13 03:30:10 +0000
committerTom Rini <trini@ti.com>2013-02-04 09:05:47 -0500
commitcb940c7ede85994847c80f4300f2f7eac6e94c48 (patch)
tree356a86c002501b057f37729eec41525d230ab7cb /fs/fat/fat_write.c
parentfb7e16cc1c1f5d5bb212118b89218b2e706226b2 (diff)
downloadtalos-obmc-uboot-cb940c7ede85994847c80f4300f2f7eac6e94c48.tar.gz
talos-obmc-uboot-cb940c7ede85994847c80f4300f2f7eac6e94c48.zip
FAT: remove ifdefs to make the code more readable
ifdefs in the code are making it harder to read. The use of simple if(vfat_enabled) makes no more code and is cleaner. (the code is discarded by the compiler instead of the preprocessor.) NB: if -O0 is used, the code won't be discarded and bonus, now the code compiles even if CONFIG_SUPPORT_VFAT is not defined. Signed-off-by: Richard Genoud <richard.genoud@gmail.com>
Diffstat (limited to 'fs/fat/fat_write.c')
-rw-r--r--fs/fat/fat_write.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/fs/fat/fat_write.c b/fs/fat/fat_write.c
index 819c33b1ab..b4022aa290 100644
--- a/fs/fat/fat_write.c
+++ b/fs/fat/fat_write.c
@@ -249,7 +249,6 @@ static __u32 get_fatent_value(fsdata *mydata, __u32 entry)
return ret;
}
-#ifdef CONFIG_SUPPORT_VFAT
/*
* Set the file name information from 'name' into 'slotptr',
*/
@@ -469,8 +468,6 @@ get_long_file_name(fsdata *mydata, int curclust, __u8 *cluster,
return 0;
}
-#endif
-
/*
* Set the entry at index 'entry' in a FAT (16/32) table.
*/
@@ -854,16 +851,14 @@ static dir_entry *find_directory_entry(fsdata *mydata, int startsect,
continue;
}
if ((dentptr->attr & ATTR_VOLUME)) {
-#ifdef CONFIG_SUPPORT_VFAT
- if ((dentptr->attr & ATTR_VFAT) &&
+ if (vfat_enabled &&
+ (dentptr->attr & ATTR_VFAT) &&
(dentptr->name[0] & LAST_LONG_ENTRY_MASK)) {
get_long_file_name(mydata, curclust,
get_dentfromdir_block,
&dentptr, l_name);
debug("vfatname: |%s|\n", l_name);
- } else
-#endif
- {
+ } else {
/* Volume label or VFAT entry */
dentptr++;
if (is_next_clust(mydata, dentptr))
OpenPOWER on IntegriCloud