From: will.deacon@arm.com (Will Deacon)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] locking/qspinlock: Fix build for anonymous union in older gcc compilers
Date: Fri, 22 Jun 2018 08:49:20 +0100 [thread overview]
Message-ID: <20180622074920.GA7601@arm.com> (raw)
In-Reply-To: <20180621203526.172ab5c4@vmware.local.home>
Hi Steve,
On Thu, Jun 21, 2018 at 08:35:26PM -0400, Steven Rostedt wrote:
> From: Steven Rostedt (VMware) <rostedt@goodmis.org>
>
> One of my tests compiles the kernel with gcc 4.5.3, and I hit the
> following build error:
>
> /work/git/linux-trace.git/include/linux/semaphore.h: In function 'sema_init':
> /work/git/linux-trace.git/include/linux/semaphore.h:35:17: error: unknown field 'val' specified in initializer
> /work/git/linux-trace.git/include/linux/semaphore.h:35:17: warning: missing braces around initializer
> /work/git/linux-trace.git/include/linux/semaphore.h:35:17: warning: (near initialization for '(anonymous).raw_lock.<anonymous>.val')
> In file included from /work/git/linux-trace.git/include/linux/sched/user.h:7:0,
> from /work/git/linux-trace.git/include/linux/cred.h:22,
> from /work/git/linux-trace.git/include/linux/seq_file.h:12,
> from /work/git/linux-trace.git/include/linux/cgroup.h:18,
> from /work/git/linux-trace.git/include/linux/memcontrol.h:22,
> from /work/git/linux-trace.git/include/linux/swap.h:9,
> from /work/git/linux-trace.git/include/linux/suspend.h:5,
> from /work/git/linux-trace.git/arch/x86/kernel/asm-offsets.c:13:
>
>
> I bisected it down to the introduction of the commit that makes
> qspinlock have an anonymous union, which makes initializing it special
> for older compilers. By adding strategic brackets, it makes the build
> happy again.
>
> Fixes: 625e88be1f41 ("locking/qspinlock: Merge 'struct __qspinlock' into 'struct qspinlock'")
> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
> ---
Cheers for spotting this and fixing it up! I know it's already in -tip, but
anyway:
Acked-by: Will Deacon <will.deacon@arm.com>
Will
WARNING: multiple messages have this Message-ID (diff)
From: Will Deacon <will.deacon@arm.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
Linus Torvalds <torvalds@linux-foundation.org>,
"Peter Zijlstra (Intel)" <peterz@infradead.org>,
Waiman Long <longman@redhat.com>,
Boqun Feng <boqun.feng@gmail.com>, Ingo Molnar <mingo@kernel.org>,
linux-arm-kernel@lists.infradead.org,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] locking/qspinlock: Fix build for anonymous union in older gcc compilers
Date: Fri, 22 Jun 2018 08:49:20 +0100 [thread overview]
Message-ID: <20180622074920.GA7601@arm.com> (raw)
In-Reply-To: <20180621203526.172ab5c4@vmware.local.home>
Hi Steve,
On Thu, Jun 21, 2018 at 08:35:26PM -0400, Steven Rostedt wrote:
> From: Steven Rostedt (VMware) <rostedt@goodmis.org>
>
> One of my tests compiles the kernel with gcc 4.5.3, and I hit the
> following build error:
>
> /work/git/linux-trace.git/include/linux/semaphore.h: In function 'sema_init':
> /work/git/linux-trace.git/include/linux/semaphore.h:35:17: error: unknown field 'val' specified in initializer
> /work/git/linux-trace.git/include/linux/semaphore.h:35:17: warning: missing braces around initializer
> /work/git/linux-trace.git/include/linux/semaphore.h:35:17: warning: (near initialization for '(anonymous).raw_lock.<anonymous>.val')
> In file included from /work/git/linux-trace.git/include/linux/sched/user.h:7:0,
> from /work/git/linux-trace.git/include/linux/cred.h:22,
> from /work/git/linux-trace.git/include/linux/seq_file.h:12,
> from /work/git/linux-trace.git/include/linux/cgroup.h:18,
> from /work/git/linux-trace.git/include/linux/memcontrol.h:22,
> from /work/git/linux-trace.git/include/linux/swap.h:9,
> from /work/git/linux-trace.git/include/linux/suspend.h:5,
> from /work/git/linux-trace.git/arch/x86/kernel/asm-offsets.c:13:
>
>
> I bisected it down to the introduction of the commit that makes
> qspinlock have an anonymous union, which makes initializing it special
> for older compilers. By adding strategic brackets, it makes the build
> happy again.
>
> Fixes: 625e88be1f41 ("locking/qspinlock: Merge 'struct __qspinlock' into 'struct qspinlock'")
> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
> ---
Cheers for spotting this and fixing it up! I know it's already in -tip, but
anyway:
Acked-by: Will Deacon <will.deacon@arm.com>
Will
next prev parent reply other threads:[~2018-06-22 7:49 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-22 0:35 [PATCH] locking/qspinlock: Fix build for anonymous union in older gcc compilers Steven Rostedt
2018-06-22 0:35 ` Steven Rostedt
2018-06-22 2:05 ` Waiman Long
2018-06-22 2:05 ` Waiman Long
2018-06-22 2:24 ` [tip:locking/urgent] locking/qspinlock: Fix build for anonymous union in older GCC compilers tip-bot for Steven Rostedt (VMware)
2018-06-22 7:49 ` Will Deacon [this message]
2018-06-22 7:49 ` [PATCH] locking/qspinlock: Fix build for anonymous union in older gcc compilers Will Deacon
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=20180622074920.GA7601@arm.com \
--to=will.deacon@arm.com \
--cc=linux-arm-kernel@lists.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.