From: Juergen Gross Subject: [PATCH 5/5] xen: clean up VPF flags macros Date: Fri, 25 Sep 2015 13:54:32 +0200 Message-ID: <1443182072-15321-6-git-send-email-jgross@suse.com> References: <1443182072-15321-1-git-send-email-jgross@suse.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1443182072-15321-1-git-send-email-jgross@suse.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: keir@xen.org, Ian.Campbell@citrix.com, andrew.cooper3@citrix.com, ian.jackson@eu.citrix.com, tim@xen.org, david.vrabel@citrix.com, jbeulich@suse.com, xen-devel@lists.xen.org, stefano.stabellini@eu.citrix.com, wei.liu2@citrix.com Cc: Juergen Gross List-Id: xen-devel@lists.xenproject.org Per-VCPU pause flags in sched.h are defined as bit positions and as values derived from the bit defines. There is only one user of a value which can be easily converted to use a bit number as well. Remove the value definitions and do the conversion for the only user. Signed-off-by: Juergen Gross --- xen/common/domctl.c | 2 +- xen/include/xen/sched.h | 10 +--------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/xen/common/domctl.c b/xen/common/domctl.c index 9e0fef5..e44bc4c 100644 --- a/xen/common/domctl.c +++ b/xen/common/domctl.c @@ -172,7 +172,7 @@ void getdomaininfo(struct domain *d, struct xen_domctl_getdomaininfo *info) info->max_vcpu_id = v->vcpu_id; if ( !test_bit(_VPF_down, &v->pause_flags) ) { - if ( !(v->pause_flags & VPF_blocked) ) + if ( !test_bit(_VPF_blocked, &v->pause_flags) ) flags &= ~XEN_DOMINF_blocked; if ( v->is_running ) flags |= XEN_DOMINF_running; diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h index b5190b5..bc7d5cb 100644 --- a/xen/include/xen/sched.h +++ b/xen/include/xen/sched.h @@ -745,32 +745,24 @@ static inline struct domain *next_domain_in_cpupool( (_v) = (_v)->next_in_list ) /* - * Per-VCPU pause flags. + * Per-VCPU pause flags (bit positions). */ /* Domain is blocked waiting for an event. */ #define _VPF_blocked 0 -#define VPF_blocked (1UL<<_VPF_blocked) /* VCPU is offline. */ #define _VPF_down 1 -#define VPF_down (1UL<<_VPF_down) /* VCPU is blocked awaiting an event to be consumed by Xen. */ #define _VPF_blocked_in_xen 2 -#define VPF_blocked_in_xen (1UL<<_VPF_blocked_in_xen) /* VCPU affinity has changed: migrating to a new CPU. */ #define _VPF_migrating 3 -#define VPF_migrating (1UL<<_VPF_migrating) /* VCPU is blocked due to missing mem_paging ring. */ #define _VPF_mem_paging 4 -#define VPF_mem_paging (1UL<<_VPF_mem_paging) /* VCPU is blocked due to missing mem_access ring. */ #define _VPF_mem_access 5 -#define VPF_mem_access (1UL<<_VPF_mem_access) /* VCPU is blocked due to missing mem_sharing ring. */ #define _VPF_mem_sharing 6 -#define VPF_mem_sharing (1UL<<_VPF_mem_sharing) /* VCPU is being reset. */ #define _VPF_in_reset 7 -#define VPF_in_reset (1UL<<_VPF_in_reset) static inline int vcpu_runnable(struct vcpu *v) { -- 2.1.4