Received: by 10.213.65.68 with SMTP id h4csp1742550imn; Sun, 1 Apr 2018 13:45:42 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+MYtGcBO7C85RvN9YLi0zWyUEeRI/v9xIkeM9HUqPYJKc5VCJtXnUkCP4B0MpTq3qX+jmp X-Received: by 10.99.101.193 with SMTP id z184mr4737751pgb.429.1522615542829; Sun, 01 Apr 2018 13:45:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522615542; cv=none; d=google.com; s=arc-20160816; b=t8Xdc8OcLDsaaHt0/h1nBX+Xn4G6ghNXr3eos3NUasIZx/yAq/cv5g86IMaGWT8j9T 19ovB0u/9G63kb1d3wKPyHBpGaODETsnt7zWwH+RBxA32gxMDEj9JDot+UWV63g8TR90 tnCyy06air4bx8EV3VZFS2LzyYS9F7dzIc4Q8ytsc4qEMBr3cbMcRk4h3KsAWzh39T6C mciTluNphrhs3fWnrzvlctzow3surk3e+D+8BPbzQ7TkGRGM9t9LAIQn9+ySYm2LrjLi UP9v21A9dzPF5PFuJEENHXSMov3syfhhg2MdtjZxgRMuOavzFtDjPvxN7mpeM1iMQEWS p0sQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:to:from:subject :organization:arc-authentication-results; bh=BN0unsfnlqJ4OSnmsbqCK5r8/E0X8i/C7JSmuN4XEkQ=; b=NNG2FVVQDNVAR0DewHpMBhMJMOmdxt7t+n1oKv9/8aRTbVKYOJdkIWDXawR71wVh/K b3Ai/WUgypZrZ5lSkxHTB4XLEEx2yBxkcyIj1O7LKSGouf1b4HEFOe88e11I+3aeypNJ Og9QdqZKqq6s5Kx1i5y4ayW3J9p2CZmI7NSMhPUszBJyxSPtflP8+NkYy54DBw2CnTSq UmgAKQNvabT9L09m/kfBeZ6zKwJSCWDfmrwgEhUjZzjpdjiR6ShD5s0UVQ53i7kkwGcn rIMSGAnNMinbxiC0X9LoBGmoVPkz9Ty6E42lqsRwRQkCwsPHG/o9P7MY6V8wIuqL3Woh PWqA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n4si8802600pgt.450.2018.04.01.13.45.29; Sun, 01 Apr 2018 13:45:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754645AbeDAUoU (ORCPT + 99 others); Sun, 1 Apr 2018 16:44:20 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:43124 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754637AbeDAUoQ (ORCPT ); Sun, 1 Apr 2018 16:44:16 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6FE39406E97C for ; Sun, 1 Apr 2018 20:44:16 +0000 (UTC) Received: from warthog.procyon.org.uk (ovpn-120-59.rdu2.redhat.com [10.10.120.59]) by smtp.corp.redhat.com (Postfix) with ESMTP id 209792166BC7; Sun, 1 Apr 2018 20:44:16 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 Subject: [PATCH 40/45] C++: Fix sema_init() From: David Howells To: linux-kernel@vger.kernel.org Date: Sun, 01 Apr 2018 21:44:15 +0100 Message-ID: <152261545562.30503.15516261440506735873.stgit@warthog.procyon.org.uk> In-Reply-To: <152261521484.30503.16131389653845029164.stgit@warthog.procyon.org.uk> References: <152261521484.30503.16131389653845029164.stgit@warthog.procyon.org.uk> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Sun, 01 Apr 2018 20:44:16 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Sun, 01 Apr 2018 20:44:16 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'dhowells@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix sema_init() to manually initialise the semaphore rather than using __SEMAPHORE_INITIALIZER() as that doesn't seem to work on C++. Signed-off-by: David Howells --- include/linux/semaphore.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/linux/semaphore.h b/include/linux/semaphore.h index 11c86fbfeb98..364fb4721db5 100644 --- a/include/linux/semaphore.h +++ b/include/linux/semaphore.h @@ -32,7 +32,10 @@ struct semaphore { static inline void sema_init(struct semaphore *sem, int val) { static struct lock_class_key __key; - *sem = (struct semaphore) __SEMAPHORE_INITIALIZER(*sem, val); + + sem->count = val; + INIT_LIST_HEAD(&sem->wait_list); + raw_spin_lock_init(&sem->lock); lockdep_init_map(&sem->lock.dep_map, "semaphore->lock", &__key, 0); }