Introduce the markers_cnt variable for readability. No functional change intended.
Showing the changes to scripts (1 of 1 file). Show all
Unified · Split
| @@ -393,7 +393,7 @@ static void write_src(void) · 392 unmodified lines | ||
| 393 | 393 | { |
| 394 | 394 | unsigned int i, k, off; |
| 395 | 395 | unsigned int best_idx[256]; |
| 396 | − unsigned int *markers; | |
| 396 | + unsigned int *markers, markers_cnt; | |
| 397 | 397 | char buf[KSYM_NAME_LEN]; |
| 398 | 398 | |
| 399 | 399 | printf("#include <asm/bitsperlong.h>\n"); |
| @@ -413,7 +413,8 @@ static void write_src(void) · 13 unmodified lines | ||
| 413 | 413 | |
| 414 | 414 | /* table of offset markers, that give the offset in the compressed stream |
| 415 | 415 | * every 256 symbols */ |
| 416 | − markers = malloc(sizeof(unsigned int) * ((table_cnt + 255) / 256)); | |
| 416 | + markers_cnt = (table_cnt + 255) / 256; | |
| 417 | + markers = malloc(sizeof(*markers) * markers_cnt); | |
| 417 | 418 | if (!markers) { |
| 418 | 419 | fprintf(stderr, "kallsyms failure: " |
| 419 | 420 | "unable to allocate required memory\n"); |
| @@ -469,7 +470,7 @@ static void write_src(void) · 49 unmodified lines | ||
| 469 | 470 | } |
| 470 | 471 | |
| 471 | 472 | output_label("kallsyms_markers"); |
| 472 | − for (i = 0; i < ((table_cnt + 255) >> 8); i++) | |
| 473 | + for (i = 0; i < markers_cnt; i++) | |
| 473 | 474 | printf("\t.long\t%u\n", markers[i]); |
| 474 | 475 | printf("\n"); |
| 475 | 476 | |