Netdev List
 help / color / mirror / Atom feed
From: David Laight <David.Laight@ACULAB.COM>
To: 'Daniel Micay' <danielmicay@gmail.com>,
	Arend van Spriel <arend.vanspriel@broadcom.com>
Cc: Andreas Christoforou <andreaschristofo@gmail.com>,
	Kees Cook <keescook@chromium.org>,
	Kernel Hardening <kernel-hardening@lists.openwall.com>,
	QCA ath9k Development <ath9k-devel@qca.qualcomm.com>,
	Kalle Valo <kvalo@codeaurora.org>,
	"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
	Netdev <netdev@vger.kernel.org>,
	kernel list <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH] drivers: net: wireless: ath: ath9: dfs: remove VLA usage
Date: Tue, 13 Mar 2018 12:32:17 +0000	[thread overview]
Message-ID: <423b529d48c54eba9f7ed51922814d46@AcuMS.aculab.com> (raw)
In-Reply-To: <CA+DvKQ+hbMoWJdOuQB5n+eVF4ePf=kVuRiMbdtTUZ8ars4Pz4A@mail.gmail.com>

From: Daniel Micay
> Sent: 10 March 2018 23:45
> 
> > Just wondering. Is this actually a VLA. FFT_NUM_SAMPLES was static const so
> > not really going to show a lot of variation. This array will always have the
> > same size on the stack.
> 
> The issue is that unlike in C++, a `static const` can't be used in a
> constant expression in C. It's unclear why C is defined that way but
> it's how it is and there isn't currently a GCC extension making more
> things into constant expressions like C++.

'static' and 'const' are both just qualifiers to a 'variable'
You can still take it's address.
The language allows you to cast away the 'const' and write to
the variable - the effect is probably 'implementation defined'.

It is probably required to be valid for 'static const' items
to be patchable.

	David


  reply	other threads:[~2018-03-13 12:32 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-09 12:30 [PATCH] drivers: net: wireless: ath: ath9: dfs: remove VLA usage Andreas Christoforou
2018-03-09 12:51 ` Himanshu Jha
2018-03-09 14:48   ` Kalle Valo
2018-03-10 23:06 ` Arend van Spriel
2018-03-10 23:12   ` Kees Cook
2018-03-10 23:26     ` Gustavo A. R. Silva
     [not found]     ` <CAGXu5jKDA=L5E6Cu_oRe-M=ouuhrccCZHyM+z6_UMAUqe9xnRQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-03-14  1:38       ` Miguel Ojeda
2018-03-10 23:44   ` Daniel Micay
2018-03-13 12:32     ` David Laight [this message]
2018-03-14  1:18       ` Daniel Micay
2018-03-14  1:22         ` Daniel Micay

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=423b529d48c54eba9f7ed51922814d46@AcuMS.aculab.com \
    --to=david.laight@aculab.com \
    --cc=andreaschristofo@gmail.com \
    --cc=arend.vanspriel@broadcom.com \
    --cc=ath9k-devel@qca.qualcomm.com \
    --cc=danielmicay@gmail.com \
    --cc=keescook@chromium.org \
    --cc=kernel-hardening@lists.openwall.com \
    --cc=kvalo@codeaurora.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=netdev@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