The function was introduced without any caller, and never gained any.
Thus it has always been violating Misra rule 2.1 (unreachable code).

Fixes: dd6de3ab9985 ("Implement Nested-on-Nested")
Signed-off-by: Jan Beulich <jbeul...@suse.com>

--- a/xen/arch/x86/include/asm/paging.h
+++ b/xen/arch/x86/include/asm/paging.h
@@ -225,7 +225,6 @@ int paging_enable(struct domain *d, u32
 
 #define paging_get_hostmode(v)         ((v)->arch.paging.mode)
 #define paging_get_nestedmode(v)       ((v)->arch.paging.nestedmode)
-const struct paging_mode *paging_get_mode(struct vcpu *v);
 void paging_update_nestedmode(struct vcpu *v);
 
 /* Page fault handler
--- unstable.orig/xen/arch/x86/mm/paging.c      2025-08-05 08:59:15.512131147 
+0200
+++ unstable/xen/arch/x86/mm/paging.c   2025-08-05 09:00:24.160657794 +0200
@@ -946,14 +946,6 @@ void paging_dump_vcpu_info(struct vcpu *
     }
 }
 
-const struct paging_mode *paging_get_mode(struct vcpu *v)
-{
-    if (!nestedhvm_is_n2(v))
-        return paging_get_hostmode(v);
-
-    return paging_get_nestedmode(v);
-}
-
 #ifdef CONFIG_HVM
 void paging_update_nestedmode(struct vcpu *v)
 {


Reply via email to