qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Chih-Min Chao <cmchao@gmail.com>
To: qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org, Chih-Min Chao <cmchao@gmail.com>
Subject: [Qemu-devel] [PATCH 1/2] target-arm : make parameter of feature/status checking function const
Date: Fri,  5 Sep 2014 02:01:16 +0800	[thread overview]
Message-ID: <1409853677-10966-2-git-send-email-cmchao@gmail.com> (raw)
In-Reply-To: <1409853677-10966-1-git-send-email-cmchao@gmail.com>

    CPUARMState is one of parameter used by
        is_a64
        arm_feature
        arm_el_is_aa64
    They only read it without any side effect and shold be changed to
    const parameter

Signed-off-by: Chih-Min Chao <cmchao@gmail.com>
---
 target-arm/cpu.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/target-arm/cpu.h b/target-arm/cpu.h
index 51bedc8..d7f1776 100644
--- a/target-arm/cpu.h
+++ b/target-arm/cpu.h
@@ -340,7 +340,7 @@ ARMCPU *cpu_arm_init(const char *cpu_model);
 int cpu_arm_exec(CPUARMState *s);
 uint32_t do_arm_semihosting(CPUARMState *env);
 
-static inline bool is_a64(CPUARMState *env)
+static inline bool is_a64(const CPUARMState *env)
 {
     return env->aarch64;
 }
@@ -677,13 +677,13 @@ enum arm_features {
     ARM_FEATURE_V8_PMULL, /* implements PMULL part of v8 Crypto Extensions */
 };
 
-static inline int arm_feature(CPUARMState *env, int feature)
+static inline int arm_feature(const CPUARMState *env, int feature)
 {
     return (env->features & (1ULL << feature)) != 0;
 }
 
 /* Return true if the specified exception level is running in AArch64 state. */
-static inline bool arm_el_is_aa64(CPUARMState *env, int el)
+static inline bool arm_el_is_aa64(const CPUARMState *env, int el)
 {
     /* We don't currently support EL2 or EL3, and this isn't valid for EL0
      * (if we're in EL0, is_a64() is what you want, and if we're not in EL0
-- 
2.0.4

  reply	other threads:[~2014-09-04 18:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-04 18:01 [Qemu-devel] [PATCH 0/2] target-arm : improvement Chih-Min Chao
2014-09-04 18:01 ` Chih-Min Chao [this message]
2014-09-04 18:05   ` [Qemu-devel] [PATCH 1/2] target-arm : make parameter of feature/status checking function const Peter Maydell
2014-09-04 18:15     ` Chih-Min Chao
2014-09-04 18:01 ` [Qemu-devel] [PATCH 2/2] target-arm : use aarch64 mode testing wrapper Chih-Min Chao
2014-09-04 18:30   ` Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1409853677-10966-2-git-send-email-cmchao@gmail.com \
    --to=cmchao@gmail.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).