Changeset 4c9c46d in rtems


Ignore:
Timestamp:
Apr 13, 2015, 10:58:37 AM (4 years ago)
Author:
Daniel Hellstrom <daniel@…>
Branches:
4.11, master
Children:
291c5391
Parents:
bef5e23e
git-author:
Daniel Hellstrom <daniel@…> (04/13/15 10:58:37)
git-committer:
Daniel Hellstrom <daniel@…> (04/16/15 23:10:30)
Message:

DRVMGR: clean-up DRV_OPS_NUM

Location:
cpukit/libdrvmgr
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpukit/libdrvmgr/drvmgr.h

    rbef5e23e r4c9c46d  
    295295        int     (*info)(struct drvmgr_dev *, void (*print)(void *p, char *str), void *p, int, char *argv[]);/*! Function called to request information about a device or driver */
    296296};
    297 #define DRV_OPS_NUM (sizeof(struct drvmgr_drv_ops)/sizeof(void (*)(void)))
     297#define DRVMGR_OPS_NUM(x) (sizeof(x)/sizeof(void (*)(void)))
    298298
    299299/*! Device driver description */
  • cpukit/libdrvmgr/drvmgr_print.c

    rbef5e23e r4c9c46d  
    335335}
    336336
    337 char *drv_ops_names[DRV_OPS_NUM] = {
     337char *drv_ops_names[DRVMGR_OPS_NUM(struct drvmgr_drv_ops)] = {
    338338        "init[1]:",
    339339        "init[2]:",
     
    356356        printf("  BUS TYPE:    %d\n", drv->bus_type);
    357357        printf("  OPERATIONS:\n");
    358         for (i = 0, ppfunc = (fun_ptr *)&drv->ops->init[0]; i<DRV_OPS_NUM; i++)
     358        for (i = 0, ppfunc = (fun_ptr *)&drv->ops->init[0];
     359             i < DRVMGR_OPS_NUM(struct drvmgr_drv_ops); i++)
    359360                printf("   %s    %p\n", drv_ops_names[i], ppfunc[i]);
    360361        printf("  NO. DEVICES: %d\n", drv->dev_cnt);
Note: See TracChangeset for help on using the changeset viewer.