[git commit master] mkfs_ext2: code shrink
Denys Vlasenko
vda.linux at googlemail.com
Sat Oct 17 21:47:36 UTC 2009
commit: http://git.busybox.net/busybox/commit/?id=69d9edc6f8387ed0ec4742a5de895b22b3910818
branch: http://git.busybox.net/busybox/commit/?id=refs/heads/master
function old new delta
mkfs_ext2_main 1933 1924 -9
Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
util-linux/mkfs_ext2.c | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/util-linux/mkfs_ext2.c b/util-linux/mkfs_ext2.c
index 83e8105..6b059d9 100644
--- a/util-linux/mkfs_ext2.c
+++ b/util-linux/mkfs_ext2.c
@@ -275,9 +275,7 @@ int mkfs_ext2_main(int argc UNUSED_PARAM, char **argv)
* don't check all the filesystems at the same time. We use a
* kludgy hack of using the UUID to derive a random jitter value.
*/
- for (i = 0, n = 0; i < sizeof(sb->s_uuid); i++)
- n += sb->s_uuid[i];
- sb->s_max_mnt_count += n % EXT2_DFL_MAX_MNT_COUNT;
+ sb->s_max_mnt_count += sb->s_uuid[ARRAY_SIZE(sb->s_uuid)-1] % EXT2_DFL_MAX_MNT_COUNT;
// open the device, get number of blocks
xmove_fd(xopen3(argv[0], O_WRONLY | O_CREAT, 0666), fd);
--
1.6.3.3
More information about the busybox-cvs
mailing list