Re: [PATCH] aic7xxx/aic79xx: remove VLAs

2018-03-08 Thread Stephen Kitt
On Thu, 8 Mar 2018 11:52:25 -0800, Kees Cook wrote: > On Thu, Mar 8, 2018 at 5:22 AM, Stephen Kitt wrote: > > -static const int num_critical_sections = sizeof(critical_sections) > > - / sizeof(*critical_sections); > > +#define NUM_CRITICAL_SECTIONS 14 > > T

Re: [PATCH] aic7xxx/aic79xx: remove VLAs

2018-03-08 Thread Kees Cook
On Thu, Mar 8, 2018 at 5:22 AM, Stephen Kitt wrote: > In preparation to enabling -Wvla, remove VLAs and replace them with > fixed-length arrays instead. > > The arrays fixed here, using the number of constant sections, aren't > really VLAs, but they appear so to the compiler. Since we know at > bu

[PATCH] aic7xxx/aic79xx: remove VLAs

2018-03-08 Thread Stephen Kitt
In preparation to enabling -Wvla, remove VLAs and replace them with fixed-length arrays instead. The arrays fixed here, using the number of constant sections, aren't really VLAs, but they appear so to the compiler. Since we know at build-time how many critical sections there are, we might as well