From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.0 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 32E14C43387 for ; Thu, 20 Dec 2018 09:35:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 01FDE20449 for ; Thu, 20 Dec 2018 09:35:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1545298545; bh=4z9XnexHVwH//G3mFSFaUIUMxLUwhHQ1vBv6cH1TB+4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=p6dk+aUOfLausO8aCMP3djgXK4B0FNBnFXt1WVRGgqhQeQnfSbC76E2alpsOR/WXh nDVYvtHex2pY7dJdccsyTfroNvP4Ez/w6P12b9IN9PeTmial93WvhsUZbUhR1O5b6q 3eLajC5WSueKK69GCRaTqpUI5ekR5BQrOV1juLcM= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733075AbeLTJfn (ORCPT ); Thu, 20 Dec 2018 04:35:43 -0500 Received: from mail.kernel.org ([198.145.29.99]:45740 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732466AbeLTJ2W (ORCPT ); Thu, 20 Dec 2018 04:28:22 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6F60620656; Thu, 20 Dec 2018 09:28:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1545298101; bh=4z9XnexHVwH//G3mFSFaUIUMxLUwhHQ1vBv6cH1TB+4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xYrtv44JKXrlVHQjTILMeQoZhHXGB2akUhZcHJ7QZ1Ik4QLqAeQv7xB06Iui8bbiM GLwEWgcRbjCCUmP2kbBKtDujeKvf7+Lfp4X1uRK/hSSgFhfqEmb+u6ewWQHvI0sfU0 CRczIRFQ3p4kjy0L0YkodkuUZZYi6VueJsySuzkI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Steven Rostedt (VMware)" , Waiman Long , Andrew Morton , Boqun Feng , Linus Torvalds , "Peter Zijlstra (Intel)" , Thomas Gleixner , Will Deacon , linux-arm-kernel@lists.infradead.org, Ingo Molnar , Sasha Levin Subject: [PATCH 4.14 35/72] locking/qspinlock: Fix build for anonymous union in older GCC compilers Date: Thu, 20 Dec 2018 10:18:34 +0100 Message-Id: <20181220085923.723845209@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20181220085922.332225035@linuxfoundation.org> References: <20181220085922.332225035@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit 6cc65be4f6f2a7186af8f3e09900787c7912dad2 ] One of my tests compiles the kernel with gcc 4.5.3, and I hit the following build error: include/linux/semaphore.h: In function 'sema_init': include/linux/semaphore.h:35:17: error: unknown field 'val' specified in initializer include/linux/semaphore.h:35:17: warning: missing braces around initializer include/linux/semaphore.h:35:17: warning: (near initialization for '(anonymous).raw_lock..val') I bisected it down to: 625e88be1f41 ("locking/qspinlock: Merge 'struct __qspinlock' into 'struct qspinlock'") ... which makes qspinlock have an anonymous union, which makes initializing it special for older compilers. By adding strategic brackets, it makes the build happy again. Signed-off-by: Steven Rostedt (VMware) Acked-by: Waiman Long Cc: Andrew Morton Cc: Boqun Feng Cc: Linus Torvalds Cc: Peter Zijlstra (Intel) Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Will Deacon Cc: linux-arm-kernel@lists.infradead.org Fixes: 625e88be1f41 ("locking/qspinlock: Merge 'struct __qspinlock' into 'struct qspinlock'") Link: http://lkml.kernel.org/r/20180621203526.172ab5c4@vmware.local.home Signed-off-by: Ingo Molnar Signed-off-by: Sasha Levin --- include/asm-generic/qspinlock_types.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/asm-generic/qspinlock_types.h b/include/asm-generic/qspinlock_types.h index 0763f065b975..d10f1e7d6ba8 100644 --- a/include/asm-generic/qspinlock_types.h +++ b/include/asm-generic/qspinlock_types.h @@ -63,7 +63,7 @@ typedef struct qspinlock { /* * Initializier */ -#define __ARCH_SPIN_LOCK_UNLOCKED { .val = ATOMIC_INIT(0) } +#define __ARCH_SPIN_LOCK_UNLOCKED { { .val = ATOMIC_INIT(0) } } /* * Bitfields in the atomic value: -- 2.19.1