All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Jan Beulich <JBeulich@suse.com>,
	xen-devel <xen-devel@lists.xenproject.org>
Cc: Tim Deegan <tim@xen.org>
Subject: Re: [PATCH] x86/shadow: convert non-const statics
Date: Wed, 28 Jan 2015 15:38:57 +0000	[thread overview]
Message-ID: <54C90291.4080606@citrix.com> (raw)
In-Reply-To: <54C90D6E020000780005A61A@mail.emea.novell.com>


[-- Attachment #1.1: Type: text/plain, Size: 2201 bytes --]

On 28/01/15 15:25, Jan Beulich wrote:
> To make obvious that such statics are safe to use, they should be
> const. In some of the cases, they don't even need to be static.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>

>
> --- a/xen/arch/x86/mm/shadow/common.c
> +++ b/xen/arch/x86/mm/shadow/common.c
> @@ -2164,7 +2164,7 @@ int sh_remove_write_access(struct vcpu *
>          NULL  /* unused  */
>      };
>  
> -    static unsigned int callback_mask = 
> +    const unsigned int callback_mask =
>            1 << SH_type_l1_32_shadow
>          | 1 << SH_type_fl1_32_shadow
>          | 1 << SH_type_l1_pae_shadow
> @@ -2414,7 +2414,7 @@ int sh_remove_all_mappings(struct vcpu *
>          NULL  /* unused  */
>      };
>  
> -    static unsigned int callback_mask = 
> +    const unsigned int callback_mask =
>            1 << SH_type_l1_32_shadow
>          | 1 << SH_type_fl1_32_shadow
>          | 1 << SH_type_l1_pae_shadow
> @@ -2558,7 +2558,7 @@ void sh_remove_shadows(struct vcpu *v, m
>      };
>  
>      /* Another lookup table, for choosing which mask to use */
> -    static unsigned int masks[SH_type_unused] = {
> +    static const unsigned int masks[SH_type_unused] = {
>          0, /* none    */
>          1 << SH_type_l2_32_shadow, /* l1_32   */
>          0, /* fl1_32  */
> @@ -2685,7 +2685,7 @@ static int sh_clear_up_pointer(struct vc
>  
>  void sh_reset_l3_up_pointers(struct vcpu *v)
>  {
> -    static hash_callback_t callbacks[SH_type_unused] = {
> +    static const hash_callback_t callbacks[SH_type_unused] = {
>          NULL, /* none    */
>          NULL, /* l1_32   */
>          NULL, /* fl1_32  */
> @@ -2703,7 +2703,7 @@ void sh_reset_l3_up_pointers(struct vcpu
>          NULL, /* p2m     */
>          NULL  /* unused  */
>      };
> -    static unsigned int callback_mask = 1 << SH_type_l3_64_shadow;    
> +    const unsigned int callback_mask = 1 << SH_type_l3_64_shadow;
>  
>      hash_foreach(v, callback_mask, callbacks, _mfn(INVALID_MFN));
>  }
>
>
>
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel


[-- Attachment #1.2: Type: text/html, Size: 3077 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

  reply	other threads:[~2015-01-28 15:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-28 15:25 [PATCH] x86/shadow: convert non-const statics Jan Beulich
2015-01-28 15:38 ` Andrew Cooper [this message]
2015-01-29 10:55 ` Tim Deegan

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=54C90291.4080606@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=tim@xen.org \
    --cc=xen-devel@lists.xenproject.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.