Skip to contentSkip to conversation

x86/p2m: constify p2m_mem_access_sanity_check()

PATCH Superseded Razvan Cojocaru 3 participants 5 messages Nov 21, 2018

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/p2m: constify p2m_mem_access_sanity_check()

---
 xen/arch/x86/mm/mem_access.c     | 2 +-
 xen/include/asm-x86/mem_access.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
xen/arch/x86/mm/mem_access.c +1 -1
index 30c2f1a..56c06a4 100644
@@ -541,7 +541,7 @@ void arch_p2m_set_access_required(struct domain *d, bool access_required)
 #endif
 }
 
-bool p2m_mem_access_sanity_check(struct domain *d)
+bool p2m_mem_access_sanity_check(const struct domain *d)
 {
     return is_hvm_domain(d) && cpu_has_vmx && hap_enabled(d);
 }
xen/include/asm-x86/mem_access.h +1 -1
index c815db8..99817a3 100644
@@ -44,7 +44,7 @@ bool p2m_mem_access_emulate_check(struct vcpu *v,
                                   const vm_event_response_t *rsp);
 
 /* Sanity check for mem_access hardware support */
-bool p2m_mem_access_sanity_check(struct domain *d);
+bool p2m_mem_access_sanity_check(const struct domain *d);
 
 #endif /*__ASM_X86_MEM_ACCESS_H__ */
 
Signature · 7 lines
2.7.4


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#3 lore raw
Quoted 8 lines · Jan Beulich
Quoted 5 lines
Quoted 1 line
Quoted 1 line · On 21.11.18 at 12:03, <[email protected]> wrote:
Quoted 1 line · Razvan Cojocaru

Why?

Are you asking in general (I think it's obvious), or merely because the commit description is empty?

I didn't see that you had suggested it as a trivial improvement.

I agree it's a minor improvement, but normally such improvements don't come in out of the blue: they're done in order to achieve some goal (for example, to allow this function to be called from another function that only has a const pointer). Recording the motivation is important; I'd argue that recording the lack of motivation is important as well (so that people don't go looking for one that isn't there).

-George

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#4 lore raw
Quoted 10 lines · George Dunlap
Quoted 8 lines · Jan Beulich
Quoted 5 lines
Quoted 1 line
Quoted 1 line · On 21.11.18 at 12:03, <[email protected]> wrote:
Quoted 1 line · Razvan Cojocaru

Why?

Are you asking in general (I think it's obvious), or merely because the commit description is empty?

Quoted 8 lines

I didn't see that you had suggested it as a trivial improvement.

I agree it's a minor improvement, but normally such improvements don't come in out of the blue: they're done in order to achieve some goal (for example, to allow this function to be called from another function that only has a const pointer). Recording the motivation is important; I'd argue that recording the lack of motivation is important as well (so that people don't go looking for one that isn't there).

I'll resend the patch with a small description.
Also, I should have added a Suggested-by tag that would have clearly helped in this case, my mistake.

Thanks,
Razvan

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel