From patchwork Wed Jul 13 11:23: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: 9227407 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 897976086B for ; Wed, 13 Jul 2016 11:26:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 788BA23B24 for ; Wed, 13 Jul 2016 11:26:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6B608272AA; Wed, 13 Jul 2016 11:26:39 +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 F161423B24 for ; Wed, 13 Jul 2016 11:26:38 +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 1bNIHF-0001ln-1F; Wed, 13 Jul 2016 11:24:29 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bNIHD-0001lN-1w for xen-devel@lists.xen.org; Wed, 13 Jul 2016 11:24:27 +0000 Received: from [85.158.137.68] by server-3.bemta-3.messagelabs.com id 7F/5C-31810-AE426875; Wed, 13 Jul 2016 11:24:26 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrDIsWRWlGSWpSXmKPExsUSfTxjoe5LlbZ wgxtXlC2WfFzM4sDocXT3b6YAxijWzLyk/IoE1oxNb9rYCv7zVDR/OM/SwNjH3cXIySEk4C5x 7t5vpi5GLiB7LaPEu9PvGCGck4wSE5p3MUFUeUh8PQuTAKpq+3iZDSTBJqAtce7QPbAiEQFpi WufL4MVMQssZpQ4cq+DGSQhLGAhsaNvMjuIzSKgKtF94yOYzSvgKnH23Wsgm4NDQkBOYsGFdJ Awp4CbxM9FnSwQi10lfj+4yQhiSwjkSEy9cJgNolxK4n+rEsgqCYFuFol9N24xQ9TISDyaeJN tAqPQAkaGVYwaxalFZalFukaGeklFmekZJbmJmTm6hgbGermpxcWJ6ak5iUnFesn5uZsYgaFY z8DAuIOxZ6/fIUZJDiYlUd7Oua3hQnxJ+SmVGYnFGfFFpTmpxYcYZTg4lCR4Pyi3hQsJFqWmp 1akZeYAowImLcHBoyTC6w+S5i0uSMwtzkyHSJ1iVJQS510PkhAASWSU5sG1wSLxEqOslDAvIw MDgxBPQWpRbmYJqvwrRnEORiVhXjZgXAvxZOaVwE1/BbSYCWhxrUMzyOKSRISUVAMja+MZ+1M zGq6KSJzcP1P/n56+ydnTGUyHmC4Y6xuGrFnw/S8z04X0C2W7v6w4Urxgv1y2V2pTjVbRK8eV D9TutTrqrhTaqC0cmVMeUXvzyo9TC/KO3lsrPP/GgjN5UmZKacvUxJXLPzWt4pcJ350zc+Hd9 sRVSmbiPQpn566osK5laJj6qkxdiaU4I9FQi7moOBEAT1YC5r8CAAA= X-Env-Sender: czuzu@bitdefender.com X-Msg-Ref: server-6.tower-31.messagelabs.com!1468409064!24046067!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 5800 invoked from network); 13 Jul 2016 11:24:25 -0000 Received: from mx01.bbu.dsd.mx.bitdefender.com (HELO mx01.bbu.dsd.mx.bitdefender.com) (91.199.104.161) by server-6.tower-31.messagelabs.com with DHE-RSA-AES128-GCM-SHA256 encrypted SMTP; 13 Jul 2016 11:24:25 -0000 Received: (qmail 4911 invoked from network); 13 Jul 2016 14:24:24 +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; 13 Jul 2016 14:24:24 +0300 Received: from smtp03.buh.bitdefender.org (unknown [10.17.80.77]) by mx-sr.buh.bitdefender.com (Postfix) with ESMTP id 73A177FBB8 for ; Wed, 13 Jul 2016 14:24:24 +0300 (EEST) Received: (qmail 14682 invoked from network); 13 Jul 2016 14:24:24 +0300 Received: from 188-24-57-61.rdsnet.ro (HELO localhost.localdomain) (czuzu@bitdefender.com@188.24.57.61) by smtp03.buh.bitdefender.org with SMTP; 13 Jul 2016 14:24:24 +0300 From: Corneliu ZUZU To: xen-devel@lists.xen.org Date: Wed, 13 Jul 2016 14:23:47 +0300 Message-Id: <1468409027-31028-1-git-send-email-czuzu@bitdefender.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1468408972-30937-1-git-send-email-czuzu@bitdefender.com> References: <1468408972-30937-1-git-send-email-czuzu@bitdefender.com> X-BitDefender-Scanner: Clean, Agent: BitDefender qmail 3.1.6 on smtp03.buh.bitdefender.org, sigver: 7.66301 X-BitDefender-Spam: No (0) X-BitDefender-SpamStamp: Build: [Engines: 2.15.6.911, Dats: 426283, Stamp: 3], Multi: [Enabled, t: (0.000009, 0.002303)], BW: [Enabled, t: (0.000007,0.000001)], RBL DNSBL: [Disabled], APM: [Enabled, Score: 500, t: (0.002401), 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.009045)], URL: [Enabled, t: (0.000005)], RTDA: [Enabled, t: (0.181239), Hit: No, Details: v2.3.10; Id: 2m1ghhh.1amv7hmgm.u64c], total: 0(775) X-BitDefender-CF-Stamp: none Cc: Andrew Cooper , Julien Grall , Stefano Stabellini , Jan Beulich Subject: [Xen-devel] [PATCH 2/2] 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 --- 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 8e8c5d1..cd86cf0 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 9bf4bc1..a16f0f6 100644 --- a/xen/include/asm-x86/atomic.h +++ b/xen/include/asm-x86/atomic.h @@ -86,7 +86,7 @@ void __bad_atomic_size(void); * * Atomically reads the value of @v. */ -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 5d5c051..6cbc6d8 100644 --- a/xen/include/xen/atomic.h +++ b/xen/include/xen/atomic.h @@ -37,7 +37,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