ia64/xen-unstable

changeset 9776:72f9c751d3ea

Replace &foo[0] with foo where the latter seems cleaner
(which is usually, and particularly when its an argument
to one of the bitops functions).

Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Wed Apr 19 18:32:20 2006 +0100 (2006-04-19)
parents b550a93c6459
children 5765497cf75e
files xen/arch/x86/domain_build.c xen/arch/x86/irq.c xen/arch/x86/shadow_public.c xen/common/event_channel.c xen/common/keyhandler.c
line diff
     1.1 --- a/xen/arch/x86/domain_build.c	Wed Apr 19 18:24:49 2006 +0100
     1.2 +++ b/xen/arch/x86/domain_build.c	Wed Apr 19 18:32:20 2006 +0100
     1.3 @@ -443,7 +443,7 @@ int construct_dom0(struct domain *d,
     1.4      v->arch.guest_table = mk_pagetable((unsigned long)l3start);
     1.5  #else
     1.6      l2start = l2tab = (l2_pgentry_t *)mpt_alloc; mpt_alloc += PAGE_SIZE;
     1.7 -    memcpy(l2tab, &idle_pg_table[0], PAGE_SIZE);
     1.8 +    memcpy(l2tab, idle_pg_table, PAGE_SIZE);
     1.9      l2tab[LINEAR_PT_VIRT_START >> L2_PAGETABLE_SHIFT] =
    1.10          l2e_from_paddr((unsigned long)l2start, __PAGE_HYPERVISOR);
    1.11      v->arch.guest_table = mk_pagetable((unsigned long)l2start);
    1.12 @@ -569,7 +569,7 @@ int construct_dom0(struct domain *d,
    1.13      /* WARNING: The new domain must have its 'processor' field filled in! */
    1.14      maddr_to_page(mpt_alloc)->u.inuse.type_info = PGT_l4_page_table;
    1.15      l4start = l4tab = __va(mpt_alloc); mpt_alloc += PAGE_SIZE;
    1.16 -    memcpy(l4tab, &idle_pg_table[0], PAGE_SIZE);
    1.17 +    memcpy(l4tab, idle_pg_table, PAGE_SIZE);
    1.18      l4tab[l4_table_offset(LINEAR_PT_VIRT_START)] =
    1.19          l4e_from_paddr(__pa(l4start), __PAGE_HYPERVISOR);
    1.20      l4tab[l4_table_offset(PERDOMAIN_VIRT_START)] =
     2.1 --- a/xen/arch/x86/irq.c	Wed Apr 19 18:24:49 2006 +0100
     2.2 +++ b/xen/arch/x86/irq.c	Wed Apr 19 18:32:20 2006 +0100
     2.3 @@ -198,7 +198,7 @@ static void __do_IRQ_guest(int vector)
     2.4      {
     2.5          d = action->guest[i];
     2.6          if ( (action->ack_type != ACKTYPE_NONE) &&
     2.7 -             !test_and_set_bit(irq, &d->pirq_mask[0]) )
     2.8 +             !test_and_set_bit(irq, d->pirq_mask) )
     2.9              action->in_flight++;
    2.10          send_guest_pirq(d, irq);
    2.11      }
    2.12 @@ -285,7 +285,7 @@ static void flush_all_pending_eoi(void *
    2.13          ASSERT(action->ack_type == ACKTYPE_EOI);
    2.14          ASSERT(desc->status & IRQ_GUEST);
    2.15          for ( i = 0; i < action->nr_guests; i++ )
    2.16 -            clear_bit(vector_to_irq(vector), &action->guest[i]->pirq_mask[0]);
    2.17 +            clear_bit(vector_to_irq(vector), action->guest[i]->pirq_mask);
    2.18          action->in_flight = 0;
    2.19          spin_unlock(&desc->lock);
    2.20      }
    2.21 @@ -310,8 +310,8 @@ int pirq_guest_unmask(struct domain *d)
    2.22  
    2.23          spin_lock_irq(&desc->lock);
    2.24  
    2.25 -        if ( !test_bit(d->pirq_to_evtchn[pirq], &s->evtchn_mask[0]) &&
    2.26 -             test_and_clear_bit(pirq, &d->pirq_mask[0]) )
    2.27 +        if ( !test_bit(d->pirq_to_evtchn[pirq], s->evtchn_mask) &&
    2.28 +             test_and_clear_bit(pirq, d->pirq_mask) )
    2.29          {
    2.30              ASSERT(action->ack_type != ACKTYPE_NONE);
    2.31              if ( --action->in_flight == 0 )
    2.32 @@ -493,13 +493,13 @@ int pirq_guest_unbind(struct domain *d, 
    2.33      switch ( action->ack_type )
    2.34      {
    2.35      case ACKTYPE_UNMASK:
    2.36 -        if ( test_and_clear_bit(irq, &d->pirq_mask[0]) &&
    2.37 +        if ( test_and_clear_bit(irq, d->pirq_mask) &&
    2.38               (--action->in_flight == 0) )
    2.39              desc->handler->end(vector);
    2.40          break;
    2.41      case ACKTYPE_EOI:
    2.42          /* NB. If #guests == 0 then we clear the eoi_map later on. */
    2.43 -        if ( test_and_clear_bit(irq, &d->pirq_mask[0]) &&
    2.44 +        if ( test_and_clear_bit(irq, d->pirq_mask) &&
    2.45               (--action->in_flight == 0) &&
    2.46               (action->nr_guests != 0) )
    2.47          {
    2.48 @@ -511,7 +511,7 @@ int pirq_guest_unbind(struct domain *d, 
    2.49          break;
    2.50      }
    2.51  
    2.52 -    BUG_ON(test_bit(irq, &d->pirq_mask[0]));
    2.53 +    BUG_ON(test_bit(irq, d->pirq_mask));
    2.54  
    2.55      if ( action->nr_guests != 0 )
    2.56          goto out;
    2.57 @@ -587,16 +587,16 @@ static void dump_irqs(unsigned char key)
    2.58                  printk("%u(%c%c%c%c)",
    2.59                         d->domain_id,
    2.60                         (test_bit(d->pirq_to_evtchn[irq],
    2.61 -                                 &d->shared_info->evtchn_pending[0]) ?
    2.62 +                                 d->shared_info->evtchn_pending) ?
    2.63                          'P' : '-'),
    2.64                         (test_bit(d->pirq_to_evtchn[irq]/BITS_PER_LONG,
    2.65                                   &d->shared_info->vcpu_info[0].
    2.66                                   evtchn_pending_sel) ?
    2.67                          'S' : '-'),
    2.68                         (test_bit(d->pirq_to_evtchn[irq],
    2.69 -                                 &d->shared_info->evtchn_mask[0]) ?
    2.70 +                                 d->shared_info->evtchn_mask) ?
    2.71                          'M' : '-'),
    2.72 -                       (test_bit(irq, &d->pirq_mask) ?
    2.73 +                       (test_bit(irq, d->pirq_mask) ?
    2.74                          'M' : '-'));
    2.75                  if ( i != action->nr_guests )
    2.76                      printk(",");
     3.1 --- a/xen/arch/x86/shadow_public.c	Wed Apr 19 18:24:49 2006 +0100
     3.2 +++ b/xen/arch/x86/shadow_public.c	Wed Apr 19 18:32:20 2006 +0100
     3.3 @@ -327,7 +327,7 @@ static void alloc_monitor_pagetable(stru
     3.4  
     3.5      mmfn = page_to_mfn(mmfn_info);
     3.6      mpl4e = (l4_pgentry_t *) map_domain_page_global(mmfn);
     3.7 -    memcpy(mpl4e, &idle_pg_table[0], PAGE_SIZE);
     3.8 +    memcpy(mpl4e, idle_pg_table, PAGE_SIZE);
     3.9      mpl4e[l4_table_offset(PERDOMAIN_VIRT_START)] =
    3.10          l4e_from_paddr(__pa(d->arch.mm_perdomain_l3), __PAGE_HYPERVISOR);
    3.11  
     4.1 --- a/xen/common/event_channel.c	Wed Apr 19 18:24:49 2006 +0100
     4.2 +++ b/xen/common/event_channel.c	Wed Apr 19 18:32:20 2006 +0100
     4.3 @@ -477,10 +477,10 @@ void evtchn_set_pending(struct vcpu *v, 
     4.4       * others may require explicit memory barriers.
     4.5       */
     4.6  
     4.7 -    if ( test_and_set_bit(port, &s->evtchn_pending[0]) )
     4.8 +    if ( test_and_set_bit(port, s->evtchn_pending) )
     4.9          return;
    4.10  
    4.11 -    if ( !test_bit        (port, &s->evtchn_mask[0])    &&
    4.12 +    if ( !test_bit        (port, s->evtchn_mask) &&
    4.13           !test_and_set_bit(port / BITS_PER_LONG,
    4.14                             &v->vcpu_info->evtchn_pending_sel) &&
    4.15           !test_and_set_bit(0, &v->vcpu_info->evtchn_upcall_pending) )
    4.16 @@ -668,8 +668,8 @@ static long evtchn_unmask(evtchn_unmask_
    4.17       * These operations must happen in strict order. Based on
    4.18       * include/xen/event.h:evtchn_set_pending(). 
    4.19       */
    4.20 -    if ( test_and_clear_bit(port, &s->evtchn_mask[0]) &&
    4.21 -         test_bit          (port, &s->evtchn_pending[0]) &&
    4.22 +    if ( test_and_clear_bit(port, s->evtchn_mask) &&
    4.23 +         test_bit          (port, s->evtchn_pending) &&
    4.24           !test_and_set_bit (port / BITS_PER_LONG,
    4.25                              &v->vcpu_info->evtchn_pending_sel) &&
    4.26           !test_and_set_bit (0, &v->vcpu_info->evtchn_upcall_pending) )
     5.1 --- a/xen/common/keyhandler.c	Wed Apr 19 18:24:49 2006 +0100
     5.2 +++ b/xen/common/keyhandler.c	Wed Apr 19 18:32:20 2006 +0100
     5.3 @@ -157,9 +157,9 @@ static void dump_domains(unsigned char k
     5.4              printk("    Notifying guest (virq %d, port %d, stat %d/%d/%d)\n",
     5.5                     VIRQ_DEBUG, v->virq_to_evtchn[VIRQ_DEBUG],
     5.6                     test_bit(v->virq_to_evtchn[VIRQ_DEBUG], 
     5.7 -                            &d->shared_info->evtchn_pending[0]),
     5.8 +                            d->shared_info->evtchn_pending),
     5.9                     test_bit(v->virq_to_evtchn[VIRQ_DEBUG], 
    5.10 -                            &d->shared_info->evtchn_mask[0]),
    5.11 +                            d->shared_info->evtchn_mask),
    5.12                     test_bit(v->virq_to_evtchn[VIRQ_DEBUG]/BITS_PER_LONG, 
    5.13                              &v->vcpu_info->evtchn_pending_sel));
    5.14              send_guest_vcpu_virq(v, VIRQ_DEBUG);