Skip to contentSkip to conversation

x86/altp2m: Fix style errors introduced with c/s 9abcac7ff

PATCH In review Andrew Cooper 3 participants 5 messages May 29, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/altp2m: Fix style errors introduced with c/s 9abcac7ff

Drop introduced trailing whitespace, excessively long lines, mal-indention, superfluous use of PRI macros for int-or-smaller types, and incorrect PRI macros for gfns and mfns.

---
CC: George Dunlap <[email protected]>
CC: Tamas K Lengyel <[email protected]>
CC: Jan Beulich <[email protected]>
CC: Wei Liu <[email protected]>
CC: Roger Pau Monné <[email protected]>

---
 xen/arch/x86/hvm/hvm.c | 5 +++--
 xen/arch/x86/mm/p2m.c  | 8 ++++----
 2 files changed, 7 insertions(+), 6 deletions(-)
xen/arch/x86/hvm/hvm.c +3 -2
index 0e33e04..a44944b 100644
@@ -1765,12 +1765,13 @@ int hvm_hap_nested_page_fault(paddr_t gpa, unsigned long gla,
     {
         p2m = p2m_get_altp2m(curr);
 
-        /* 
+        /*
          * Get the altp2m entry if present; or if not, propagate from
          * the host p2m.  NB that this returns with gfn locked in the
          * altp2m.
          */
-        if ( p2m_altp2m_get_or_propagate(p2m, gfn, &mfn, &p2mt, &p2ma, page_order) )
+        if ( p2m_altp2m_get_or_propagate(p2m, gfn, &mfn, &p2mt,
+                                         &p2ma, page_order) )
         {
             /* Entry was copied from host -- retry fault */
             rc = 1;
xen/arch/x86/mm/p2m.c +4 -4
index 0ea8941..4c99548 100644
@@ -2440,7 +2440,7 @@ bool p2m_altp2m_get_or_propagate(struct p2m_domain *ap2m, unsigned long gfn_l,
      * gfns below.
      */
     p2m_lock(ap2m);
-    
+
     amfn = get_gfn_type_access(ap2m, gfn_l, &ap2mt, &ap2ma, 0, NULL);
 
     if ( !mfn_eq(amfn, INVALID_MFN) )
@@ -2474,11 +2474,11 @@ bool p2m_altp2m_get_or_propagate(struct p2m_domain *ap2m, unsigned long gfn_l,
     if ( rc )
     {
         gprintk(XENLOG_ERR,
-        "failed to set entry for %#"PRIx64" -> %#"PRIx64" altp2m %#"PRIx16". rc: %"PRIi32"\n",
-        gfn_l, mfn_x(amfn), vcpu_altp2m(current).p2midx, rc);
+                "failed to set entry for %"PRI_gfn" -> %"PRI_mfn" altp2m %u, rc %d\n",
+                gfn_l, mfn_x(amfn), vcpu_altp2m(current).p2midx, rc);
         domain_crash(ap2m->domain);
     }
-    
+
     return true;
 }
 
Signature · 7 lines
2.1.4


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#1 lore raw
Quoted 11 lines · Andrew Cooper

Drop introduced trailing whitespace, excessively long lines, mal-indention, superfluous use of PRI macros for int-or-smaller types, and incorrect PRI macros for gfns and mfns.

---
CC: George Dunlap <[email protected]>
CC: Tamas K Lengyel <[email protected]>
CC: Jan Beulich <[email protected]>
CC: Wei Liu <[email protected]>
CC: Roger Pau Monné <[email protected]>

And can I take this opportunity to remind all committers that git diff --check exists and to please make sure it is used as part of pre-push checks.

When used against c.s 9abcac7ff, it identifies:

andrew@andrew-laptop:~/xen.git/xen$ git diff --check 9abcac7ff^
xen/arch/x86/hvm/hvm.c:1768: trailing whitespace.
+        /*
xen/arch/x86/mm/p2m.c:2443: trailing whitespace.
+   
xen/arch/x86/mm/p2m.c:2481: trailing whitespace.
+   
andrew@andrew-laptop:~/xen.git/xen$ echo $?
2

(and also spots the introduction of conflict markers, although there appear to be no incidents of this mistake in Xen's history.)

~Andrew

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

#2 lore raw
Quoted 14 lines
Quoted 1 line
Quoted 1 line · On 29.05.19 at 06:43, <[email protected]> wrote:
Quoted 11 lines · Andrew Cooper

Drop introduced trailing whitespace, excessively long lines, mal-indention, superfluous use of PRI macros for int-or-smaller types, and incorrect PRI macros for gfns and mfns.

---
CC: George Dunlap <[email protected]>
CC: Tamas K Lengyel <[email protected]>
CC: Jan Beulich <[email protected]>
CC: Wei Liu <[email protected]>
CC: Roger Pau Monné <[email protected]>

Quoted 3 lines

And can I take this opportunity to remind all committers that git diff --check exists and to please make sure it is used as part of pre-push checks.

I don't think committers should do any checking. This should be part of the review process (and even better be part of the submitter's actions before sending out a patch). Committing should be a mechanical act. Many of us doing build checks already goes beyond what should really be required.

That said I've nevertheless added it to my script, but I'll drop it again if the necessary cleaning up turns out to be too time consuming.

Jan

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

Reviewed-by on v1 1/1
#3 lore raw
In reply to Andrew Cooper
Quoted 6 lines
Quoted 1 line
Quoted 1 line · On 29.05.19 at 06:23, <[email protected]> wrote:

Drop introduced trailing whitespace, excessively long lines, mal-indention, superfluous use of PRI macros for int-or-smaller types, and incorrect PRI macros for gfns and mfns.

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

Acked-by on v1 1/1
#4 lore raw
In reply to Andrew Cooper
Quoted 5 lines · Andrew Cooper

Drop introduced trailing whitespace, excessively long lines, mal-indention, superfluous use of PRI macros for int-or-smaller types, and incorrect PRI macros for gfns and mfns.

Sorry about that.

-George

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