From patchwork Thu Oct 5 12:54:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Will Deacon X-Patchwork-Id: 114936 Delivered-To: patch@linaro.org Received: by 10.80.163.170 with SMTP id s39csp194227edb; Thu, 5 Oct 2017 05:56:04 -0700 (PDT) X-Google-Smtp-Source: AOwi7QBYBU0PUrS9f2G7+Dj9+/augQY7pvpfv0u5lHewiV1nD2/9MeI4g/QV6wQ1jh/RipGbhQaN X-Received: by 10.159.233.133 with SMTP id bh5mr22004191plb.28.1507208164214; Thu, 05 Oct 2017 05:56:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1507208164; cv=none; d=google.com; s=arc-20160816; b=dA7nWnHxjz7Ly8OktGO1gLh2JLF++B7Bob93nacjyvdNcEDS36NJwd9ETjmhYsRU1E duja9mflRCFo6byV29IlHIJH9d94OziJmHhzngdQYFZ8fQ8kD0uHa5iWsblYOqUVeI0A EOhgaNcdPjUXzIab/40PYMJSToGkJuuqgSR075+/lnFpQUETZmbyEBEf2j2Fsn4Tayry 0CgRamglUEsj6PsBgVv0Cl0JclGxktBNWSu59d31bE28MJuhGrKtaV3zC42kTArZ+eIy 0udZxhhUxlUFPBp1nHHeRukYzsl8jc7bf5ekzbYY1v7a9cUaROz+HtYCLs715BSQ+dFt f6sA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=hZHKDKlS4yGLvU7mZr4fOasa9F0cTxybm/zHh07l518=; b=xqR90QxGokiWF+nrgtzp39W5xd2um3egjqEDjNyNQNWtSKlwcjUVPcWpWLdpn1KhEJ hwvjS8zA6ngGz4nmVEgqSD4GlWoYBCayhuIc0coMk4kDhzLV8HHpH/HrULm9NNktzZXZ bgW5XgbkmSGpOfawEnakiqc+RiMHfkeFGv69RezSD2iuBI6IjVyOB754h9H9gf4iACtW /2hIkDbjuSwprhUIiqYstlcGc+m2WkKHgsq69Tx/MO5UclFgn8l/3SEbNQwGhO4vrpWy mZ571nrd37px87iwyP7ITUhxWFPy8SyrhapTXELx4z2oeeVBsGuXgqi+zug5SzxDkA2W 4EWA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i9si3855234plt.396.2017.10.05.05.56.03; Thu, 05 Oct 2017 05:56:04 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751587AbdJEMzX (ORCPT + 26 others); Thu, 5 Oct 2017 08:55:23 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:45052 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751419AbdJEMy6 (ORCPT ); Thu, 5 Oct 2017 08:54:58 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 87F75165C; Thu, 5 Oct 2017 05:54:58 -0700 (PDT) Received: from edgewater-inn.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 590B93F59E; Thu, 5 Oct 2017 05:54:58 -0700 (PDT) Received: by edgewater-inn.cambridge.arm.com (Postfix, from userid 1000) id 086641AE2F5E; Thu, 5 Oct 2017 13:54:59 +0100 (BST) From: Will Deacon To: linux-kernel@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, Jeremy.Linton@arm.com, peterz@infradead.org, mingo@redhat.com, longman@redhat.com, boqun.feng@gmail.com, paulmck@linux.vnet.ibm.com, Will Deacon Subject: [PATCH 6/6] kernel/locking: Remove unused union members from struct qrwlock Date: Thu, 5 Oct 2017 13:54:57 +0100 Message-Id: <1507208097-825-7-git-send-email-will.deacon@arm.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1507208097-825-1-git-send-email-will.deacon@arm.com> References: <1507208097-825-1-git-send-email-will.deacon@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Now that all atomic operations are performed on the full lock word of the qrwlock, there's no need to define a union type exposing the reader and writer subcomponents. Remove them. Cc: Peter Zijlstra Cc: Ingo Molnar Cc: Waiman Long Cc: Boqun Feng Cc: "Paul E. McKenney" Signed-off-by: Will Deacon --- include/asm-generic/qrwlock_types.h | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) -- 2.1.4 diff --git a/include/asm-generic/qrwlock_types.h b/include/asm-generic/qrwlock_types.h index 507f2dc51bba..7f53be31359c 100644 --- a/include/asm-generic/qrwlock_types.h +++ b/include/asm-generic/qrwlock_types.h @@ -9,23 +9,12 @@ */ typedef struct qrwlock { - union { - atomic_t cnts; - struct { -#ifdef __LITTLE_ENDIAN - u8 wmode; /* Writer mode */ - u8 rcnts[3]; /* Reader counts */ -#else - u8 rcnts[3]; /* Reader counts */ - u8 wmode; /* Writer mode */ -#endif - }; - }; + atomic_t cnts; arch_spinlock_t wait_lock; } arch_rwlock_t; #define __ARCH_RW_LOCK_UNLOCKED { \ - { .cnts = ATOMIC_INIT(0), }, \ + .cnts = ATOMIC_INIT(0), \ .wait_lock = __ARCH_SPIN_LOCK_UNLOCKED, \ }