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

Re: [XEN PATCH v4 3/3] build: compat-xlat-header.py: optimisation to search for just '{' instead of [{}]


  • To: Anthony Perard <anthony.perard@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Andrew Cooper <Andrew.Cooper3@xxxxxxxxxx>
  • Date: Fri, 20 Jan 2023 18:26:14 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=+8PIQQTOGqRVI6KquiLcSlBrSlvtVdURhGAI0uKhxaI=; b=PIKOIcBcKrcu/DFmjZbZVNtUtUk1zI3cmjjpXjjC1XUDeIH8GZWVbD+F2kLUzo6cIgDmMDr1GJWUS3/Ar+wvBwuqxpLmsJqDcYc40nyGb97PKA+6rIg6qCakCwoImOLUMV2psVmVqPjcw1VXmNBEzXVECSbc5ZGlChfwDqjv+octLDsQSXgrJ3H6zxANrJg2SvfvywGKUTRaYTmABXd49lXuMnzVrUrwbou+F7JdLvLybGHOQQzXfoLKTZvP+FySefQPB260nTqr3YUtVUwPynEcx6tzQ2WVdcq/VCZgqmKnaPIPhJhcCf23s4kqCPs5Kswh7LM4led4i2mXsnx6Tw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bAsMHTWmiPiBjtCfmvUPDfrTZjacXWvQ5PUKKBJ5oST9bYiP65xe29/+DcJ1csHRINJfz/7Rzzjz5E0oADm0wLdyIicUIzvRMjlBF1dsZeTIsJVMzURkGsN/wgaFzr6ck+uofS1mAP5ADnkUkzNXWwX1ev42vRhKiqiloyqaGIaqLFVVvEcdwn5V0HaJiGtahhCYW+m1WE3xoYrR9/oEnpNqDx05HE5V735u6VdImf3siKJTMnH7DsevBmB2BPDpH0XycR8povX8cvq4HGu7SA0YfKX9PGva2wYeSBW7Pu1q8D59Pa9x4KmCoMlYEue1leP6x+uJMbGBESKgafE/Qw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: George Dunlap <George.Dunlap@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Fri, 20 Jan 2023 18:26:37 +0000
  • Ironport-data: A9a23:1WbXiKKelu1t1mBkFE+RG5QlxSXFcZb7ZxGr2PjKsXjdYENSgmcAx 2EXX2iEPa3famXwfIxyOoiw9h4PvMCDydYwGwdlqX01Q3x08seUXt7xwmUcnc+xBpaaEB84t ZV2hv3odp1coqr0/0/1WlTZhSAgk/rOHv+kUrWs1hlZHWdMUD0mhQ9oh9k3i4tphcnRKw6Ws Jb5rta31GWNglaYCUpJrfPcwP9TlK6q4mhA5wZmPasjUGL2zBH5MrpOfcldEFOgKmVkNrbSb /rOyri/4lTY838FYj9yuu+mGqGiaue60Tmm0hK6aYD76vRxjnVaPpIAHOgdcS9qZwChxLid/ jnvWauYEm/FNoWU8AgUvoIx/ytWZcWq85efSZSzXFD6I+QrvBIAzt03ZHzaM7H09c5nPEFSp KJfdgpQURO8hrPv7Y6UTMBj05FLwMnDZOvzu1lG5BSAVLMKZM6GRK/Ho9hFwD03m8ZCW+7EY NYUYiZuaxKGZABTPlAQC9Q1m+LAanvXKmUE7g7K4/dopTGMkWSd05C0WDbRUvWMSd9YgQCzo WXe8n6iKhobKMae2XyO9XfEaurnzHijAdhOSO3QGvhCowa5xkBOK1otDUKVqsfgqk2GSch0J BlBksYphe1onKCxdfHtUhv9rHOasxo0X9tLD/Z8+AyL0rDT4QuSGi4DVDEpQN4sudIyRDcq/ kSUhN6vDjtq2JWXVHac+7G8vT60fy8PIgcqfjQYRAEI593ipoAbjR/VSNtnVqmvgbXdBjXY0 z2M6i8kiN0uYdUj0qy6+RXLhmyqr52QFwotvFyIAySi8x9zY5Oja8qw81/H4P1cLYGfCF6co HwDnMvY5+cLZX2QqBGwrCw2NOnBz5643Pf02DaDw7FJG+yRxkOe
  • Ironport-hdrordr: A9a23:bfrV768QNtfgtckBziNuk+DWI+orL9Y04lQ7vn2ZKCY4TiX8ra uTdZsguiMc5Ax+ZJhDo7C90di7IE80nKQdieN9AV7IZniEhILHFvAG0aLShxHmBi3i5qp8+M 5bAsxD4QTLfDpHsfo=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHZLBn5GrvhRXVc4kihDJHcjkxEVa6noSaA
  • Thread-topic: [XEN PATCH v4 3/3] build: compat-xlat-header.py: optimisation to search for just '{' instead of [{}]

On 19/01/2023 3:22 pm, Anthony PERARD wrote:
> `fields` and `extrafields` always all the parts of a sub-struct, so
> when there is '}', there is always a '{' before it. Also, both are
> lists.
>
> Signed-off-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>
> ---
>  xen/tools/compat-xlat-header.py | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/xen/tools/compat-xlat-header.py b/xen/tools/compat-xlat-header.py
> index ae5c9f11c9..d0a864b68e 100644
> --- a/xen/tools/compat-xlat-header.py
> +++ b/xen/tools/compat-xlat-header.py
> @@ -105,7 +105,7 @@ def handle_field(prefix, name, id, type, fields):
>          else:
>              k = id.replace('.', '_')
>              print("%sXLAT_%s_HNDL_%s(_d_, _s_);" % (prefix, name, k), end='')
> -    elif not re_brackets.search(' '.join(fields)):
> +    elif not '{' in fields:
>          tag = ' '.join(fields)
>          tag = re.sub(r'\s*(struct|union)\s+(compat_)?(\w+)\s.*', '\\3', tag)
>          print(" \\")
> @@ -290,7 +290,7 @@ def build_body(name, tokens):
>      print(" \\\n} while (0)")
>  
>  def check_field(kind, name, field, extrafields):
> -    if not re_brackets.search(' '.join(extrafields)):
> +    if not '{' in extrafields:
>          print("; \\")
>          if len(extrafields) != 0:
>              for token in extrafields:

These are the only two users of re_brackets aren't they?  In which case
you should drop the re.compile() too.

~Andrew

 


Rackspace

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