netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stanislaw Gruszka <sgruszka@redhat.com>
To: Kees Cook <keescook@chromium.org>
Cc: Kalle Valo <kvalo@codeaurora.org>,
	"David S. Miller" <davem@davemloft.net>,
	linux-wireless <linux-wireless@vger.kernel.org>,
	Network Development <netdev@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH wireless-drivers] mt76x0: Remove VLA usage
Date: Thu, 9 Aug 2018 12:41:38 +0200	[thread overview]
Message-ID: <20180809104137.GA1955@redhat.com> (raw)
In-Reply-To: <CAGXu5jKqeAHDWdNg++QJko5AM4g160kEQ54jLAojpRq6FszqgA@mail.gmail.com>

On Wed, Aug 08, 2018 at 08:41:28AM -0700, Kees Cook wrote:
> >> I thought SPDX line is needed only if file has no license and eeprom.c
> >> file and other mt76x0 files have specified the license. Is SPDX still
> >> needed in that case ?
> 
> I thought all source files needed SPDX: https://lwn.net/Articles/739183/

Ok, goal is to have all kernel source files with SPDX header.

> >>> +#define MT_MAP_READS        DIV_ROUND_UP(MT_EFUSE_USAGE_MAP_SIZE, 16)
> >>>  static int
> >>>  mt76x0_efuse_physical_size_check(struct mt76x0_dev *dev)
> >>>  {
> >>> -    const int map_reads = DIV_ROUND_UP(MT_EFUSE_USAGE_MAP_SIZE, 16);
> >>> -    u8 data[map_reads * 16];
> >>
> >> Why this is variable length array? DIV_ROUND_UP can not be calculated
> >> at compile time? But if so, macro do not change the situation either.
> >
> > The commit log mentioned:
> >
> >   "Even with "const" variables, the compiler will generate warnings about
> >    VLA usage."
> >
> > So I guess the compiler (gcc?) is just not smart enough in this case?
> 
> Correct. This is technically a false positive, but with the goal of
> adding -Wvla to the build globally, we have to get rid of these as
> well. It's a little frustrating, I agree, but with all others fixed
> now, these stand out. :)

Then:
Acked-by: Stanislaw Gruszka <sgruszka@redhat.com>

  reply	other threads:[~2018-08-09 10:41 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-07 22:50 [PATCH wireless-drivers] mt76x0: Remove VLA usage Kees Cook
2018-08-08  4:53 ` Kalle Valo
2018-08-08  9:24 ` Stanislaw Gruszka
     [not found]   ` <20180808092450.GA25772-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2018-08-08  9:46     ` Kalle Valo
2018-08-08 15:41       ` Kees Cook
2018-08-09 10:41         ` Stanislaw Gruszka [this message]
2018-08-09 10:51           ` Kalle Valo
2018-08-09 15:09 ` Kalle Valo

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=20180809104137.GA1955@redhat.com \
    --to=sgruszka@redhat.com \
    --cc=davem@davemloft.net \
    --cc=keescook@chromium.org \
    --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;
as well as URLs for NNTP newsgroup(s).