Patch: Rework of Device Driver Configuration

Joel Sherrill Joel.Sherrill at
Tue Sep 10 11:26:39 UTC 2013

I didn't want to do this much work but the device driver array and as declared as [] with no size. The maximum drivers was calculated as thr number of elements in the array. This left only the empty null slot at the end for dynamic drivers. If you had more than one dynamic driver, the array declaration was broken and overwrote adjacent memory.

Most of this patch makes it explicitly sized.

It does not break all applications. It only impacts the few using dynamic drivers or application extra drivers. They will get a compile error indicating what to do.

FWIW I suspect some of the tests with dynamic drivers were writing past the end of the driver array.

It presents dynamic driver slot configuration in a more logical manner and fixes a serious bug.

It is larger than I wanted but necessary and an improvement both logically and from a bug perspective. That's why I have been sitting on this and tweaking it so long.


Sebastian Huber <sebastian.huber at> wrote:

On 2013-09-09 21:30, Joel Sherrill wrote:
> +/**
> + * The CONFIGURE_MAXIMUM_DRIVERS parameter is obsolete.
> + * to specify the number of dynamically installed drivers.
> + */
> +#endif

I wouldn't break all existing configurations this way.  I think its only an
error if the application defines CONFIGURE_MAXIMUM_DRIVERS and
CONFIGURE_MAXIMUM_DYNAMIC_DRIVERS at once.  It is also an error if

Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax     : +49 89 189 47 41-09
E-Mail  : sebastian.huber at
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.

More information about the devel mailing list