Changeset 492 for trunk/kernel/mm/kcm.c


Ignore:
Timestamp:
Aug 22, 2018, 11:55:48 PM (6 years ago)
Author:
viala@…
Message:

Refactoring assert calling to conform with new assert macro.

Made with this command for the general case.
find ./kernel/ hal/ -name "*.c" | xargs sed -i -e '/assert(/ s/,[ ]*FUNCTION[ ]*,/,/'

And some done by hand.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/mm/kcm.c

    r464 r492  
    5656#endif
    5757
    58         assert( kcm_page->active , __FUNCTION__ , "kcm_page should be active" );
     58        assert( kcm_page->active , "kcm_page should be active" );
    5959
    6060        // get first block available
    6161        int32_t index = bitmap_ffs( kcm_page->bitmap , kcm->blocks_nr );
    6262
    63         assert( (index != -1) , __FUNCTION__ , "kcm_page should not be full" );
     63        assert( (index != -1) , "kcm_page should not be full" );
    6464
    6565        // allocate block
     
    113113        index = ((uint8_t *)ptr - (uint8_t *)kcm_page - CONFIG_KCM_SLOT_SIZE) / kcm->block_size;
    114114
    115         assert( !bitmap_state( kcm_page->bitmap , index ) , __FUNCTION__ , "page already freed" );
    116         assert( (kcm_page->count > 0) , __FUNCTION__ , "count already zero" );
     115        assert( !bitmap_state( kcm_page->bitmap , index ) , "page already freed" );
     116        assert( (kcm_page->count > 0) , "count already zero" );
    117117
    118118        bitmap_set( kcm_page->bitmap , index );
     
    216216        // the kcm_page descriptor mut fit in the KCM slot
    217217        assert( (sizeof(kcm_page_t) <= CONFIG_KCM_SLOT_SIZE) ,
    218                  __FUNCTION__ , "KCM slot too small\n" );
     218                "KCM slot too small\n" );
    219219
    220220        // initialize lock
     
    329329        kcm_t      * kcm;
    330330
    331         assert( (ptr != NULL) , __FUNCTION__ , "pointer cannot be NULL" );
     331        assert( (ptr != NULL) , "pointer cannot be NULL" );
    332332
    333333        kcm_page = (kcm_page_t *)((intptr_t)ptr & ~CONFIG_PPM_PAGE_MASK);
Note: See TracChangeset for help on using the changeset viewer.