lkml.org 
[lkml]   [2018]   [Mar]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] aic7xxx/aic79xx: remove VLAs
On Thu, 8 Mar 2018 11:52:25 -0800, Kees Cook <keescook@chromium.org> wrote:
> On Thu, Mar 8, 2018 at 5:22 AM, Stephen Kitt <steve@sk2.org> wrote:
> > -static const int num_critical_sections = sizeof(critical_sections)
> > - / sizeof(*critical_sections);
> > +#define NUM_CRITICAL_SECTIONS 14
>
> The compiler doesn't treat "const" as a literal, hence the need to
> change this. However, you can still use the sizeof (actually, this is
> exactly ARRAY_SIZE()). Perhaps:
>
> #define NUM_CRITICAL_SECTIONS ARRAY_SIZE(critical_sections)
>
> ?
>
> Otherwise, looks great!

Thanks, v2 incoming...

Regards,

Stephen
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2018-03-08 22:27    [W:0.037 / U:0.372 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site