From: Mike Rapoport <rppt@linux.ibm.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: kbuild test robot <lkp@intel.com>,
kbuild-all@lists.01.org,
Linux Memory Management List <linux-mm@kvack.org>,
Randy Dunlap <rdunlap@infradead.org>
Subject: Re: [linux-next:master 10679/10701] arch/x86/mm/pgtable.c:427:2: warning: variable length array 'u_pmds' is used
Date: Thu, 21 May 2020 10:02:11 +0300 [thread overview]
Message-ID: <20200521070211.GO1059226@linux.ibm.com> (raw)
In-Reply-To: <20200520161101.46deeeaac1cff608573ccec3@linux-foundation.org>
On Wed, May 20, 2020 at 04:11:01PM -0700, Andrew Morton wrote:
> On Thu, 21 May 2020 03:56:53 +0800 kbuild test robot <lkp@intel.com> wrote:
>
> > tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> > head: fb57b1fabcb28f358901b2df90abd2b48abc1ca8
> > commit: 0e19fc1c40bd7516d5a30a459db4f49d48910847 [10679/10701] mm: consolidate pgd_index() and pgd_offset{_k}() definitions
> > config: i386-randconfig-a005-20200520 (attached as .config)
> > compiler: gcc-4.9 (Ubuntu 4.9.3-13ubuntu2) 4.9.3
> > reproduce:
> > git checkout 0e19fc1c40bd7516d5a30a459db4f49d48910847
> > # save the attached .config to linux build tree
> > make ARCH=i386
> >
> > If you fix the issue, kindly add following tag as appropriate
> > Reported-by: kbuild test robot <lkp@intel.com>
> >
> > All warnings (new ones prefixed by >>, old ones prefixed by <<):
> >
> > arch/x86/mm/pgtable.c: In function 'pgd_alloc':
> > >> arch/x86/mm/pgtable.c:427:2: warning: variable length array 'u_pmds' is used [-Wvla]
> > pmd_t *u_pmds[MAX_PREALLOCATED_USER_PMDS];
> > ^
> > >> arch/x86/mm/pgtable.c:428:2: warning: variable length array 'pmds' is used [-Wvla]
> > pmd_t *pmds[MAX_PREALLOCATED_PMDS];
> > ^
>
> Thanks. This works for me - perhaps Mike can come up with something smarter.
Not really :)
Thanks for the fix!
Acked-by: Mike Rapoport <rppt@linux.ibm.com>
> --- a/include/linux/pgtable.h~mm-consolidate-pgd_index-and-pgd_offset_k-definitions-fix
> +++ a/include/linux/pgtable.h
> @@ -62,11 +62,8 @@ static inline unsigned long pud_index(un
> #endif
>
> #ifndef pgd_index
> -static inline unsigned long pgd_index(unsigned long address)
> -{
> - return ((address >> PGDIR_SHIFT) & (PTRS_PER_PGD - 1));
> -}
> -#define pgd_index pgd_index
> +/* Must be a compile-time constant, so implement it as a macro */
> +#define pgd_index(a) (((a) >> PGDIR_SHIFT) & (PTRS_PER_PGD - 1))
> #endif
>
> #ifndef pte_offset_kernel
> _
>
--
Sincerely yours,
Mike.
prev parent reply other threads:[~2020-05-21 7:03 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-20 19:56 [linux-next:master 10679/10701] arch/x86/mm/pgtable.c:427:2: warning: variable length array 'u_pmds' is used kbuild test robot
2020-05-20 19:56 ` kbuild test robot
2020-05-20 20:58 ` Randy Dunlap
2020-05-20 20:58 ` Randy Dunlap
2020-05-20 23:11 ` Andrew Morton
2020-05-20 23:11 ` Andrew Morton
2020-05-20 23:50 ` Randy Dunlap
2020-05-20 23:50 ` Randy Dunlap
2020-05-21 7:02 ` Mike Rapoport [this message]
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=20200521070211.GO1059226@linux.ibm.com \
--to=rppt@linux.ibm.com \
--cc=akpm@linux-foundation.org \
--cc=kbuild-all@lists.01.org \
--cc=linux-mm@kvack.org \
--cc=lkp@intel.com \
--cc=rdunlap@infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.