Ignore:
Timestamp:
Aug 22, 2018, 11:55:48 PM (4 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/fs/fatfs.c

    r484 r492  
    259259    uint32_t   next_cluster_id;        // content of current FAT slot
    260260
    261     assert( (searched_page_index > 0) , __FUNCTION__ ,
     261    assert( (searched_page_index > 0) ,
    262262    "no FAT access required for first page\n");
    263263
     
    352352#endif
    353353
    354     assert( (fatfs_ctx != NULL) , __FUNCTION__ ,
     354    assert( (fatfs_ctx != NULL) ,
    355355    "cannot allocate memory for FATFS context\n" );
    356356
     
    360360        buffer      = (uint8_t *)kmem_alloc( &req );
    361361
    362     assert( (buffer != NULL) , __FUNCTION__ ,
     362    assert( (buffer != NULL) ,
    363363    "cannot allocate memory for 512 bytes buffer\n" );
    364364     
     
    367367    error = dev_ioc_sync_read( buffer , 0 , 1 );
    368368
    369     assert( (error == 0) , __FUNCTION__ ,
     369    assert( (error == 0) ,
    370370    "cannot access boot record\n" );
    371371
     
    393393    uint32_t sector_size = fatfs_get_record( BPB_BYTSPERSEC , buffer , 1 );
    394394
    395     assert( (sector_size == 512) , __FUNCTION__ ,
     395    assert( (sector_size == 512) ,
    396396            "sector size must be 512 bytes\n" );
    397397
     
    399399    uint32_t nb_sectors = fatfs_get_record( BPB_SECPERCLUS , buffer , 1 );
    400400
    401     assert( (nb_sectors == 8) , __FUNCTION__ ,
     401    assert( (nb_sectors == 8) ,
    402402    "cluster size must be 8 sectors\n" );
    403403
     
    405405    uint32_t nb_fats = fatfs_get_record( BPB_NUMFATS , buffer , 1 );
    406406
    407     assert( (nb_fats == 1) , __FUNCTION__ ,
     407    assert( (nb_fats == 1) ,
    408408    "number of FAT copies must be 1\n" );
    409409
     
    411411    uint32_t fat_sectors = fatfs_get_record( BPB_FAT32_FATSZ32 , buffer , 1 );
    412412
    413     assert( ((fat_sectors & 0xF) == 0) , __FUNCTION__ ,
     413    assert( ((fat_sectors & 0xF) == 0) ,
    414414    "FAT not multiple of 16 sectors\n");
    415415
     
    417417    uint32_t root_cluster = fatfs_get_record( BPB_FAT32_ROOTCLUS , buffer , 1 );
    418418
    419     assert( (root_cluster == 2) , __FUNCTION__ ,
     419    assert( (root_cluster == 2) ,
    420420    "root cluster index must be  2\n");
    421421
     
    431431    mapper_t * fat_mapper = mapper_create( FS_TYPE_FATFS );
    432432
    433     assert( (fat_mapper != NULL) , __FUNCTION__ ,
     433    assert( (fat_mapper != NULL) ,
    434434    "no memory for FAT mapper" );
    435435
     
    632632    mapper_t * mapper = parent_inode->mapper;
    633633
    634     assert( (mapper != NULL) , __FUNCTION__ , "parent mapper undefined\n");
     634    assert( (mapper != NULL) , "parent mapper undefined\n");
    635635   
    636636    char       cname[CONFIG_VFS_MAX_NAME_LENGTH];  // name extracter from each directory entry
     
    659659        page = mapper_get_page( mapper , index );
    660660
    661         assert( (page != NULL) , __FUNCTION__ , "bad parent mapper\n");
     661        assert( (page != NULL) , "bad parent mapper\n");
    662662
    663663        // get page base
Note: See TracChangeset for help on using the changeset viewer.