From patchwork Fri Jul 15 10:44:10 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corneliu ZUZU X-Patchwork-Id: 9231657 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 671BB60865 for ; Fri, 15 Jul 2016 10:47:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5888A2819A for ; Fri, 15 Jul 2016 10:47:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4D17428325; Fri, 15 Jul 2016 10:47:55 +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 AEC852819A for ; Fri, 15 Jul 2016 10:47:54 +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 1bO0cp-0003dJ-GR; Fri, 15 Jul 2016 10:45:43 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bO0co-0003d4-JD for xen-devel@lists.xen.org; Fri, 15 Jul 2016 10:45:42 +0000 Received: from [85.158.137.68] by server-8.bemta-3.messagelabs.com id FF/7F-03780-5DEB8875; Fri, 15 Jul 2016 10:45:41 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrJIsWRWlGSWpSXmKPExsUSfTxjoe6VfR3 hBp2PrSyWfFzM4sDocXT3b6YAxijWzLyk/IoE1ozbi78yFlzhq/jx6SxjA+Mini5GTg4hAQ+J Rdt6mboYuYDstYwS31a+YoVInGSU2Do/Fqaoedl8Zoii1YwS81vOM4Ik2AS0Jc4duscEYosIS Etc+3yZEaSIWWAxo8SRex3MIAlhAU+J7hcPwGwWAVWJRUsWsoHYvAKuEl+mLgfaxsEhISAnse BCOojJKeAm8axXC2Kvq8Ti57NZQGwJgRyJuyuXskNUS0n8b1UC2SQh0MMiseVZBztEjYzEo4k 32SYwCi1gZFjFqF6cWlSWWqRropdUlJmeUZKbmJmja2hgrJebWlycmJ6ak5hUrJecn7uJERiE DECwg7Hxi9MhRkkOJiVR3o0pHeFCfEn5KZUZicUZ8UWlOanFhxhlODiUJHjL9gLlBItS01Mr0 jJzgPEAk5bg4FES4V0NkuYtLkjMLc5Mh0idYlSUEud1BUkIgCQySvPg2mAxeIlRVkqYlxHoEC GegtSi3MwSVPlXjOIcjErCvJtBpvBk5pXATX8FtJgJaLG1eTvI4pJEhJRUA+N89u2+X+vXBO0 9q1f2x+Fdgsakz+oZT38Y//a4Py2TvcP8rMpWhs+Odt+iln/PmjDl498drpsFdjexLdwQKKjs tHHlaTnzRaXRdzZauv05mhXCU1kp/O7Ct8lfCrf7zJcrFflyrXSVk3lA73LpQOZ96aG1Gkvfv VnMkG6T9Ejsu/HBLV4X9O2VWIozEg21mIuKEwGXWJU2vAIAAA== X-Env-Sender: czuzu@bitdefender.com X-Msg-Ref: server-11.tower-31.messagelabs.com!1468579540!24529384!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 6456 invoked from network); 15 Jul 2016 10:45:40 -0000 Received: from mx01.bbu.dsd.mx.bitdefender.com (HELO mx01.bbu.dsd.mx.bitdefender.com) (91.199.104.161) by server-11.tower-31.messagelabs.com with DHE-RSA-AES128-GCM-SHA256 encrypted SMTP; 15 Jul 2016 10:45:40 -0000 Received: (qmail 23460 invoked from network); 15 Jul 2016 13:45:40 +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 13:45:40 +0300 Received: from smtp02.buh.bitdefender.net (unknown [10.17.80.76]) by mx-sr.buh.bitdefender.com (Postfix) with ESMTP id CEBF07FC07 for ; Fri, 15 Jul 2016 13:45:36 +0300 (EEST) Received: (qmail 21362 invoked from network); 15 Jul 2016 13:45:36 +0300 Received: from unknown (HELO czuzu-dev-vm.clj.bitdefender.biz) (czuzu@bitdefender.com@91.199.104.243) by smtp02.buh.bitdefender.net with SMTP; 15 Jul 2016 13:45:36 +0300 From: Corneliu ZUZU To: xen-devel@lists.xen.org Date: Fri, 15 Jul 2016 13:44:10 +0300 Message-Id: <1468579450-19920-1-git-send-email-czuzu@bitdefender.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1468579290-19685-1-git-send-email-czuzu@bitdefender.com> References: <1468579290-19685-1-git-send-email-czuzu@bitdefender.com> X-BitDefender-Scanner: Clean, Agent: BitDefender qmail 3.1.6 on smtp02.buh.bitdefender.net, sigver: 7.66331 X-BitDefender-Spam: No (0) X-BitDefender-SpamStamp: Build: [Engines: 2.15.6.911, Dats: 426567, Stamp: 3], Multi: [Enabled, t: (0.000009, 0.002674)], BW: [Enabled, t: (0.000007,0.000001)], RBL DNSBL: [Disabled], APM: [Enabled, Score: 500, t: (0.002514), 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.009804)], URL: [Enabled, t: (0.000005)], RTDA: [Enabled, t: (0.013808), Hit: No, Details: v2.3.10; Id: 2m1ghm2.1an4umg8t.1001s], total: 0(775) X-BitDefender-CF-Stamp: none Cc: Andrew Cooper , Julien Grall , Stefano Stabellini , Jan Beulich Subject: [Xen-devel] [PATCH v5 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 v4: --- 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 b81e50d..91f05c8 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