Received: by 10.213.65.68 with SMTP id h4csp1741764imn; Sun, 1 Apr 2018 13:44:08 -0700 (PDT) X-Google-Smtp-Source: AIpwx498FhJl0v03xJHgV5Fu+exstYHo/w6UA3Y3bEUFhrz4fmE8RnphKaZ8OKyr+vn0mabYAMTK X-Received: by 2002:a17:902:9896:: with SMTP id s22-v6mr7363430plp.240.1522615448101; Sun, 01 Apr 2018 13:44:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522615448; cv=none; d=google.com; s=arc-20160816; b=bqEU2FHnr8cUx0py3RATiK+GWayD7KQvwgSDHXjHmkODs3ao6aaLJv3ePgSwtPoc8E 4QfzIEW8pnpx0ymm6fCYLwJeQzne8M0y8PqHPiackOmrPXcdDH0B7LInDaAJh8p6V2Aj vgk9YdobKMq0FWrlHuu3qUQ1CBSuYGssF8fcRclkkZKYzGp87Vrxe4b1EWM8o+2kobx/ h7V59Fyq2t1SqjvXByJmlaTGA1G4PfCNcocGIsV6l7KY9N84MXFbaaXveuzcDc39JNHv atqVLBb6lrvW0gWDHTrBx9Q899o5FjMUPjqG3U6b4fpgxKPDeom1G3wmcWp9QTTa986/ /mwQ== 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=7/hkWhQCAl/ipN2mCVex1wVZJD2ZzswOvQz4fiX0r70=; b=lreaIrUHeBoOvtt/au5k9zLStFBvFkXm0zE+qaB9YZ64Ag1YBEvKg3l3xswVYIpoAh QfU/MYzVHzrV2M7nCXfk7s+DIr03fdjDcvDQC5i/7ytz2dhXkb8+RWpC4XdUdIFU0y9v z1A7+85PmaxYWN/kSEYRu1tOYlNMNgKwXB3EGT9sa0WOlzdZ/O7y35nHtcOXmR9se3AK 3CWzvHLuucqDz45hDFdP5INhpEWXVmQDMtEsOs5TSJ/+gjS5ahVlDWq3z0kK0yPb2q4u PcSyjSsI9lkZIRq54u1c49um/pPwypJzA1o5WUUoewUUWWTEFbEH2ZJ3iZTfI1V5b2L4 c7JQ== 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 r9si9876227pfg.8.2018.04.01.13.43.54; Sun, 01 Apr 2018 13:44:08 -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 S1754397AbeDAUmZ (ORCPT + 99 others); Sun, 1 Apr 2018 16:42:25 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:38018 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754382AbeDAUmX (ORCPT ); Sun, 1 Apr 2018 16:42:23 -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 9B655406804F for ; Sun, 1 Apr 2018 20:42:22 +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 4B501215CDAC; Sun, 1 Apr 2018 20:42:22 +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 21/45] C++: Set the type of atomic64_t to s64 From: David Howells To: linux-kernel@vger.kernel.org Date: Sun, 01 Apr 2018 21:42:21 +0100 Message-ID: <152261534183.30503.13961922233693133727.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.5]); Sun, 01 Apr 2018 20:42:22 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Sun, 01 Apr 2018 20:42:22 +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 Always declare the type of atomic64_t to be s64 rather than conditionally defining it as long in generic code. Signed-off-by: David Howells --- arch/x86/include/asm/atomic64_64.h | 12 ++++++------ include/linux/types.h | 4 +--- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/arch/x86/include/asm/atomic64_64.h b/arch/x86/include/asm/atomic64_64.h index 738495caf05f..895292a50c77 100644 --- a/arch/x86/include/asm/atomic64_64.h +++ b/arch/x86/include/asm/atomic64_64.h @@ -172,20 +172,20 @@ static inline long atomic64_fetch_sub(long i, atomic64_t *v) #define atomic64_inc_return(v) (atomic64_add_return(1, (v))) #define atomic64_dec_return(v) (atomic64_sub_return(1, (v))) -static inline long atomic64_cmpxchg(atomic64_t *v, long old, long new) +static inline long atomic64_cmpxchg(atomic64_t *v, s64 old, s64 new_val) { - return cmpxchg(&v->counter, old, new); + return cmpxchg(&v->counter, old, new_val); } #define atomic64_try_cmpxchg atomic64_try_cmpxchg -static __always_inline bool atomic64_try_cmpxchg(atomic64_t *v, s64 *old, long new) +static __always_inline bool atomic64_try_cmpxchg(atomic64_t *v, s64 *old, s64 new_val) { - return try_cmpxchg(&v->counter, old, new); + return try_cmpxchg(&v->counter, *old, new_val); } -static inline long atomic64_xchg(atomic64_t *v, long new) +static inline long atomic64_xchg(atomic64_t *v, long new_val) { - return xchg(&v->counter, new); + return xchg(&v->counter, new_val); } /** diff --git a/include/linux/types.h b/include/linux/types.h index 68323cb03910..d233b12c7ebe 100644 --- a/include/linux/types.h +++ b/include/linux/types.h @@ -179,11 +179,9 @@ typedef struct { int counter; } atomic_t; -#ifdef CONFIG_64BIT typedef struct { - long counter; + s64 counter; } atomic64_t; -#endif struct list_head { struct list_head *next, *prev;