Received: by 10.213.65.68 with SMTP id h4csp1742465imn; Sun, 1 Apr 2018 13:45:31 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+KDuPoUDGN4dvXn1NX9Z96tZTt3K7wcPoxdR03E9E3Qs3wisuwWDx6TPoHsoEJI6fYDJwd X-Received: by 2002:a17:902:f64:: with SMTP id 91-v6mr7301161ply.397.1522615531275; Sun, 01 Apr 2018 13:45:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522615531; cv=none; d=google.com; s=arc-20160816; b=WopECoaFCbUb+L+pwFi+RbC06VDeUnxA8rQBJ89+MMoYlIQSbL67MBBwWF7VH1tSVa xiLHClDnp3sECc2DRi8NFKG7wu8xuaEKgGzkrAnw4Wq45JlpbKyGWPeDsjBPFSkIpmHR duzf2SM5rQDQylXfzfLkkrE7r3LSe6H4ulPjZr/bZeCljPVdgbCUHWeJI3CRLqH9hvcV g4WX3+fb2AejmKIZ2tD0eIVceSObft9ur26DrkzTAzOhqcXBB5YxO6tlwJmvNuZshxTU dfapozXavYnct/WWLM5JZmLLNMmCmPqUFcd50uhoNmujldpSN11gQwOwCXAWgbCdgocy 7DKw== 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=Jbc7XCvBeAvTTWjswZxzid/zHoQU4tNW7pYZbQ2hKJE=; b=QmeSaB7/oSQurMdM/1zvxHxOOM3LWhn5MFfMb1DPm9+T7xn+gm6ftCbkIaxGFeZC+r 9sechbtwo1B3rrswjsonGjEQ4FWvqVvQJ1UyxAnFOlHuoT++w8Z7DLDQurLrJenfycuG GP+0rEJ1bTG8/3w3swEyqY1rJz5AgQ1R0XcslzBUhC0aIixB1xDsW5KC4u1rzg1bguqZ ri7dIM1RDTZbABvK7ebm2WXQKwqN3W/Y+RAkkeKgaNej82VLAwyqAuFUj9AkYa3x1T5b 6M01HYoQqja0f1X7mE4/TG0k0L8YyMh7QNow2MpcGEHmdgxI6Q4gyCr/Ex6F5spc7cuL emnQ== 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 e4si9849367pfa.103.2018.04.01.13.45.17; Sun, 01 Apr 2018 13:45:31 -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 S1754633AbeDAUoO (ORCPT + 99 others); Sun, 1 Apr 2018 16:44:14 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:43120 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754042AbeDAUoK (ORCPT ); Sun, 1 Apr 2018 16:44:10 -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 77B28406E97C for ; Sun, 1 Apr 2018 20:44:10 +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 27859215CDAC; Sun, 1 Apr 2018 20:44:10 +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 39/45] C++: Fix spinlock initialisation From: David Howells To: linux-kernel@vger.kernel.org Date: Sun, 01 Apr 2018 21:44:09 +0100 Message-ID: <152261544964.30503.6618621118546753722.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:10 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Sun, 01 Apr 2018 20:44:10 +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 a couple of bits of spinlock initialisation: (1) owner_cpu is unsigned: set to UINT_MAX rather than -1. (2) Don't need to cast the result of __SPIN_LOCK_INITIALIZER(). Signed-off-by: David Howells --- include/linux/spinlock_types.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/linux/spinlock_types.h b/include/linux/spinlock_types.h index 24b4e6f2c1a2..d1ab81ee85fd 100644 --- a/include/linux/spinlock_types.h +++ b/include/linux/spinlock_types.h @@ -41,7 +41,7 @@ typedef struct raw_spinlock { #ifdef CONFIG_DEBUG_SPINLOCK # define SPIN_DEBUG_INIT(lockname) \ .magic = SPINLOCK_MAGIC, \ - .owner_cpu = -1, \ + .owner_cpu = UINT_MAX, \ .owner = SPINLOCK_OWNER_INIT, #else # define SPIN_DEBUG_INIT(lockname) @@ -76,7 +76,7 @@ typedef struct spinlock { { { .rlock = __RAW_SPIN_LOCK_INITIALIZER(lockname) } } #define __SPIN_LOCK_UNLOCKED(lockname) \ - (spinlock_t ) __SPIN_LOCK_INITIALIZER(lockname) + __SPIN_LOCK_INITIALIZER(lockname) #define DEFINE_SPINLOCK(x) spinlock_t x = __SPIN_LOCK_UNLOCKED(x)