Messages in this thread | | | Subject | Re: [PATCH 10/14] init: deps: IDs for annotated initcalls | From | Alexander Holler <> | Date | Tue, 20 Oct 2015 12:57:17 +0200 |
| |
Am 20.10.2015 um 12:42 schrieb Alexander Holler:
>> Another idea to split this one file into multiple ones would be to >> reserve blocks of IDs. E.g. use 10000-20000 for networking stuff, >> 1000-1200 for I2C and so on. > > In detail it could look like > > driver_ids_base.h: > > enum { > drvid_i2c_base = 1000, > drvid_networking_base = 1200, > drvid_usb_base = 3000, > }; > > driver_ids_i2c.h: > > # include "driver_ids_base.h" > > enum { > drvid_i2c_start = drvid_i2c_base, > > /* drivers/i2c */ > drvid_i2c, > drvid_i2c_dev, > drvid_i2c_busses_start, > /* drivers/i2c/busses */ > drvid_i2c_gpio, > (...) > > drvid_i2c_end > };
Which, of course, should be enhanced with a compile time error if drvid_i2c_end >= drvid_networking_base.
| |