Hi.

This patch cleans up the format of if(X).

Thanks
Ken'ichi Ohmichi

diff -puN makedumpfile.org/makedumpfile.c makedumpfile/makedumpfile.c
--- makedumpfile.org/makedumpfile.c     2006-10-04 16:29:56.000000000 +0900
+++ makedumpfile/makedumpfile.c 2006-10-04 16:30:12.000000000 +0900
@@ -2052,14 +2052,12 @@ create_dump_bitmap(struct DumpInfo *info
        bm2.offset     = info->len_bitmap/2;
        bm2.buf        = NULL;
 
-       if (info->flag_exclude_free) {
-               bm3.fd         = info->fd_3rd_bitmap;
-               bm3.file_name  = info->name_3rd_bitmap;
-               bm3.cache_size = BUFSIZE_BITMAP;
-               bm3.buf_size   = 0;
-               bm3.offset     = 0;
-               bm3.buf        = NULL;
-       }
+       bm3.fd         = info->fd_3rd_bitmap;
+       bm3.file_name  = info->name_3rd_bitmap;
+       bm3.cache_size = BUFSIZE_BITMAP;
+       bm3.buf_size   = 0;
+       bm3.offset     = 0;
+       bm3.buf        = NULL;
 
        if ((bm1.buf = calloc(1, BUFSIZE_BITMAP)) == NULL) {
                ERRMSG("Can't allocate memory for 1st-bitmap buffer. %s\n",
@@ -2071,15 +2069,14 @@ create_dump_bitmap(struct DumpInfo *info
                    strerror(errno));
                goto out;
        }
-       if (info->flag_exclude_free) {
-               if ((bm3.buf = calloc(1, BUFSIZE_BITMAP)) == NULL) {
-                       ERRMSG("Can't allocate memory for 3rd-bitmap buffer. 
%s\n",
-                           strerror(errno));
-                       goto out;
-               }
+       if (info->flag_exclude_free
+           && (bm3.buf = calloc(1, BUFSIZE_BITMAP)) == NULL) {
+               ERRMSG("Can't allocate memory for 3rd-bitmap buffer. %s\n",
+                   strerror(errno));
+               goto out;
        }
-       if (info->dump_level > DL_EXCLUDE_ZERO &&
-           (page_cache = malloc(SIZE(page)*PGMM_CACHED)) == NULL) {
+       if ((info->dump_level > DL_EXCLUDE_ZERO)
+           && (page_cache = malloc(SIZE(page)*PGMM_CACHED)) == NULL) {
                ERRMSG("Can't allocate memory for the pagedesc cache. %s\n",
                    strerror(errno));
                goto out;
@@ -2239,7 +2236,7 @@ create_dump_bitmap(struct DumpInfo *info
        free(buf);
        free(bm1.buf);
        free(bm2.buf);
-       if (info->flag_exclude_free)
+       if (bm3.buf != NULL)
                free(bm3.buf);
        return TRUE;
 out:
@@ -3086,9 +3083,9 @@ main(int argc, char *argv[])
                        print_usage();
                        goto out;
                }
-               if (info->flag_compress || info->dump_level ||
-                       info->flag_elf_dumpfile || info->flag_read_config ||
-                       !info->flag_vmlinux) {
+               if (info->flag_compress || info->dump_level
+                   || info->flag_elf_dumpfile || info->flag_read_config
+                   || !info->flag_vmlinux) {
                        ERRMSG("Commandline parameter is invalid.\n");
                        print_usage();
                        goto out;
@@ -3105,8 +3102,8 @@ main(int argc, char *argv[])
                }
                if ((argc != optind + 2)
                    || ((info->flag_compress == 1)
-                       && (info->flag_elf_dumpfile == 1))
-                       || info->flag_vmlinux) {
+                   && (info->flag_elf_dumpfile == 1))
+                   || info->flag_vmlinux) {
                        ERRMSG("Commandline parameter is invalid.\n");
                        print_usage();
                        goto out;
_

_______________________________________________
fastboot mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/fastboot

Reply via email to