From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3D394C4332F for ; Fri, 25 Nov 2022 20:53:43 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oyfhM-0001QX-FM; Fri, 25 Nov 2022 15:53:24 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oyfhK-0001Pb-El; Fri, 25 Nov 2022 15:53:22 -0500 Received: from forwardcorp1a.mail.yandex.net ([178.154.239.72]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oyfhG-0007g0-JQ; Fri, 25 Nov 2022 15:53:21 -0500 Received: from vla1-81430ab5870b.qloud-c.yandex.net (vla1-81430ab5870b.qloud-c.yandex.net [IPv6:2a02:6b8:c0d:35a1:0:640:8143:ab5]) by forwardcorp1a.mail.yandex.net (Yandex) with ESMTP id 878895FF12; Fri, 25 Nov 2022 23:52:55 +0300 (MSK) Received: from [IPV6:2a02:6b8:b081:16::1:7] (unknown [2a02:6b8:b081:16::1:7]) by vla1-81430ab5870b.qloud-c.yandex.net (smtpcorp/Yandex) with ESMTPSA id sqTUt30NvqM1-mUM5bjS3; Fri, 25 Nov 2022 23:52:55 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1669409575; bh=Tudxd6deO2+mR+egwYxXaEZ907bK3wL8YtxoNABBLWo=; h=From:In-Reply-To:Cc:Date:References:To:Subject:Message-ID; b=rMVkkY51hDBX+i2rOByKrzBQ+fDWjqyBX+lxHJUNAixXdNJ0+p5ZuF74rywHB0Ifw mu3mYeB8ltjE6yQE4cScjlYYemAubXXgOMC05DqkmUwqYi43pVCv+X0lvedVL1URf+ 41nj9XehWHEBoVQBK1bmRJLbuzZgiCodzhQ3g9s0= Authentication-Results: vla1-81430ab5870b.qloud-c.yandex.net; dkim=pass header.i=@yandex-team.ru Message-ID: <3652488b-cc6e-4c51-5fec-93bba1d7f128@yandex-team.ru> Date: Fri, 25 Nov 2022 23:52:54 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Subject: Re: [PATCH v6 12/14] block-coroutine-wrapper.py: support also basic return types Content-Language: en-US To: Emanuele Giuseppe Esposito , qemu-block@nongnu.org Cc: Kevin Wolf , Paolo Bonzini , Hanna Reitz , John Snow , Eric Blake , Fam Zheng , Stefan Hajnoczi , "Denis V. Lunev" , Stefan Weil , Jeff Cody , Cleber Rosa , qemu-devel@nongnu.org References: <20221125133518.418328-1-eesposit@redhat.com> <20221125133518.418328-13-eesposit@redhat.com> From: Vladimir Sementsov-Ogievskiy In-Reply-To: <20221125133518.418328-13-eesposit@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=178.154.239.72; envelope-from=vsementsov@yandex-team.ru; helo=forwardcorp1a.mail.yandex.net X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, NICE_REPLY_A=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org On 11/25/22 16:35, Emanuele Giuseppe Esposito wrote: > Extend the regex to cover also return type, pointers included. > This implies that the value returned by the function cannot be > a simple "int" anymore, but the custom return type. > Therefore remove poll_state->ret and instead use a per-function > custom "ret" field. > > Signed-off-by: Emanuele Giuseppe Esposito > Reviewed-by: Kevin Wolf Reviewed-by: Vladimir Sementsov-Ogievskiy > --- > block/block-gen.h | 5 +---- > scripts/block-coroutine-wrapper.py | 19 +++++++++++-------- > 2 files changed, 12 insertions(+), 12 deletions(-) > > diff --git a/block/block-gen.h b/block/block-gen.h > index 08d977f493..89b7daaa1f 100644 > --- a/block/block-gen.h > +++ b/block/block-gen.h [..] > > # Match wrappers declared with a co_wrapper mark > -func_decl_re = re.compile(r'^int\s*co_wrapper' > +func_decl_re = re.compile(r'^(?P[a-zA-Z][a-zA-Z0-9_]* [*]?)' hmm interesting. I'd just write \* to mean '*' symbol. Probably it's a tiny bit faster (and tiny bit shorter:) -- Best regards, Vladimir