ia64/xen-unstable

changeset 18726:537d480b7ffc

x86: Fix coding style in msi.c
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Mon Oct 27 11:56:57 2008 +0000 (2008-10-27)
parents 9e47e72fd03e
children 101e50cffc78
files xen/arch/x86/msi.c
line diff
     1.1 --- a/xen/arch/x86/msi.c	Mon Oct 27 11:27:31 2008 +0000
     1.2 +++ b/xen/arch/x86/msi.c	Mon Oct 27 11:56:57 2008 +0000
     1.3 @@ -33,8 +33,7 @@ DECLARE_BITMAP(msix_fixmap_pages, MAX_MS
     1.4  
     1.5  static int msix_fixmap_alloc(void)
     1.6  {
     1.7 -    int i;
     1.8 -    int rc = -1;
     1.9 +    int i, rc = -1;
    1.10  
    1.11      spin_lock(&msix_fixmap_lock);
    1.12      for ( i = 0; i < MAX_MSIX_PAGES; i++ )
    1.13 @@ -52,12 +51,8 @@ static int msix_fixmap_alloc(void)
    1.14  
    1.15  static void msix_fixmap_free(int idx)
    1.16  {
    1.17 -    if ( idx < FIX_MSIX_IO_RESERV_BASE )
    1.18 -        return;
    1.19 -
    1.20 -    spin_lock(&msix_fixmap_lock);
    1.21 -    clear_bit(idx - FIX_MSIX_IO_RESERV_BASE, &msix_fixmap_pages);
    1.22 -    spin_unlock(&msix_fixmap_lock);
    1.23 +    if ( idx >= FIX_MSIX_IO_RESERV_BASE )
    1.24 +        clear_bit(idx - FIX_MSIX_IO_RESERV_BASE, &msix_fixmap_pages);
    1.25  }
    1.26  
    1.27  /*
    1.28 @@ -78,19 +73,19 @@ static void msi_compose_msg(struct pci_d
    1.29          msg->address_lo =
    1.30              MSI_ADDR_BASE_LO |
    1.31              ((INT_DEST_MODE == 0) ?
    1.32 -                MSI_ADDR_DESTMODE_PHYS:
    1.33 -                MSI_ADDR_DESTMODE_LOGIC) |
    1.34 +             MSI_ADDR_DESTMODE_PHYS:
    1.35 +             MSI_ADDR_DESTMODE_LOGIC) |
    1.36              ((INT_DELIVERY_MODE != dest_LowestPrio) ?
    1.37 -                MSI_ADDR_REDIRECTION_CPU:
    1.38 -                MSI_ADDR_REDIRECTION_LOWPRI) |
    1.39 +             MSI_ADDR_REDIRECTION_CPU:
    1.40 +             MSI_ADDR_REDIRECTION_LOWPRI) |
    1.41              MSI_ADDR_DEST_ID(dest);
    1.42  
    1.43          msg->data =
    1.44              MSI_DATA_TRIGGER_EDGE |
    1.45              MSI_DATA_LEVEL_ASSERT |
    1.46              ((INT_DELIVERY_MODE != dest_LowestPrio) ?
    1.47 -                MSI_DATA_DELIVERY_FIXED:
    1.48 -                MSI_DATA_DELIVERY_LOWPRI) |
    1.49 +             MSI_DATA_DELIVERY_FIXED:
    1.50 +             MSI_DATA_DELIVERY_LOWPRI) |
    1.51              MSI_DATA_VECTOR(vector);
    1.52      }
    1.53  }
    1.54 @@ -128,7 +123,7 @@ static void read_msi_msg(struct msi_desc
    1.55      {
    1.56          void __iomem *base;
    1.57          base = entry->mask_base +
    1.58 -	    entry->msi_attrib.entry_nr * PCI_MSIX_ENTRY_SIZE;
    1.59 +            entry->msi_attrib.entry_nr * PCI_MSIX_ENTRY_SIZE;
    1.60  
    1.61          msg->address_lo = readl(base + PCI_MSIX_ENTRY_LOWER_ADDR_OFFSET);
    1.62          msg->address_hi = readl(base + PCI_MSIX_ENTRY_UPPER_ADDR_OFFSET);
    1.63 @@ -205,9 +200,9 @@ static void write_msi_msg(struct msi_des
    1.64              entry->msi_attrib.entry_nr * PCI_MSIX_ENTRY_SIZE;
    1.65  
    1.66          writel(msg->address_lo,
    1.67 -            base + PCI_MSIX_ENTRY_LOWER_ADDR_OFFSET);
    1.68 +               base + PCI_MSIX_ENTRY_LOWER_ADDR_OFFSET);
    1.69          writel(msg->address_hi,
    1.70 -            base + PCI_MSIX_ENTRY_UPPER_ADDR_OFFSET);
    1.71 +               base + PCI_MSIX_ENTRY_UPPER_ADDR_OFFSET);
    1.72          writel(msg->data, base + PCI_MSIX_ENTRY_DATA_OFFSET);
    1.73          break;
    1.74      }
    1.75 @@ -230,7 +225,7 @@ void set_msi_irq_affinity(unsigned int i
    1.76      dest = cpu_mask_to_apicid(mask);
    1.77  
    1.78      if ( !desc )
    1.79 -	return;
    1.80 +        return;
    1.81  
    1.82      ASSERT(spin_is_locked(&irq_desc[irq].lock));
    1.83      spin_lock(&desc->dev->lock);
    1.84 @@ -398,8 +393,8 @@ static void msi_free_vector(int vector)
    1.85          unsigned long start;
    1.86  
    1.87          writel(1, entry->mask_base + entry->msi_attrib.entry_nr
    1.88 -              * PCI_MSIX_ENTRY_SIZE
    1.89 -              + PCI_MSIX_ENTRY_VECTOR_CTRL_OFFSET);
    1.90 +               * PCI_MSIX_ENTRY_SIZE
    1.91 +               + PCI_MSIX_ENTRY_VECTOR_CTRL_OFFSET);
    1.92  
    1.93          start = (unsigned long)entry->mask_base & ~(PAGE_SIZE - 1);
    1.94          msix_fixmap_free(virt_to_fix(start));
    1.95 @@ -460,20 +455,20 @@ static int msi_capability_init(struct pc
    1.96      entry->vector = vector;
    1.97      if ( is_mask_bit_support(control) )
    1.98          entry->mask_base = (void __iomem *)(long)msi_mask_bits_reg(pos,
    1.99 -                is_64bit_address(control));
   1.100 +                                                                   is_64bit_address(control));
   1.101      entry->dev = dev;
   1.102      if ( entry->msi_attrib.maskbit )
   1.103      {
   1.104          unsigned int maskbits, temp;
   1.105          /* All MSIs are unmasked by default, Mask them all */
   1.106          maskbits = pci_conf_read32(bus, slot, func,
   1.107 -                       msi_mask_bits_reg(pos, is_64bit_address(control)));
   1.108 +                                   msi_mask_bits_reg(pos, is_64bit_address(control)));
   1.109          temp = (1 << multi_msi_capable(control));
   1.110          temp = ((temp - 1) & ~temp);
   1.111          maskbits |= temp;
   1.112          pci_conf_write32(bus, slot, func,
   1.113 -            msi_mask_bits_reg(pos, is_64bit_address(control)),
   1.114 -            maskbits);
   1.115 +                         msi_mask_bits_reg(pos, is_64bit_address(control)),
   1.116 +                         maskbits);
   1.117      }
   1.118      list_add_tail(&entry->list, &dev->msi_list);
   1.119  
   1.120 @@ -575,14 +570,14 @@ static int __pci_enable_msi(struct msi_i
   1.121  
   1.122      pdev = pci_lock_pdev(msi->bus, msi->devfn);
   1.123      if ( !pdev )
   1.124 -	return -ENODEV;
   1.125 +        return -ENODEV;
   1.126  
   1.127      if ( find_msi_entry(pdev, msi->vector, PCI_CAP_ID_MSI) )
   1.128      {
   1.129 -	spin_unlock(&pdev->lock);
   1.130 +        spin_unlock(&pdev->lock);
   1.131          dprintk(XENLOG_WARNING, "vector %d has already mapped to MSI on "
   1.132 -            "device %02x:%02x.%01x.\n", msi->vector, msi->bus,
   1.133 -            PCI_SLOT(msi->devfn), PCI_FUNC(msi->devfn));
   1.134 +                "device %02x:%02x.%01x.\n", msi->vector, msi->bus,
   1.135 +                PCI_SLOT(msi->devfn), PCI_FUNC(msi->devfn));
   1.136          return 0;
   1.137      }
   1.138  
   1.139 @@ -601,7 +596,7 @@ static void __pci_disable_msi(int vector
   1.140  
   1.141      entry = irq_desc[vector].msi_desc;
   1.142      if ( !entry )
   1.143 -	return;
   1.144 +        return;
   1.145      /*
   1.146       * Lock here is safe.  msi_desc can not be removed without holding
   1.147       * both irq_desc[].lock (which we do) and pdev->lock.
   1.148 @@ -649,20 +644,20 @@ static int __pci_enable_msix(struct msi_
   1.149  
   1.150      pdev = pci_lock_pdev(msi->bus, msi->devfn);
   1.151      if ( !pdev )
   1.152 -	return -ENODEV;
   1.153 +        return -ENODEV;
   1.154  
   1.155      pos = pci_find_cap_offset(msi->bus, slot, func, PCI_CAP_ID_MSIX);
   1.156      control = pci_conf_read16(msi->bus, slot, func, msi_control_reg(pos));
   1.157      nr_entries = multi_msix_capable(control);
   1.158      if (msi->entry_nr > nr_entries)
   1.159      {
   1.160 -	spin_unlock(&pdev->lock);
   1.161 +        spin_unlock(&pdev->lock);
   1.162          return -EINVAL;
   1.163      }
   1.164  
   1.165      if ( find_msi_entry(pdev, msi->vector, PCI_CAP_ID_MSIX) )
   1.166      {
   1.167 -	spin_unlock(&pdev->lock);
   1.168 +        spin_unlock(&pdev->lock);
   1.169          dprintk(XENLOG_WARNING, "vector %d has already mapped to MSIX on "
   1.170                  "device %02x:%02x.%01x.\n", msi->vector, msi->bus,
   1.171                  PCI_SLOT(msi->devfn), PCI_FUNC(msi->devfn));
   1.172 @@ -684,7 +679,7 @@ static void __pci_disable_msix(int vecto
   1.173  
   1.174      entry = irq_desc[vector].msi_desc;
   1.175      if ( !entry )
   1.176 -	return;
   1.177 +        return;
   1.178      /*
   1.179       * Lock here is safe.  msi_desc can not be removed without holding
   1.180       * both irq_desc[].lock (which we do) and pdev->lock.
   1.181 @@ -712,7 +707,7 @@ int pci_enable_msi(struct msi_info *msi)
   1.182      ASSERT(spin_is_locked(&irq_desc[msi->vector].lock));
   1.183  
   1.184      return  msi->table_base ? __pci_enable_msix(msi) :
   1.185 -                              __pci_enable_msi(msi);
   1.186 +        __pci_enable_msi(msi);
   1.187  }
   1.188  
   1.189  void pci_disable_msi(int vector)
   1.190 @@ -720,7 +715,7 @@ void pci_disable_msi(int vector)
   1.191      irq_desc_t *desc = &irq_desc[vector];
   1.192      ASSERT(spin_is_locked(&desc->lock));
   1.193      if ( !desc->msi_desc )
   1.194 -	return;
   1.195 +        return;
   1.196  
   1.197      if ( desc->msi_desc->msi_attrib.type == PCI_CAP_ID_MSI )
   1.198          __pci_disable_msi(vector);
   1.199 @@ -734,7 +729,7 @@ static void msi_free_vectors(struct pci_
   1.200      irq_desc_t *desc;
   1.201      unsigned long flags;
   1.202  
   1.203 -retry:
   1.204 + retry:
   1.205      list_for_each_entry_safe( entry, tmp, &dev->msi_list, list )
   1.206      {
   1.207          desc = &irq_desc[entry->vector];
   1.208 @@ -742,7 +737,7 @@ retry:
   1.209          local_irq_save(flags);
   1.210          if ( !spin_trylock(&desc->lock) )
   1.211          {
   1.212 -             local_irq_restore(flags);
   1.213 +            local_irq_restore(flags);
   1.214              goto retry;
   1.215          }
   1.216