linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Kitt <steve@sk2.org>
To: Kees Cook <keescook@chromium.org>
Cc: hare <hare@suse.com>,
	linux-scsi@vger.kernel.org,
	Kernel Hardening <kernel-hardening@lists.openwall.com>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] aic7xxx/aic79xx: remove VLAs
Date: Thu, 8 Mar 2018 21:50:19 +0100	[thread overview]
Message-ID: <20180308215019.399ebdb4@heffalump.sk2.org> (raw)
In-Reply-To: <CAGXu5jK=JhBFHBGpbWF46DC3-QMruiB0qqz1z+njcK2h7jVU9w@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 674 bytes --]

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

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2018-03-08 20:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-08 13:22 [PATCH] aic7xxx/aic79xx: remove VLAs Stephen Kitt
2018-03-08 19:52 ` Kees Cook
2018-03-08 20:50   ` Stephen Kitt [this message]
2018-03-08 20:51   ` [PATCH v2] " Stephen Kitt
2018-03-08 21:04     ` Kees Cook
2018-03-15  4:35     ` Martin K. Petersen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180308215019.399ebdb4@heffalump.sk2.org \
    --to=steve@sk2.org \
    --cc=hare@suse.com \
    --cc=keescook@chromium.org \
    --cc=kernel-hardening@lists.openwall.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).