All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wei Liu <wei.liu2@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Wei Liu <wei.liu2@citrix.com>, Jan Beulich <JBeulich@suse.com>
Subject: [PATCH 17/18] x86/msi.c: use plain bool
Date: Fri, 30 Jun 2017 18:01:25 +0100	[thread overview]
Message-ID: <20170630170126.4148-18-wei.liu2@citrix.com> (raw)
In-Reply-To: <20170630170126.4148-1-wei.liu2@citrix.com>

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
---
 xen/arch/x86/msi.c        | 32 ++++++++++++++++----------------
 xen/include/asm-x86/msi.h |  6 +++---
 2 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/xen/arch/x86/msi.c b/xen/arch/x86/msi.c
index d98f400699..77998f4fb3 100644
--- a/xen/arch/x86/msi.c
+++ b/xen/arch/x86/msi.c
@@ -121,7 +121,7 @@ static void msix_put_fixmap(struct arch_msix *msix, int idx)
     spin_unlock(&msix->table_lock);
 }
 
-static bool_t memory_decoded(const struct pci_dev *dev)
+static bool memory_decoded(const struct pci_dev *dev)
 {
     u8 bus, slot, func;
 
@@ -142,13 +142,13 @@ static bool_t memory_decoded(const struct pci_dev *dev)
               PCI_COMMAND_MEMORY);
 }
 
-static bool_t msix_memory_decoded(const struct pci_dev *dev, unsigned int pos)
+static bool msix_memory_decoded(const struct pci_dev *dev, unsigned int pos)
 {
     u16 control = pci_conf_read16(dev->seg, dev->bus, PCI_SLOT(dev->devfn),
                                   PCI_FUNC(dev->devfn), msix_control_reg(pos));
 
     if ( !(control & PCI_MSIX_FLAGS_ENABLE) )
-        return 0;
+        return false;
 
     return memory_decoded(dev);
 }
@@ -191,7 +191,7 @@ void msi_compose_msg(unsigned vector, const cpumask_t *cpu_mask, struct msi_msg
                 MSI_DATA_VECTOR(vector);
 }
 
-static bool_t read_msi_msg(struct msi_desc *entry, struct msi_msg *msg)
+static bool read_msi_msg(struct msi_desc *entry, struct msi_msg *msg)
 {
     switch ( entry->msi_attrib.type )
     {
@@ -228,7 +228,7 @@ static bool_t read_msi_msg(struct msi_desc *entry, struct msi_msg *msg)
 
         if ( unlikely(!msix_memory_decoded(entry->dev,
                                            entry->msi_attrib.pos)) )
-            return 0;
+            return false;
         msg->address_lo = readl(base + PCI_MSIX_ENTRY_LOWER_ADDR_OFFSET);
         msg->address_hi = readl(base + PCI_MSIX_ENTRY_UPPER_ADDR_OFFSET);
         msg->data = readl(base + PCI_MSIX_ENTRY_DATA_OFFSET);
@@ -241,7 +241,7 @@ static bool_t read_msi_msg(struct msi_desc *entry, struct msi_msg *msg)
     if ( iommu_intremap )
         iommu_read_msi_from_ire(entry, msg);
 
-    return 1;
+    return true;
 }
 
 static int write_msi_msg(struct msi_desc *entry, struct msi_msg *msg)
@@ -383,13 +383,13 @@ int msi_maskable_irq(const struct msi_desc *entry)
            || entry->msi_attrib.maskbit;
 }
 
-static bool_t msi_set_mask_bit(struct irq_desc *desc, bool_t host, bool_t guest)
+static bool msi_set_mask_bit(struct irq_desc *desc, bool host, bool guest)
 {
     struct msi_desc *entry = desc->msi_desc;
     struct pci_dev *pdev;
     u16 seg, control;
     u8 bus, slot, func;
-    bool_t flag = host || guest, maskall;
+    bool flag = host || guest, maskall;
 
     ASSERT(spin_is_locked(&desc->lock));
     BUG_ON(!entry || !entry->dev);
@@ -434,13 +434,13 @@ static bool_t msi_set_mask_bit(struct irq_desc *desc, bool_t host, bool_t guest)
             entry->msi_attrib.host_masked = host;
             entry->msi_attrib.guest_masked = guest;
 
-            flag = 1;
+            flag = true;
         }
         else if ( flag && !(control & PCI_MSIX_FLAGS_MASKALL) )
         {
             domid_t domid = pdev->domain->domain_id;
 
-            maskall = 1;
+            maskall = true;
             if ( pdev->msix->warned != domid )
             {
                 pdev->msix->warned = domid;
@@ -503,7 +503,7 @@ void unmask_msi_irq(struct irq_desc *desc)
         WARN();
 }
 
-void guest_mask_msi_irq(struct irq_desc *desc, bool_t mask)
+void guest_mask_msi_irq(struct irq_desc *desc, bool mask)
 {
     msi_set_mask_bit(desc, desc->msi_desc->msi_attrib.host_masked, mask);
 }
@@ -850,7 +850,7 @@ static int msix_capability_init(struct pci_dev *dev,
     u8 bus = dev->bus;
     u8 slot = PCI_SLOT(dev->devfn);
     u8 func = PCI_FUNC(dev->devfn);
-    bool_t maskall = msix->host_maskall;
+    bool maskall = msix->host_maskall;
 
     ASSERT(pcidevs_locked());
 
@@ -984,7 +984,7 @@ static int msix_capability_init(struct pci_dev *dev,
 
     if ( !msix->used_entries )
     {
-        maskall = 0;
+        maskall = false;
         if ( !msix->guest_maskall )
             control &= ~PCI_MSIX_FLAGS_MASKALL;
         else
@@ -1161,7 +1161,7 @@ static void __pci_disable_msix(struct msi_desc *entry)
                                            PCI_CAP_ID_MSIX);
     u16 control = pci_conf_read16(seg, bus, slot, func,
                                   msix_control_reg(entry->msi_attrib.pos));
-    bool_t maskall = dev->msix->host_maskall;
+    bool maskall = dev->msix->host_maskall;
 
     if ( unlikely(!(control & PCI_MSIX_FLAGS_ENABLE)) )
     {
@@ -1181,7 +1181,7 @@ static void __pci_disable_msix(struct msi_desc *entry)
                "cannot disable IRQ %d: masking MSI-X on %04x:%02x:%02x.%u\n",
                entry->irq, dev->seg, dev->bus,
                PCI_SLOT(dev->devfn), PCI_FUNC(dev->devfn));
-        maskall = 1;
+        maskall = true;
     }
     dev->msix->host_maskall = maskall;
     if ( maskall || dev->msix->guest_maskall )
@@ -1191,7 +1191,7 @@ static void __pci_disable_msix(struct msi_desc *entry)
     _pci_cleanup_msix(dev->msix);
 }
 
-int pci_prepare_msix(u16 seg, u8 bus, u8 devfn, bool_t off)
+int pci_prepare_msix(u16 seg, u8 bus, u8 devfn, bool off)
 {
     int rc;
     struct pci_dev *pdev;
diff --git a/xen/include/asm-x86/msi.h b/xen/include/asm-x86/msi.h
index 213ee53f72..37d37b820e 100644
--- a/xen/include/asm-x86/msi.h
+++ b/xen/include/asm-x86/msi.h
@@ -83,7 +83,7 @@ struct msi_desc;
 /* Helper functions */
 extern int pci_enable_msi(struct msi_info *msi, struct msi_desc **desc);
 extern void pci_disable_msi(struct msi_desc *desc);
-extern int pci_prepare_msix(u16 seg, u8 bus, u8 devfn, bool_t off);
+extern int pci_prepare_msix(u16 seg, u8 bus, u8 devfn, bool off);
 extern void pci_cleanup_msi(struct pci_dev *pdev);
 extern int setup_msi_irq(struct irq_desc *, struct msi_desc *);
 extern int __setup_msi_irq(struct irq_desc *, struct msi_desc *,
@@ -235,7 +235,7 @@ struct arch_msix {
     int table_refcnt[MAX_MSIX_TABLE_PAGES];
     int table_idx[MAX_MSIX_TABLE_PAGES];
     spinlock_t table_lock;
-    bool_t host_maskall, guest_maskall;
+    bool host_maskall, guest_maskall;
     domid_t warned;
 };
 
@@ -245,7 +245,7 @@ void msi_compose_msg(unsigned vector, const cpumask_t *mask,
 void __msi_set_enable(u16 seg, u8 bus, u8 slot, u8 func, int pos, int enable);
 void mask_msi_irq(struct irq_desc *);
 void unmask_msi_irq(struct irq_desc *);
-void guest_mask_msi_irq(struct irq_desc *, bool_t mask);
+void guest_mask_msi_irq(struct irq_desc *, bool mask);
 void ack_nonmaskable_msi_irq(struct irq_desc *);
 void end_nonmaskable_msi_irq(struct irq_desc *, u8 vector);
 void set_msi_affinity(struct irq_desc *, const cpumask_t *);
-- 
2.11.0


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

  parent reply	other threads:[~2017-06-30 17:16 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-30 17:01 [PATCH 00/18] x86: more bool_t to bool cleanup Wei Liu
2017-06-30 17:01 ` [PATCH 01/18] x86/acpi: use plain bool Wei Liu
2017-06-30 17:01 ` [PATCH 02/18] x86/apic.c: " Wei Liu
2017-06-30 17:26   ` Andrew Cooper
2017-06-30 17:01 ` [PATCH 03/18] x86/debug.c: " Wei Liu
2017-06-30 17:28   ` Andrew Cooper
2017-06-30 17:01 ` [PATCH 04/18] x86/dmi.c: " Wei Liu
2017-06-30 17:01 ` [PATCH 05/18] x86/domctl: " Wei Liu
2017-06-30 17:01 ` [PATCH 06/18] x86/hpet.c: " Wei Liu
2017-06-30 17:01 ` [PATCH 07/18] x86/e820.c: use plan bool Wei Liu
2017-06-30 17:01 ` [PATCH 08/18] x86/i387.c: use plain bool Wei Liu
2017-06-30 17:01 ` [PATCH 09/18] x86/i8259.c: " Wei Liu
2017-06-30 17:01 ` [PATCH 10/18] x86/monitor.c: " Wei Liu
2017-06-30 17:45   ` Andrew Cooper
2017-06-30 18:30     ` Razvan Cojocaru
2017-06-30 17:01 ` [PATCH 11/18] x86/xstate.c: " Wei Liu
2017-06-30 17:01 ` [PATCH 12/18] x86/srat.c: " Wei Liu
2017-06-30 17:01 ` [PATCH 13/18] x86/smpboot.c: " Wei Liu
2017-06-30 17:01 ` [PATCH 14/18] x86/io_apic.c: " Wei Liu
2017-06-30 17:53   ` Andrew Cooper
2017-06-30 17:01 ` [PATCH 15/18] x86/mpparse.c: " Wei Liu
2017-06-30 17:54   ` Andrew Cooper
2017-06-30 17:01 ` [PATCH 16/18] x86/numa.c: " Wei Liu
2017-06-30 17:01 ` Wei Liu [this message]
2017-06-30 17:01 ` [PATCH 18/18] x86/psr.c: " Wei Liu
2017-06-30 18:00 ` [PATCH 00/18] x86: more bool_t to bool cleanup Andrew Cooper
2017-07-03  8:10 ` Jan Beulich
2017-07-03 12:54   ` Wei Liu
2017-07-03 13:19     ` Jan Beulich
2017-07-04 10:43       ` Wei Liu

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=20170630170126.4148-18-wei.liu2@citrix.com \
    --to=wei.liu2@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --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.