All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Durrant <paul.durrant@citrix.com>
To: <xen-devel@lists.xenproject.org>
Cc: Paul Durrant <paul.durrant@citrix.com>,
	Ian Jackson <ian.jackson@eu.citrix.com>
Subject: [Xen-devel] [PATCH v13 3/4] tools/ocaml: abi check: Cope with consecutive relevant enums
Date: Wed, 18 Sep 2019 11:41:12 +0100	[thread overview]
Message-ID: <20190918104113.3294-4-paul.durrant@citrix.com> (raw)
In-Reply-To: <20190918104113.3294-1-paul.durrant@citrix.com>

From: Ian Jackson <ian.jackson@eu.citrix.com>

If the end of one enum is the `type' line for the next enum, we would
not notice it.

Fix this by reordering the code, and getting rid of the else: now if
the "we are within an enum" branch decides that it's the end of the
enum, it unsets $ei and we then immediately process the line as a "not
within an enum" line - ie as the start of the next one.

Reported-by: Paul Durrant <paul.durrant@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>

v13:
 - New in this version
---
 tools/ocaml/libs/xc/abi-check | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/tools/ocaml/libs/xc/abi-check b/tools/ocaml/libs/xc/abi-check
index d532f37271..3cbdec582f 100755
--- a/tools/ocaml/libs/xc/abi-check
+++ b/tools/ocaml/libs/xc/abi-check
@@ -70,14 +70,7 @@ my $cval;
 $ei = undef;
 my $bitnum = 0;
 while (<OCAML_FILE>) {
-    if (!$ei) {
-        if (m{^type \s+ (\w+) \s* \= \s* $}x && $enums{$1}) {
-            print "// found ocaml type $1 at $o:$.\n" or die $!;
-            $ei = $enums{$1};
-            $cval = '';
-            $bitnum = 0;
-        }
-    } else {
+    if ($ei) {
         if (m{^\s+ \| \s* $ei->{OPrefix} (\w+) \s*$}x) {
             $cval = $1;
             if ($ei->{Mangle} eq 'lc') {
@@ -104,6 +97,14 @@ while (<OCAML_FILE>) {
             die "$_ ?";
         }
     }
+    if (!$ei) {
+        if (m{^type \s+ (\w+) \s* \= \s* $}x && $enums{$1}) {
+            print "// found ocaml type $1 at $o:$.\n" or die $!;
+            $ei = $enums{$1};
+            $cval = '';
+            $bitnum = 0;
+        }
+    }
 }
 
 foreach $ei (values %enums) {
-- 
2.20.1.2.gb21ebb671


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

  parent reply	other threads:[~2019-09-18 10:41 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-18 10:41 [Xen-devel] [PATCH v13 0/4] add per-domain IOMMU control Paul Durrant
2019-09-18 10:41 ` [Xen-devel] [PATCH v13 1/4] remove late (on-demand) construction of IOMMU page tables Paul Durrant
2019-09-25  9:00   ` Paul Durrant
2019-09-25  9:16   ` Wei Liu
2019-09-18 10:41 ` [Xen-devel] [PATCH v13 2/4] iommu: tidy up iommu_use_hap_pt() and need_iommu_pt_sync() macros Paul Durrant
2019-09-18 10:41 ` Paul Durrant [this message]
2019-09-18 10:41 ` [Xen-devel] [PATCH v13 4/4] introduce a 'passthrough' configuration option to xl.cfg Paul Durrant
2019-09-18 15:20   ` Anthony PERARD
2019-09-25  8:40 ` [Xen-devel] [PATCH v13 0/4] add per-domain IOMMU control Paul Durrant
2019-09-25  8:50   ` Jan Beulich
2019-09-25  8:56     ` Paul Durrant
2019-09-25 15:49       ` Oleksandr
2019-09-25 15:55         ` Paul Durrant
2019-09-25 16:03         ` Paul Durrant
2019-09-25 16:04           ` Paul Durrant
2019-09-25 16:14           ` Oleksandr
2019-09-25 16:10         ` Paul Durrant
2019-09-25 16:24           ` Oleksandr
2019-09-25 18:07             ` Oleksandr
2019-09-26  8:32               ` Paul Durrant
2019-09-25 21:34           ` Julien Grall
2019-09-26  8:39             ` Paul Durrant
2019-09-26  9:13               ` Julien Grall
2019-09-26  9:17                 ` Paul Durrant
2019-09-26  9:26                   ` Julien Grall
2019-09-26  9:22               ` Oleksandr

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190918104113.3294-4-paul.durrant@citrix.com \
    --to=paul.durrant@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.