Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tools: Avoid comma separated statements

Use semicolons and braces.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>

authored by

Joe Perches and committed by
Shuah Khan
aa803771 c8bd596f

+210 -128
+6 -4
tools/lib/subcmd/help.c
··· 65 65 ci = cj = ei = 0; 66 66 while (ci < cmds->cnt && ei < excludes->cnt) { 67 67 cmp = strcmp(cmds->names[ci]->name, excludes->names[ei]->name); 68 - if (cmp < 0) 68 + if (cmp < 0) { 69 69 cmds->names[cj++] = cmds->names[ci++]; 70 - else if (cmp == 0) 71 - ci++, ei++; 72 - else if (cmp > 0) 70 + } else if (cmp == 0) { 71 + ci++; 73 72 ei++; 73 + } else if (cmp > 0) { 74 + ei++; 75 + } 74 76 } 75 77 76 78 while (ci < cmds->cnt)
+9 -5
tools/power/cpupower/utils/cpufreq-set.c
··· 99 99 continue; 100 100 101 101 if (str[cp] == '.') { 102 - while (power > -1 && isdigit(str[cp+1])) 103 - cp++, power--; 102 + while (power > -1 && isdigit(str[cp+1])) { 103 + cp++; 104 + power--; 105 + } 104 106 } 105 - if (power >= -1) /* not enough => pad */ 107 + if (power >= -1) { /* not enough => pad */ 106 108 pad = power + 1; 107 - else /* to much => strip */ 108 - pad = 0, cp += power + 1; 109 + } else { /* too much => strip */ 110 + pad = 0; 111 + cp += power + 1; 112 + } 109 113 /* check bounds */ 110 114 if (cp <= 0 || cp + pad > NORM_FREQ_LEN - 1) 111 115 return 0;
+12 -6
tools/testing/selftests/vm/gup_benchmark.c
··· 105 105 gup.flags |= FOLL_WRITE; 106 106 107 107 fd = open("/sys/kernel/debug/gup_benchmark", O_RDWR); 108 - if (fd == -1) 109 - perror("open"), exit(1); 108 + if (fd == -1) { 109 + perror("open"); 110 + exit(1); 111 + } 110 112 111 113 p = mmap(NULL, size, PROT_READ | PROT_WRITE, flags, filed, 0); 112 - if (p == MAP_FAILED) 113 - perror("mmap"), exit(1); 114 + if (p == MAP_FAILED) { 115 + perror("mmap"); 116 + exit(1); 117 + } 114 118 gup.addr = (unsigned long)p; 115 119 116 120 if (thp == 1) ··· 127 123 128 124 for (i = 0; i < repeats; i++) { 129 125 gup.size = size; 130 - if (ioctl(fd, cmd, &gup)) 131 - perror("ioctl"), exit(1); 126 + if (ioctl(fd, cmd, &gup)) { 127 + perror("ioctl"); 128 + exit(1); 129 + } 132 130 133 131 printf("Time: get:%lld put:%lld us", gup.get_delta_usec, 134 132 gup.put_delta_usec);
+183 -113
tools/testing/selftests/vm/userfaultfd.c
··· 227 227 huge_fd, *alloc_area == area_src ? 0 : 228 228 nr_pages * page_size); 229 229 if (area_alias == MAP_FAILED) { 230 - if (munmap(*alloc_area, nr_pages * page_size) < 0) 231 - perror("hugetlb munmap"), exit(1); 230 + if (munmap(*alloc_area, nr_pages * page_size) < 0) { 231 + perror("hugetlb munmap"); 232 + exit(1); 233 + } 232 234 *alloc_area = NULL; 233 235 return; 234 236 } ··· 339 337 /* Undo write-protect, do wakeup after that */ 340 338 prms.mode = wp ? UFFDIO_WRITEPROTECT_MODE_WP : 0; 341 339 342 - if (ioctl(ufd, UFFDIO_WRITEPROTECT, &prms)) 343 - fprintf(stderr, "clear WP failed for address 0x%Lx\n", 344 - start), exit(1); 340 + if (ioctl(ufd, UFFDIO_WRITEPROTECT, &prms)) { 341 + fprintf(stderr, "clear WP failed for address 0x%Lx\n", start); 342 + exit(1); 343 + } 345 344 } 346 345 347 346 static void *locking_thread(void *arg) ··· 362 359 seed += cpu; 363 360 bzero(&rand, sizeof(rand)); 364 361 bzero(&randstate, sizeof(randstate)); 365 - if (initstate_r(seed, randstate, sizeof(randstate), &rand)) 366 - fprintf(stderr, "srandom_r error\n"), exit(1); 362 + if (initstate_r(seed, randstate, sizeof(randstate), &rand)) { 363 + fprintf(stderr, "srandom_r error\n"); 364 + exit(1); 365 + } 367 366 } else { 368 367 page_nr = -bounces; 369 368 if (!(bounces & BOUNCE_RACINGFAULTS)) ··· 374 369 375 370 while (!finished) { 376 371 if (bounces & BOUNCE_RANDOM) { 377 - if (random_r(&rand, &rand_nr)) 378 - fprintf(stderr, "random_r 1 error\n"), exit(1); 372 + if (random_r(&rand, &rand_nr)) { 373 + fprintf(stderr, "random_r 1 error\n"); 374 + exit(1); 375 + } 379 376 page_nr = rand_nr; 380 377 if (sizeof(page_nr) > sizeof(rand_nr)) { 381 - if (random_r(&rand, &rand_nr)) 382 - fprintf(stderr, "random_r 2 error\n"), exit(1); 378 + if (random_r(&rand, &rand_nr)) { 379 + fprintf(stderr, "random_r 2 error\n"); 380 + exit(1); 381 + } 383 382 page_nr |= (((unsigned long) rand_nr) << 16) << 384 383 16; 385 384 } ··· 394 385 start = time(NULL); 395 386 if (bounces & BOUNCE_VERIFY) { 396 387 count = *area_count(area_dst, page_nr); 397 - if (!count) 388 + if (!count) { 398 389 fprintf(stderr, 399 390 "page_nr %lu wrong count %Lu %Lu\n", 400 391 page_nr, count, 401 - count_verify[page_nr]), exit(1); 392 + count_verify[page_nr]); 393 + exit(1); 394 + } 402 395 403 396 404 397 /* ··· 412 401 */ 413 402 #if 1 414 403 if (!my_bcmp(area_dst + page_nr * page_size, zeropage, 415 - page_size)) 404 + page_size)) { 416 405 fprintf(stderr, 417 406 "my_bcmp page_nr %lu wrong count %Lu %Lu\n", 418 - page_nr, count, 419 - count_verify[page_nr]), exit(1); 407 + page_nr, count, count_verify[page_nr]); 408 + exit(1); 409 + } 420 410 #else 421 411 unsigned long loops; 422 412 ··· 449 437 fprintf(stderr, 450 438 "page_nr %lu memory corruption %Lu %Lu\n", 451 439 page_nr, count, 452 - count_verify[page_nr]), exit(1); 440 + count_verify[page_nr]); exit(1); 453 441 } 454 442 count++; 455 443 *area_count(area_dst, page_nr) = count_verify[page_nr] = count; ··· 473 461 offset); 474 462 if (ioctl(ufd, UFFDIO_COPY, uffdio_copy)) { 475 463 /* real retval in ufdio_copy.copy */ 476 - if (uffdio_copy->copy != -EEXIST) 464 + if (uffdio_copy->copy != -EEXIST) { 477 465 fprintf(stderr, "UFFDIO_COPY retry error %Ld\n", 478 - uffdio_copy->copy), exit(1); 466 + uffdio_copy->copy); 467 + exit(1); 468 + } 479 469 } else { 480 470 fprintf(stderr, "UFFDIO_COPY retry unexpected %Ld\n", 481 - uffdio_copy->copy), exit(1); 471 + uffdio_copy->copy); exit(1); 482 472 } 483 473 } 484 474 ··· 488 474 { 489 475 struct uffdio_copy uffdio_copy; 490 476 491 - if (offset >= nr_pages * page_size) 492 - fprintf(stderr, "unexpected offset %lu\n", 493 - offset), exit(1); 477 + if (offset >= nr_pages * page_size) { 478 + fprintf(stderr, "unexpected offset %lu\n", offset); 479 + exit(1); 480 + } 494 481 uffdio_copy.dst = (unsigned long) area_dst + offset; 495 482 uffdio_copy.src = (unsigned long) area_src + offset; 496 483 uffdio_copy.len = page_size; ··· 502 487 uffdio_copy.copy = 0; 503 488 if (ioctl(ufd, UFFDIO_COPY, &uffdio_copy)) { 504 489 /* real retval in ufdio_copy.copy */ 505 - if (uffdio_copy.copy != -EEXIST) 490 + if (uffdio_copy.copy != -EEXIST) { 506 491 fprintf(stderr, "UFFDIO_COPY error %Ld\n", 507 - uffdio_copy.copy), exit(1); 492 + uffdio_copy.copy); 493 + exit(1); 494 + } 508 495 } else if (uffdio_copy.copy != page_size) { 509 496 fprintf(stderr, "UFFDIO_COPY unexpected copy %Ld\n", 510 - uffdio_copy.copy), exit(1); 497 + uffdio_copy.copy); exit(1); 511 498 } else { 512 499 if (test_uffdio_copy_eexist && retry) { 513 500 test_uffdio_copy_eexist = false; ··· 538 521 if (ret < 0) { 539 522 if (errno == EAGAIN) 540 523 return 1; 541 - else 542 - perror("blocking read error"), exit(1); 524 + perror("blocking read error"); 543 525 } else { 544 - fprintf(stderr, "short read\n"), exit(1); 526 + fprintf(stderr, "short read\n"); 545 527 } 528 + exit(1); 546 529 } 547 530 548 531 return 0; ··· 553 536 { 554 537 unsigned long offset; 555 538 556 - if (msg->event != UFFD_EVENT_PAGEFAULT) 557 - fprintf(stderr, "unexpected msg event %u\n", 558 - msg->event), exit(1); 539 + if (msg->event != UFFD_EVENT_PAGEFAULT) { 540 + fprintf(stderr, "unexpected msg event %u\n", msg->event); 541 + exit(1); 542 + } 559 543 560 544 if (msg->arg.pagefault.flags & UFFD_PAGEFAULT_FLAG_WP) { 561 545 wp_range(uffd, msg->arg.pagefault.address, page_size, false); ··· 564 546 } else { 565 547 /* Missing page faults */ 566 548 if (bounces & BOUNCE_VERIFY && 567 - msg->arg.pagefault.flags & UFFD_PAGEFAULT_FLAG_WRITE) 568 - fprintf(stderr, "unexpected write fault\n"), exit(1); 549 + msg->arg.pagefault.flags & UFFD_PAGEFAULT_FLAG_WRITE) { 550 + fprintf(stderr, "unexpected write fault\n"); 551 + exit(1); 552 + } 569 553 570 554 offset = (char *)(unsigned long)msg->arg.pagefault.address - area_dst; 571 555 offset &= ~(page_size-1); ··· 594 574 595 575 for (;;) { 596 576 ret = poll(pollfd, 2, -1); 597 - if (!ret) 598 - fprintf(stderr, "poll error %d\n", ret), exit(1); 599 - if (ret < 0) 600 - perror("poll"), exit(1); 577 + if (!ret) { 578 + fprintf(stderr, "poll error %d\n", ret); 579 + exit(1); 580 + } 581 + if (ret < 0) { 582 + perror("poll"); 583 + exit(1); 584 + } 601 585 if (pollfd[1].revents & POLLIN) { 602 - if (read(pollfd[1].fd, &tmp_chr, 1) != 1) 603 - fprintf(stderr, "read pipefd error\n"), 604 - exit(1); 586 + if (read(pollfd[1].fd, &tmp_chr, 1) != 1) { 587 + fprintf(stderr, "read pipefd error\n"); 588 + exit(1); 589 + } 605 590 break; 606 591 } 607 - if (!(pollfd[0].revents & POLLIN)) 592 + if (!(pollfd[0].revents & POLLIN)) { 608 593 fprintf(stderr, "pollfd[0].revents %d\n", 609 - pollfd[0].revents), exit(1); 594 + pollfd[0].revents); 595 + exit(1); 596 + } 610 597 if (uffd_read_msg(uffd, &msg)) 611 598 continue; 612 599 switch (msg.event) { 613 600 default: 614 601 fprintf(stderr, "unexpected msg event %u\n", 615 - msg.event), exit(1); 602 + msg.event); exit(1); 616 603 break; 617 604 case UFFD_EVENT_PAGEFAULT: 618 605 uffd_handle_page_fault(&msg, stats); ··· 633 606 uffd_reg.range.start = msg.arg.remove.start; 634 607 uffd_reg.range.len = msg.arg.remove.end - 635 608 msg.arg.remove.start; 636 - if (ioctl(uffd, UFFDIO_UNREGISTER, &uffd_reg.range)) 637 - fprintf(stderr, "remove failure\n"), exit(1); 609 + if (ioctl(uffd, UFFDIO_UNREGISTER, &uffd_reg.range)) { 610 + fprintf(stderr, "remove failure\n"); 611 + exit(1); 612 + } 638 613 break; 639 614 case UFFD_EVENT_REMAP: 640 615 area_dst = (char *)(unsigned long)msg.arg.remap.to; ··· 908 879 909 880 area_dst = mremap(area_dst, nr_pages * page_size, nr_pages * page_size, 910 881 MREMAP_MAYMOVE | MREMAP_FIXED, area_src); 911 - if (area_dst == MAP_FAILED) 912 - perror("mremap"), exit(1); 882 + if (area_dst == MAP_FAILED) { 883 + perror("mremap"); 884 + exit(1); 885 + } 913 886 914 887 for (; nr < nr_pages; nr++) { 915 888 count = *area_count(area_dst, nr); ··· 919 888 fprintf(stderr, 920 889 "nr %lu memory corruption %Lu %Lu\n", 921 890 nr, count, 922 - count_verify[nr]), exit(1); 891 + count_verify[nr]); exit(1); 923 892 } 924 893 /* 925 894 * Trigger write protection if there is by writting ··· 932 901 return 1; 933 902 934 903 for (nr = 0; nr < nr_pages; nr++) { 935 - if (my_bcmp(area_dst + nr * page_size, zeropage, page_size)) 936 - fprintf(stderr, "nr %lu is not zero\n", nr), exit(1); 904 + if (my_bcmp(area_dst + nr * page_size, zeropage, page_size)) { 905 + fprintf(stderr, "nr %lu is not zero\n", nr); 906 + exit(1); 907 + } 937 908 } 938 909 939 910 return 0; ··· 949 916 uffdio_zeropage->range.len, 950 917 offset); 951 918 if (ioctl(ufd, UFFDIO_ZEROPAGE, uffdio_zeropage)) { 952 - if (uffdio_zeropage->zeropage != -EEXIST) 919 + if (uffdio_zeropage->zeropage != -EEXIST) { 953 920 fprintf(stderr, "UFFDIO_ZEROPAGE retry error %Ld\n", 954 - uffdio_zeropage->zeropage), exit(1); 921 + uffdio_zeropage->zeropage); 922 + exit(1); 923 + } 955 924 } else { 956 925 fprintf(stderr, "UFFDIO_ZEROPAGE retry unexpected %Ld\n", 957 - uffdio_zeropage->zeropage), exit(1); 926 + uffdio_zeropage->zeropage); exit(1); 958 927 } 959 928 } 960 929 ··· 968 933 969 934 has_zeropage = uffd_test_ops->expected_ioctls & (1 << _UFFDIO_ZEROPAGE); 970 935 971 - if (offset >= nr_pages * page_size) 972 - fprintf(stderr, "unexpected offset %lu\n", 973 - offset), exit(1); 936 + if (offset >= nr_pages * page_size) { 937 + fprintf(stderr, "unexpected offset %lu\n", offset); 938 + exit(1); 939 + } 974 940 uffdio_zeropage.range.start = (unsigned long) area_dst + offset; 975 941 uffdio_zeropage.range.len = page_size; 976 942 uffdio_zeropage.mode = 0; ··· 979 943 if (ret) { 980 944 /* real retval in ufdio_zeropage.zeropage */ 981 945 if (has_zeropage) { 982 - if (uffdio_zeropage.zeropage == -EEXIST) 983 - fprintf(stderr, "UFFDIO_ZEROPAGE -EEXIST\n"), 984 - exit(1); 985 - else 946 + if (uffdio_zeropage.zeropage == -EEXIST) { 947 + fprintf(stderr, "UFFDIO_ZEROPAGE -EEXIST\n"); 948 + exit(1); 949 + } else { 986 950 fprintf(stderr, "UFFDIO_ZEROPAGE error %Ld\n", 987 - uffdio_zeropage.zeropage), exit(1); 951 + uffdio_zeropage.zeropage); 952 + exit(1); 953 + } 988 954 } else { 989 - if (uffdio_zeropage.zeropage != -EINVAL) 955 + if (uffdio_zeropage.zeropage != -EINVAL) { 990 956 fprintf(stderr, 991 957 "UFFDIO_ZEROPAGE not -EINVAL %Ld\n", 992 - uffdio_zeropage.zeropage), exit(1); 958 + uffdio_zeropage.zeropage); 959 + exit(1); 960 + } 993 961 } 994 962 } else if (has_zeropage) { 995 963 if (uffdio_zeropage.zeropage != page_size) { 996 964 fprintf(stderr, "UFFDIO_ZEROPAGE unexpected %Ld\n", 997 - uffdio_zeropage.zeropage), exit(1); 965 + uffdio_zeropage.zeropage); exit(1); 998 966 } else { 999 967 if (test_uffdio_zeropage_eexist && retry) { 1000 968 test_uffdio_zeropage_eexist = false; ··· 1010 970 } else { 1011 971 fprintf(stderr, 1012 972 "UFFDIO_ZEROPAGE succeeded %Ld\n", 1013 - uffdio_zeropage.zeropage), exit(1); 973 + uffdio_zeropage.zeropage); exit(1); 1014 974 } 1015 975 1016 976 return 0; ··· 1040 1000 uffdio_register.mode = UFFDIO_REGISTER_MODE_MISSING; 1041 1001 if (test_uffdio_wp) 1042 1002 uffdio_register.mode |= UFFDIO_REGISTER_MODE_WP; 1043 - if (ioctl(uffd, UFFDIO_REGISTER, &uffdio_register)) 1044 - fprintf(stderr, "register failure\n"), exit(1); 1003 + if (ioctl(uffd, UFFDIO_REGISTER, &uffdio_register)) { 1004 + fprintf(stderr, "register failure\n"); 1005 + exit(1); 1006 + } 1045 1007 1046 1008 expected_ioctls = uffd_test_ops->expected_ioctls; 1047 1009 if ((uffdio_register.ioctls & expected_ioctls) != 1048 - expected_ioctls) 1010 + expected_ioctls) { 1049 1011 fprintf(stderr, 1050 - "unexpected missing ioctl for anon memory\n"), 1051 - exit(1); 1012 + "unexpected missing ioctl for anon memory\n"); 1013 + exit(1); 1014 + } 1052 1015 1053 1016 if (uffdio_zeropage(uffd, 0)) { 1054 - if (my_bcmp(area_dst, zeropage, page_size)) 1055 - fprintf(stderr, "zeropage is not zero\n"), exit(1); 1017 + if (my_bcmp(area_dst, zeropage, page_size)) { 1018 + fprintf(stderr, "zeropage is not zero\n"); 1019 + exit(1); 1020 + } 1056 1021 } 1057 1022 1058 1023 close(uffd); ··· 1092 1047 uffdio_register.mode = UFFDIO_REGISTER_MODE_MISSING; 1093 1048 if (test_uffdio_wp) 1094 1049 uffdio_register.mode |= UFFDIO_REGISTER_MODE_WP; 1095 - if (ioctl(uffd, UFFDIO_REGISTER, &uffdio_register)) 1096 - fprintf(stderr, "register failure\n"), exit(1); 1050 + if (ioctl(uffd, UFFDIO_REGISTER, &uffdio_register)) { 1051 + fprintf(stderr, "register failure\n"); 1052 + exit(1); 1053 + } 1097 1054 1098 1055 expected_ioctls = uffd_test_ops->expected_ioctls; 1099 - if ((uffdio_register.ioctls & expected_ioctls) != 1100 - expected_ioctls) 1101 - fprintf(stderr, 1102 - "unexpected missing ioctl for anon memory\n"), 1103 - exit(1); 1056 + if ((uffdio_register.ioctls & expected_ioctls) != expected_ioctls) { 1057 + fprintf(stderr, "unexpected missing ioctl for anon memory\n"); 1058 + exit(1); 1059 + } 1104 1060 1105 - if (pthread_create(&uffd_mon, &attr, uffd_poll_thread, &stats)) 1106 - perror("uffd_poll_thread create"), exit(1); 1061 + if (pthread_create(&uffd_mon, &attr, uffd_poll_thread, &stats)) { 1062 + perror("uffd_poll_thread create"); 1063 + exit(1); 1064 + } 1107 1065 1108 1066 pid = fork(); 1109 - if (pid < 0) 1110 - perror("fork"), exit(1); 1067 + if (pid < 0) { 1068 + perror("fork"); 1069 + exit(1); 1070 + } 1111 1071 1112 1072 if (!pid) 1113 1073 return faulting_process(0); 1114 1074 1115 1075 waitpid(pid, &err, 0); 1116 - if (err) 1117 - fprintf(stderr, "faulting process failed\n"), exit(1); 1076 + if (err) { 1077 + fprintf(stderr, "faulting process failed\n"); 1078 + exit(1); 1079 + } 1118 1080 1119 - if (write(pipefd[1], &c, sizeof(c)) != sizeof(c)) 1120 - perror("pipe write"), exit(1); 1081 + if (write(pipefd[1], &c, sizeof(c)) != sizeof(c)) { 1082 + perror("pipe write"); 1083 + exit(1); 1084 + } 1121 1085 if (pthread_join(uffd_mon, NULL)) 1122 1086 return 1; 1123 1087 ··· 1164 1110 uffdio_register.mode = UFFDIO_REGISTER_MODE_MISSING; 1165 1111 if (test_uffdio_wp) 1166 1112 uffdio_register.mode |= UFFDIO_REGISTER_MODE_WP; 1167 - if (ioctl(uffd, UFFDIO_REGISTER, &uffdio_register)) 1168 - fprintf(stderr, "register failure\n"), exit(1); 1113 + if (ioctl(uffd, UFFDIO_REGISTER, &uffdio_register)) { 1114 + fprintf(stderr, "register failure\n"); 1115 + exit(1); 1116 + } 1169 1117 1170 1118 expected_ioctls = uffd_test_ops->expected_ioctls; 1171 - if ((uffdio_register.ioctls & expected_ioctls) != 1172 - expected_ioctls) 1173 - fprintf(stderr, 1174 - "unexpected missing ioctl for anon memory\n"), 1175 - exit(1); 1119 + if ((uffdio_register.ioctls & expected_ioctls) != expected_ioctls) { 1120 + fprintf(stderr, "unexpected missing ioctl for anon memory\n"); 1121 + exit(1); 1122 + } 1176 1123 1177 - if (faulting_process(1)) 1178 - fprintf(stderr, "faulting process failed\n"), exit(1); 1124 + if (faulting_process(1)) { 1125 + fprintf(stderr, "faulting process failed\n"); 1126 + exit(1); 1127 + } 1179 1128 1180 1129 if (uffd_test_ops->release_pages(area_dst)) 1181 1130 return 1; 1182 1131 1183 - if (pthread_create(&uffd_mon, &attr, uffd_poll_thread, &stats)) 1184 - perror("uffd_poll_thread create"), exit(1); 1132 + if (pthread_create(&uffd_mon, &attr, uffd_poll_thread, &stats)) { 1133 + perror("uffd_poll_thread create"); 1134 + exit(1); 1135 + } 1185 1136 1186 1137 pid = fork(); 1187 - if (pid < 0) 1188 - perror("fork"), exit(1); 1138 + if (pid < 0) { 1139 + perror("fork"); 1140 + exit(1); 1141 + } 1189 1142 1190 1143 if (!pid) 1191 1144 exit(faulting_process(2)); 1192 1145 1193 1146 waitpid(pid, &err, 0); 1194 - if (err) 1195 - fprintf(stderr, "faulting process failed\n"), exit(1); 1147 + if (err) { 1148 + fprintf(stderr, "faulting process failed\n"); 1149 + exit(1); 1150 + } 1196 1151 1197 - if (write(pipefd[1], &c, sizeof(c)) != sizeof(c)) 1198 - perror("pipe write"), exit(1); 1152 + if (write(pipefd[1], &c, sizeof(c)) != sizeof(c)) { 1153 + perror("pipe write"); 1154 + exit(1); 1155 + } 1199 1156 if (pthread_join(uffd_mon, (void **)&userfaults)) 1200 1157 return 1; 1201 1158 ··· 1460 1395 test_type = TEST_SHMEM; 1461 1396 uffd_test_ops = &shmem_uffd_test_ops; 1462 1397 } else { 1463 - fprintf(stderr, "Unknown test type: %s\n", type), exit(1); 1398 + fprintf(stderr, "Unknown test type: %s\n", type); exit(1); 1464 1399 } 1465 1400 1466 1401 if (test_type == TEST_HUGETLB) ··· 1468 1403 else 1469 1404 page_size = sysconf(_SC_PAGE_SIZE); 1470 1405 1471 - if (!page_size) 1472 - fprintf(stderr, "Unable to determine page size\n"), 1473 - exit(2); 1406 + if (!page_size) { 1407 + fprintf(stderr, "Unable to determine page size\n"); 1408 + exit(2); 1409 + } 1474 1410 if ((unsigned long) area_count(NULL, 0) + sizeof(unsigned long long) * 2 1475 - > page_size) 1476 - fprintf(stderr, "Impossible to run this test\n"), exit(2); 1411 + > page_size) { 1412 + fprintf(stderr, "Impossible to run this test\n"); 1413 + exit(2); 1414 + } 1477 1415 } 1478 1416 1479 1417 static void sigalrm(int sig) ··· 1493 1425 if (argc < 4) 1494 1426 usage(); 1495 1427 1496 - if (signal(SIGALRM, sigalrm) == SIG_ERR) 1497 - fprintf(stderr, "failed to arm SIGALRM"), exit(1); 1428 + if (signal(SIGALRM, sigalrm) == SIG_ERR) { 1429 + fprintf(stderr, "failed to arm SIGALRM"); 1430 + exit(1); 1431 + } 1498 1432 alarm(ALARM_INTERVAL_SECS); 1499 1433 1500 1434 set_test_type(argv[1]);