Re: [PATCH] aic7xxx/aic79xx: remove VLAs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 8 Mar 2018 11:52:25 -0800, Kees Cook <keescook@xxxxxxxxxxxx> wrote:
> On Thu, Mar 8, 2018 at 5:22 AM, Stephen Kitt <steve@xxxxxxx> 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

Attachment: pgp6rZWndw1x9.pgp
Description: OpenPGP digital signature


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux