diff mbox

xen: Replace ASSERT(0) with ASSERT_UNREACHABLE()

Message ID 1498048845-315-1-git-send-email-andrew.cooper3@citrix.com (mailing list archive)
State New, archived
Headers show

Commit Message

Andrew Cooper June 21, 2017, 12:40 p.m. UTC
No functional change, but the result is more informative both in the code and
error messages if the assertions do get hit.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
CC: Stefano Stabellini <sstabellini@kernel.org>
CC: Julien Grall <julien.grall@arm.com>
---
 xen/arch/arm/mm.c                        | 4 ++--
 xen/common/tmem_xen.c                    | 4 ++--
 xen/drivers/passthrough/amd/iommu_acpi.c | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

Comments

Jan Beulich June 21, 2017, 12:45 p.m. UTC | #1
>>> On 21.06.17 at 14:40, <andrew.cooper3@citrix.com> wrote:
> No functional change, but the result is more informative both in the code and
> error messages if the assertions do get hit.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Reviewed-by: Jan Beulich <jbeulich@suse.com>
Julien Grall June 21, 2017, 1:07 p.m. UTC | #2
Hi Andrew,

On 21/06/17 13:40, Andrew Cooper wrote:
> No functional change, but the result is more informative both in the code and
> error messages if the assertions do get hit.
>
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

For ARM bits:

Reviewed-by: Julien Grall <julien.gralL@arm.com>

Cheers,
Konrad Rzeszutek Wilk June 23, 2017, 2:52 a.m. UTC | #3
On Wed, Jun 21, 2017 at 01:40:45PM +0100, Andrew Cooper wrote:
> No functional change, but the result is more informative both in the code and
> error messages if the assertions do get hit.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> ---
> CC: Jan Beulich <JBeulich@suse.com>
> CC: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
diff mbox

Patch

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index 341bacf..5475557 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -1154,7 +1154,7 @@  void arch_dump_shared_mem_info(void)
 
 int donate_page(struct domain *d, struct page_info *page, unsigned int memflags)
 {
-    ASSERT(0);
+    ASSERT_UNREACHABLE();
     return -ENOSYS;
 }
 
@@ -1166,7 +1166,7 @@  int steal_page(
 
 int page_is_ram_type(unsigned long mfn, unsigned long mem_type)
 {
-    ASSERT(0);
+    ASSERT_UNREACHABLE();
     return 0;
 }
 
diff --git a/xen/common/tmem_xen.c b/xen/common/tmem_xen.c
index 06ce3ef..725ae93 100644
--- a/xen/common/tmem_xen.c
+++ b/xen/common/tmem_xen.c
@@ -34,14 +34,14 @@  static DEFINE_PER_CPU_READ_MOSTLY(void *, scratch_page);
 static inline void *cli_get_page(xen_pfn_t cmfn, unsigned long *pcli_mfn,
                                  struct page_info **pcli_pfp, bool_t cli_write)
 {
-    ASSERT(0);
+    ASSERT_UNREACHABLE();
     return NULL;
 }
 
 static inline void cli_put_page(void *cli_va, struct page_info *cli_pfp,
                                 unsigned long cli_mfn, bool_t mark_dirty)
 {
-    ASSERT(0);
+    ASSERT_UNREACHABLE();
 }
 #else
 #include <asm/p2m.h>
diff --git a/xen/drivers/passthrough/amd/iommu_acpi.c b/xen/drivers/passthrough/amd/iommu_acpi.c
index d8a9205..f4c7206 100644
--- a/xen/drivers/passthrough/amd/iommu_acpi.c
+++ b/xen/drivers/passthrough/amd/iommu_acpi.c
@@ -818,7 +818,7 @@  static u16 __init parse_ivhd_device_special(
             hpet_sbdf.init = HPET_IVHD;
             break;
         default:
-            ASSERT(0);
+            ASSERT_UNREACHABLE();
             break;
         }
         break;