Re: [PATCH 10/14] init: deps: IDs for annotated initcalls

From: Alexander Holler
Date: Tue Oct 20 2015 - 06:57:30 EST


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.


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/