[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 4/8] xen/arm: Add support for read-only foreign mappings





On 11/15/18 11:33 AM, Andrii Anisov wrote:
Hello Julien,

Hi,


вт, 6 лист. 2018 о 21:16 Julien Grall <julien.grall@xxxxxxx> пише:
@@ -275,7 +280,38 @@ struct page_info *p2m_get_page_from_gfn(struct domain *d, 
gfn_t gfn,
  static inline struct page_info *get_page_from_gfn(
      struct domain *d, unsigned long gfn, p2m_type_t *t, p2m_query_t q)
  {
-    return p2m_get_page_from_gfn(d, _gfn(gfn), t);
+    mfn_t mfn;
+    p2m_type_t _t;

Me personally, do not like introducing intermediate `_t` variable.
IMO, constructs like following:

+    if ( !t )
+        t = &_t;
+
+    *t = p2m_invalid;

make the code harder to understand than simple checking `t` for nul
before assigning it a
value.

If I drop _t then I need to add if ( *t ) in 3 places in that code. So I don't think the approach is any better.

Feel free to suggest a solution that does not require to check 't' everywhere.

Cheers,

--
Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.