Changeset 2b8b0ca in mainline for kernel/generic/src/mm/buddy.c


Ignore:
Timestamp:
2008-06-03T14:46:49Z (16 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
93a3348
Parents:
0f269c2
Message:

proper printf formatting

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/mm/buddy.c

    r0f269c2 r2b8b0ca  
    4545#include <debug.h>
    4646#include <print.h>
     47#include <macros.h>
    4748
    4849/** Return size needed for the buddy configuration data */
     
    290291        index_t i;
    291292        count_t cnt, elem_count = 0, block_count = 0;
    292         link_t * cur;
     293        link_t *cur;
    293294       
    294295
     
    296297        printf("-----\t------\t--------\t----------\t---------------\n");
    297298       
    298         for (i=0;i <= b->max_order; i++) {
     299        for (i = 0;i <= b->max_order; i++) {
    299300                cnt = 0;
    300301                if (!list_empty(&b->order[i])) {
     
    303304                }
    304305       
    305                 printf("#%zd\t%5zd\t%7zdK\t%8zdK\t%6zd\t", i, cnt, (cnt * (1 << i) * elem_size) >> 10, ((1 << i) * elem_size) >> 10, 1 << i);
     306                printf("#%" PRIi "\t%5" PRIc "\t%7" PRIc "K\t%8" PRIi "K\t%6u\t",
     307                        i, cnt, SIZE2KB(cnt * (1 << i) * elem_size), SIZE2KB((1 << i) * elem_size), 1 << i);
    306308                if (!list_empty(&b->order[i])) {
    307309                        for (cur = b->order[i].next; cur != &b->order[i]; cur = cur->next) {
     
    316318        }
    317319        printf("-----\t------\t--------\t----------\t---------------\n");
    318         printf("Buddy system contains %zd free elements (%zd blocks)\n" , elem_count, block_count);
    319 
     320        printf("Buddy system contains %" PRIc " free elements (%" PRIc " blocks)\n" , elem_count, block_count);
    320321}
    321322
Note: See TracChangeset for help on using the changeset viewer.