From patchwork Fri Jul 15 06:50:47 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corneliu ZUZU X-Patchwork-Id: 9231213 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B258760865 for ; Fri, 15 Jul 2016 06:53:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A017C28307 for ; Fri, 15 Jul 2016 06:53:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 934052832B; Fri, 15 Jul 2016 06:53:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 14CA928307 for ; Fri, 15 Jul 2016 06:53:25 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bNwxp-0000FM-ES; Fri, 15 Jul 2016 06:51:09 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bNwxo-0000FB-ED for xen-devel@lists.xen.org; Fri, 15 Jul 2016 06:51:08 +0000 Received: from [193.109.254.147] by server-2.bemta-14.messagelabs.com id D9/5C-29243-BD788875; Fri, 15 Jul 2016 06:51:07 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrFIsWRWlGSWpSXmKPExsUSfTxjoe7t9o5 wg/aLLBZLPi5mcWD0OLr7N1MAYxRrZl5SfkUCa8a/38dZChbzVWztOMHawPiVu4uRk0NIwEPi T8Nati5GLiB7LaPEteNfWCCck4wSl3ccZYSp+rzoB1RiNaPEsXX3WEASbALaEucO3WMCsUUEp CWufb7MCFLELLCYUeLIvQ5mkISwgKdE84G3YDaLgKrEvM1tYDavgKtE+94PQM0cHBICchILLq SDmJwCbhKnTxdC7HWV2Lj3BFi1hECOxN7DX6CqpST+tyqBbJIQ6GaRmPi8nR2iRkbi0cSbbBM YhRYwMqxiVC9OLSpLLdK10EsqykzPKMlNzMzRNTQ00ctNLS5OTE/NSUwq1kvOz93ECAxDBiDY wbhxkvMhRkkOJiVR3o0pHeFCfEn5KZUZicUZ8UWlOanFhxhlODiUJHilgGEtJFiUmp5akZaZA 4wImLQEB4+SCG8cSJq3uCAxtzgzHSJ1ilFRSpz3URtQQgAkkVGaB9cGi8JLjLJSwryMQIcI8R SkFuVmlqDKv2IU52BUEua9BTKFJzOvBG76K6DFTECLrc3bQRaXJCKkpBoYuR9/tXBLvrBux34 758wZGx62r9kefJrpmVRIwuv0p4477WdtkS5+/OyNskVBTdf98HteWgGzF/Rt11gsfGP1pSf8 6yb+XLxvYupL5zn1xh1PphZ4Xxc0+t3f0Cd74WKedbR01LeXkSFft0zYuHnatF4Bf/818+e7V 3k8TVaQP3GvZo25/JaWDCWW4oxEQy3mouJEAAVc/YS9AgAA X-Env-Sender: czuzu@bitdefender.com X-Msg-Ref: server-13.tower-27.messagelabs.com!1468565466!54058650!1 X-Originating-IP: [91.199.104.161] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 8.77; banners=-,-,- X-VirusChecked: Checked Received: (qmail 65349 invoked from network); 15 Jul 2016 06:51:06 -0000 Received: from mx01.bbu.dsd.mx.bitdefender.com (HELO mx01.bbu.dsd.mx.bitdefender.com) (91.199.104.161) by server-13.tower-27.messagelabs.com with DHE-RSA-AES128-GCM-SHA256 encrypted SMTP; 15 Jul 2016 06:51:06 -0000 Received: (qmail 13246 invoked from network); 15 Jul 2016 09:51:06 +0300 Received: from unknown (HELO mx-sr.buh.bitdefender.com) (10.17.80.103) by mx01.bbu.dsd.mx.bitdefender.com with AES256-GCM-SHA384 encrypted SMTP; 15 Jul 2016 09:51:06 +0300 Received: from smtp01.buh.bitdefender.com (unknown [10.17.80.75]) by mx-sr.buh.bitdefender.com (Postfix) with ESMTP id E5D2F7FC05 for ; Fri, 15 Jul 2016 09:51:05 +0300 (EEST) Received: (qmail 10799 invoked from network); 15 Jul 2016 09:51:05 +0300 Received: from unknown (HELO czuzu-dev-vm.clj.bitdefender.biz) (czuzu@bitdefender.com@91.199.104.243) by smtp01.buh.bitdefender.com with SMTP; 15 Jul 2016 09:51:05 +0300 From: Corneliu ZUZU To: xen-devel@lists.xen.org Date: Fri, 15 Jul 2016 09:50:47 +0300 Message-Id: <1468565447-32761-1-git-send-email-czuzu@bitdefender.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1468565278-32535-1-git-send-email-czuzu@bitdefender.com> References: <1468565278-32535-1-git-send-email-czuzu@bitdefender.com> X-BitDefender-Scanner: Clean, Agent: BitDefender qmail 3.1.6 on smtp01.buh.bitdefender.com, sigver: 7.66328 X-BitDefender-Spam: No (0) X-BitDefender-SpamStamp: Build: [Engines: 2.15.6.911, Dats: 426550, Stamp: 3], Multi: [Enabled, t: (0.000009, 0.002472)], BW: [Enabled, t: (0.000007,0.000001)], RBL DNSBL: [Disabled], APM: [Enabled, Score: 500, t: (0.002515), Flags: 85D2ED72; NN_NO_CONTENT_TYPE; NN_NO_LINK_NMD; NN_LEGIT_BITDEFENDER; NN_LEGIT_S_SQARE_BRACKETS; NN_LEGIT_MAILING_LIST_TO], SGN: [Enabled, t: (0.009310)], URL: [Enabled, t: (0.000004)], RTDA: [Enabled, t: (0.174344), Hit: No, Details: v2.3.10; Id: 2m1ghm1.1an9ci7f8.njha], total: 0(775) X-BitDefender-CF-Stamp: none Cc: Andrew Cooper , Julien Grall , Stefano Stabellini , Jan Beulich Subject: [Xen-devel] [PATCH v4 5/7] xen/atomic.h: fix: make atomic_read() param const X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP This wouldn't let me make a param of a function that used atomic_read() const. Signed-off-by: Corneliu ZUZU Reviewed-by: Andrew Cooper Reviewed-by: Stefano Stabellini Reviewed-by: Julien Grall --- Changed since v3: --- xen/include/asm-arm/atomic.h | 2 +- xen/include/asm-x86/atomic.h | 2 +- xen/include/xen/atomic.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/xen/include/asm-arm/atomic.h b/xen/include/asm-arm/atomic.h index a79420a..78dad29 100644 --- a/xen/include/asm-arm/atomic.h +++ b/xen/include/asm-arm/atomic.h @@ -102,7 +102,7 @@ void __bad_atomic_size(void); * strex/ldrex monitor on some implementations. The reason we can use it for * atomic_set() is the clrex or dummy strex done on every exception return. */ -static inline int atomic_read(atomic_t *v) +static inline int atomic_read(const atomic_t *v) { return *(volatile int *)&v->counter; } diff --git a/xen/include/asm-x86/atomic.h b/xen/include/asm-x86/atomic.h index 3e99b03..1729e29 100644 --- a/xen/include/asm-x86/atomic.h +++ b/xen/include/asm-x86/atomic.h @@ -80,7 +80,7 @@ void __bad_atomic_size(void); } \ }) -static inline int atomic_read(atomic_t *v) +static inline int atomic_read(const atomic_t *v) { return read_atomic(&v->counter); } diff --git a/xen/include/xen/atomic.h b/xen/include/xen/atomic.h index d072912..6827468 100644 --- a/xen/include/xen/atomic.h +++ b/xen/include/xen/atomic.h @@ -32,7 +32,7 @@ typedef struct { int counter; } atomic_t; * * Atomically reads the value of @v. */ -static inline int atomic_read(atomic_t *v); +static inline int atomic_read(const atomic_t *v); /** * _atomic_read - read atomic variable non-atomically