aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorStephen Warren2012-10-17 01:44:58 -0500
committerTom Rini2012-10-25 14:07:45 -0500
commita1687b858e5670683199f6923b32aec0ea82ba19 (patch)
tree46eee4de48520fbd49a6d7e6b7a558e1671f64d4 /fs
parent461f86e69650ae3c449ecb3ead607ee35277d385 (diff)
downloadu-boot-a1687b858e5670683199f6923b32aec0ea82ba19.tar.gz
u-boot-a1687b858e5670683199f6923b32aec0ea82ba19.tar.xz
u-boot-a1687b858e5670683199f6923b32aec0ea82ba19.zip
FAT: initialize all fields in cur_part_info, simplify init
cur_part_info.{name,type} are strings. So, we don't need to memset() the entire thing, just put the NULL-termination in the first byte. Add missing initialization of the bootable and uuid fields. None of these fields are actually used by fat.c. However, since it stores the entire disk_partition_t, we should make sure that all fields are valid. Signed-off-by: Stephen Warren <swarren@nvidia.com> Reviewed-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/fat/fat.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/fat/fat.c b/fs/fat/fat.c
index 731d3690c3..31042e5357 100644
--- a/fs/fat/fat.c
+++ b/fs/fat/fat.c
@@ -92,8 +92,12 @@ int fat_register_device(block_dev_desc_t * dev_desc, int part_no)
92 cur_part_info.start = 0; 92 cur_part_info.start = 0;
93 cur_part_info.size = dev_desc->lba; 93 cur_part_info.size = dev_desc->lba;
94 cur_part_info.blksz = dev_desc->blksz; 94 cur_part_info.blksz = dev_desc->blksz;
95 memset(cur_part_info.name, 0, sizeof(cur_part_info.name)); 95 cur_part_info.name[0] = 0;
96 memset(cur_part_info.type, 0, sizeof(cur_part_info.type)); 96 cur_part_info.type[0] = 0;
97 cur_part_info.bootable = 0;
98#ifdef CONFIG_PARTITION_UUIDS
99 cur_part_info.uuid[0] = 0;
100#endif
97 } 101 }
98 102
99 /* Make sure it has a valid FAT header */ 103 /* Make sure it has a valid FAT header */