All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Jackson <ian.jackson@eu.citrix.com>
To: <xen-devel@lists.xenproject.org>
Cc: Paul Durrant <paul.durrant@citrix.com>,
	Ian Jackson <ian.jackson@eu.citrix.com>,
	Christian Lindig <christian.lindig@citrix.com>,
	Wei Liu <wl@xen.org>, David Scott <dave@recoil.org>
Subject: [Xen-devel] [PATCH] tools/ocaml: abi check: Cope with consecutive relevant enums
Date: Fri, 13 Sep 2019 11:27:56 +0100	[thread overview]
Message-ID: <20190913102756.6613-1-ian.jackson@eu.citrix.com> (raw)
In-Reply-To: <20190913094741.31451-7-paul.durrant@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>
---
 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.11.0


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

      reply	other threads:[~2019-09-13 10:29 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-13  9:47 [Xen-devel] [PATCH v10 0/6] add per-domain IOMMU control Paul Durrant
2019-09-13  9:47 ` [Xen-devel] [PATCH v10 1/6] domain: introduce XEN_DOMCTL_CDF_iommu flag Paul Durrant
2019-09-13  9:47 ` [Xen-devel] [PATCH v10 2/6] use is_iommu_enabled() where appropriate Paul Durrant
2019-09-13  9:47 ` [Xen-devel] [PATCH v10 3/6] sysctl / libxl: report whether IOMMU/HAP page table sharing is supported Paul Durrant
2019-09-16  9:40   ` Wei Liu
2019-09-13  9:47 ` [Xen-devel] [PATCH v10 4/6] remove late (on-demand) construction of IOMMU page tables Paul Durrant
2019-09-13  9:47 ` [Xen-devel] [PATCH v10 5/6] iommu: tidy up iommu_use_hap_pt() and need_iommu_pt_sync() macros Paul Durrant
2019-09-13 10:04   ` Jan Beulich
2019-09-13 10:20     ` Paul Durrant
2019-09-13 10:33     ` Paul Durrant
2019-09-13  9:47 ` [Xen-devel] [PATCH v10 6/6] introduce a 'passthrough' configuration option to xl.cfg Paul Durrant
2019-09-13 10:27   ` Ian Jackson [this message]

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=20190913102756.6613-1-ian.jackson@eu.citrix.com \
    --to=ian.jackson@eu.citrix.com \
    --cc=christian.lindig@citrix.com \
    --cc=dave@recoil.org \
    --cc=paul.durrant@citrix.com \
    --cc=wl@xen.org \
    --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.