d->auto_node_affinity = 1;
spin_lock_init(&d->shutdown_lock);
- d->shutdown_code = -1;
+ d->shutdown_code = SHUTDOWN_CODE_INVALID;
spin_lock_init(&d->pbuf_lock);
spin_lock(&d->shutdown_lock);
- if ( d->shutdown_code == -1 )
+ if ( d->shutdown_code == SHUTDOWN_CODE_INVALID )
d->shutdown_code = reason;
reason = d->shutdown_code;
spin_lock(&d->shutdown_lock);
d->is_shutting_down = d->is_shut_down = 0;
- d->shutdown_code = -1;
+ d->shutdown_code = SHUTDOWN_CODE_INVALID;
for_each_vcpu ( d, v )
{
d->domain_id, current->vcpu_id, sched_shutdown.reason);
spin_lock(&d->shutdown_lock);
- if ( d->shutdown_code == -1 )
+ if ( d->shutdown_code == SHUTDOWN_CODE_INVALID )
d->shutdown_code = (u8)sched_shutdown.reason;
spin_unlock(&d->shutdown_lock);
static inline struct bhdr *FIND_SUITABLE_BLOCK(struct xmem_pool *p, int *fl,
int *sl)
{
- u32 tmp = p->sl_bitmap[*fl] & (~0 << *sl);
+ u32 tmp = p->sl_bitmap[*fl] & (~0u << *sl);
struct bhdr *b = NULL;
if ( tmp )
}
else
{
- *fl = ffs(p->fl_bitmap & (~0 << (*fl + 1))) - 1;
+ *fl = ffs(p->fl_bitmap & (~0u << (*fl + 1))) - 1;
if ( likely(*fl > 0) )
{
*sl = ffs(p->sl_bitmap[*fl]) - 1;
spinlock_t shutdown_lock;
bool_t is_shutting_down; /* in process of shutting down? */
bool_t is_shut_down; /* fully shut down? */
- int shutdown_code;
+#define SHUTDOWN_CODE_INVALID ~0u
+ unsigned int shutdown_code;
/* If this is not 0, send suspend notification here instead of
* raising DOM_EXC */
#define is_idle_domain(d) ((d)->domain_id == DOMID_IDLE)
#define is_idle_vcpu(v) (is_idle_domain((v)->domain))
-#define DOMAIN_DESTROYED (1<<31) /* assumes atomic_t is >= 32 bits */
+#define DOMAIN_DESTROYED (1u << 31) /* assumes atomic_t is >= 32 bits */
#define put_domain(_d) \
if ( atomic_dec_and_test(&(_d)->refcnt) ) domain_destroy(_d)