[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH v2 for 4.20? 2/3] xen/riscv: update defintion of vmap_to_mfn()
On 2/4/25 2:56 PM, Jan Beulich wrote:
On 03.02.2025 14:12, Oleksii Kurochko wrote:@@ -160,6 +158,18 @@ static inline struct page_info *virt_to_page(const void *v) pte_t * pt_walk(vaddr_t va, unsigned int *pte_level); +static inline mfn_t vmap_to_mfn_(vaddr_t va)Btw., for static functions (and variables) a prefixing underscore is fine to use. Its identifiers that don't have file scope which shouldn't. Should it be used a single underscore prefixing or a double one? +{ + pte_t *entry = pt_walk(va, NULL);Oh, noticing the anomaly only here: Why would pt_walk() return a pointer to a PTE, rather than the pte_t by value? All this does is encourage open-coded accesses (even writes), when especially writes are supposed to be going through pt_update(). I tried to play with forward declaration of pte_t to not introduce circular dependency in the previous patch. It would be really better to return pte_t by value, I will update that. Thanks. ~Oleksii
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |