Skip to content

Commit c7937db

Browse files
committed
mm-add-merging-after-mremap-resize-checkpatch-fixes
WARNING: line length of 108 exceeds 100 columns torvalds#97: FILE: tools/testing/selftests/vm/mremap_test.c:136: + char *start = mmap(NULL, 3 * page_size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); WARNING: Missing a blank line after declarations torvalds#98: FILE: tools/testing/selftests/vm/mremap_test.c:137: + char *start = mmap(NULL, 3 * page_size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); + munmap(start + page_size, page_size); ERROR: space required before the open parenthesis '(' torvalds#107: FILE: tools/testing/selftests/vm/mremap_test.c:146: + while(getline(&line, &len, fp) != -1) { ERROR: space required after that ',' (ctx:VxV) torvalds#108: FILE: tools/testing/selftests/vm/mremap_test.c:147: + char *first = strtok(line,"- "); ^ ERROR: space required after that ',' (ctx:VxV) torvalds#110: FILE: tools/testing/selftests/vm/mremap_test.c:149: + char *second = strtok(NULL,"- "); ^ WARNING: Missing a blank line after declarations torvalds#112: FILE: tools/testing/selftests/vm/mremap_test.c:151: + void *second_val = (void *) strtol(second, NULL, 16); + if (first_val == start && second_val == start + 3 * page_size) { total: 3 errors, 3 warnings, 113 lines checked NOTE: For some of the reported defects, checkpatch may be able to mechanically convert to the typical style using --fix or --fix-inplace. ./patches/mm-add-merging-after-mremap-resize.patch has style problems, please review. NOTE: If any of the errors are false positives, please report them to the maintainer, see CHECKPATCH in MAINTAINERS. Please run checkpatch prior to sending patches Cc: Jakub Matěna <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent cdb260e commit c7937db

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

tools/testing/selftests/vm/mremap_test.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,9 @@ static void mremap_expand_merge(unsigned long page_size)
132132
char *line = NULL;
133133
size_t len = 0;
134134
bool success = false;
135+
char *start = mmap(NULL, 3 * page_size, PROT_READ | PROT_WRITE,
136+
MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
135137

136-
char *start = mmap(NULL, 3 * page_size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
137138
munmap(start + page_size, page_size);
138139
mremap(start, page_size, 2 * page_size, 0);
139140

@@ -143,11 +144,12 @@ static void mremap_expand_merge(unsigned long page_size)
143144
return;
144145
}
145146

146-
while(getline(&line, &len, fp) != -1) {
147-
char *first = strtok(line,"- ");
148-
void *first_val = (void *) strtol(first, NULL, 16);
149-
char *second = strtok(NULL,"- ");
147+
while (getline(&line, &len, fp) != -1) {
148+
char *first = strtok(line, "- ");
149+
void *first_val = (void *)strtol(first, NULL, 16);
150+
char *second = strtok(NULL, "- ");
150151
void *second_val = (void *) strtol(second, NULL, 16);
152+
151153
if (first_val == start && second_val == start + 3 * page_size) {
152154
success = true;
153155
break;

0 commit comments

Comments
 (0)