Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp1519685rdf; Sun, 5 Nov 2023 03:05:25 -0800 (PST) X-Google-Smtp-Source: AGHT+IFsryp8Oq+v7mruCazIUMzJDOnNVuwsz41iAAfAC5FPM3ZjNFLpEC/HHob3iwNbDhs+93Dh X-Received: by 2002:a05:6a20:8e0b:b0:14c:a53c:498c with SMTP id y11-20020a056a208e0b00b0014ca53c498cmr25838994pzj.10.1699182325091; Sun, 05 Nov 2023 03:05:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699182325; cv=none; d=google.com; s=arc-20160816; b=L+SpEgPu8+MPSTeo5UbjfNJts3jmiLof1mRvRE1ABCgD6+dJmTx11oOtmiS2ICTEA7 orqY5pNvl+YSVP8q3DkE71OY9U/oEKzHj/fpurWk943Xt7dmys9y3OthnWzTE0WWCs+v qkvBLcIoWEVCCDfR4JoBCOO3foGMkjU7qJy+90t5HzoK/pMD9W4YE6hWPU+TNyjxhZsM pA5YJGQbqhVvxyrU2LZIZZ0wZ0r4yYzUnGYhnuBiSeQUG7JJRS6eU8Kkisj7ix0p5RBH Tv8pncdxvkZ4YDz8rTmR4nvFkuaDGJQwW4kG08D+2WzOQddESwsUyQX3eS5j1MQvMncj h+LA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:feedback-id:dkim-signature:dkim-signature; bh=oiIsiQNkqbL0G5Dnfmiu2q+vrjmWVl+fynhkrRGOC1Q=; fh=hO9dLAfzbNiyZ0+okcclvhtQxwK9uERGYphPspiIj64=; b=HdTQM0fNQZ+Ra6n4zXar21MVEMlJs9AI2kJKdSf9idowVz9q60nQti3UTvhURJO+DR sCHaN8yXKX//MwHREIAgIIW5mqNqlcrPwIaJA/CXSKVeZ+CA3dDlQDHhUdNKTxEw3vrn XyWv1mesiW7yC+YN1kWxfBM/LZLG+RYk5/cxL/wklZUHHDbwNlSyNenUey+CMnSkqK3A 4QSfa4nCxa4M8HLQE9hRgFoLSUlF2NWsT7ZSn4UsSOd5zkoYdbEUYZX3Rr7cUHWLONV8 3ixbqLciJXiLLv200AcmPZlo2ZtkQdSuxVbl8H46QvyVZMHO6cDZ/1KmhuRnNkomyqR2 DmPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ryhl.io header.s=fm3 header.b=aBKgrL4L; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=MQXAmDzw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ryhl.io Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id lb14-20020a170902fa4e00b001ca30930778si5369498plb.71.2023.11.05.03.05.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Nov 2023 03:05:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@ryhl.io header.s=fm3 header.b=aBKgrL4L; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=MQXAmDzw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ryhl.io Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id EEF29804E80C; Sun, 5 Nov 2023 03:05:23 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229621AbjKELDq (ORCPT + 99 others); Sun, 5 Nov 2023 06:03:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47202 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229447AbjKELDo (ORCPT ); Sun, 5 Nov 2023 06:03:44 -0500 Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2ED42D3; Sun, 5 Nov 2023 03:03:41 -0800 (PST) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id D00455C0111; Sun, 5 Nov 2023 06:03:38 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Sun, 05 Nov 2023 06:03:38 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ryhl.io; h=cc:cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm3; t= 1699182218; x=1699268618; bh=oiIsiQNkqbL0G5Dnfmiu2q+vrjmWVl+fynh krRGOC1Q=; b=aBKgrL4Lx4eQ2kWjgALMoH1L46EVVJO6JGtnuSz/dMbjWGTaUoS bKocheeCX5mPHlI+w8C67nExz5CdpGl5BMudmiYyqTO3qzAbaYfuFtr4U64hmwMT +38AUle/Es74eDB4DIC7lqDnnuLFv2zdRz3Hn+kIAZmXF9tTOqSvoHhlxTwFtfmr xj/6V3B7hwDYql48cfpvx2mEBZM3ivorxFZCee2KTMmHSkhXmh6one3LJqfAvw/P Hl1W0NhXfzrp+jZs9J4ikGRTZC1uTWcTKRZrfSfz9xVfaNePT1lNMltLin2W/lnq nygUkNC4q8pmwJzfTXYm6MXBznyA4mInAhw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1699182218; x=1699268618; bh=oiIsiQNkqbL0G5Dnfmiu2q+vrjmWVl+fynh krRGOC1Q=; b=MQXAmDzwof2YrrWh4pGz250ZHvZn5cRTw7zmR2V17zwaC1pIZYS Xb6UFrgLWzGsP4961WM0CMTgKKLs2TPKtx+YpTdJNW+J4nGi7GYUuTGEMVSwB6Si Ip9VdSWkxMzw9xInLTgYAwNjQxPFkhFi2Ke4XLjOYa2VFi0Y25vDZtJSZmsmZUE7 Ek+asl0cT/AQIXdWVTHu9EVj6YNsKBXn0wOE2uZwBPlvkYi/9oHu3h/DkYKceugn jLhkLMs/H+aCTenYS0qFtaHqXMc5Pg/Fuq8jnNWyMeBI81z0Gijla6uJB8m2W0ls xs1brbZu3H6MsdpTK4bCuoz4qQvs/CjaIpw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrudduvddgvdefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtvdejnecuhfhrohhmpeetlhhi tggvucfthihhlhcuoegrlhhitggvsehrhihhlhdrihhoqeenucggtffrrghtthgvrhhnpe efgfeugfdtgefhueeiudffjefhveeuheeuheekvdetfefgheehtdffuddtgfdujeenucev lhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhitggvse hrhihhlhdrihho X-ME-Proxy: Feedback-ID: i56684263:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 5 Nov 2023 06:03:35 -0500 (EST) Message-ID: <2f40b41d-600b-435f-804b-216990cf45cd@ryhl.io> Date: Sun, 5 Nov 2023 12:03:34 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2] rust: bindings: rename const binding using sed Content-Language: en-US-large To: Gary Guo Cc: Wedson Almeida Filho , Vlastimil Babka , rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, Miguel Ojeda , Alex Gaynor , Wedson Almeida Filho , Boqun Feng , =?UTF-8?Q?Bj=C3=B6rn_Roy_Baron?= , Benno Lossin , Andreas Hindborg , Alice Ryhl , Martin Rodriguez Reboredo , Vincenzo Palazzo References: <20231104145700.2495176-1-gary@garyguo.net> From: Alice Ryhl In-Reply-To: <20231104145700.2495176-1-gary@garyguo.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Sun, 05 Nov 2023 03:05:24 -0800 (PST) On 11/4/23 15:56, Gary Guo wrote: > Current for consts that bindgen don't recognise, we define a helper > constant with > > const BINDINGS_ = ; > > in `bindings_helper.h` and then we put > > pub const : = BINDINGS_; > > in `bindings/lib.rs`. This is fine that we currently only have 3 > constants that are defined this way, but is going to be more annoying > when more constants are added since every new constant needs to be > defined in two places. > > This patch changes the way we define constant helpers to > > const RUST_CONST_HELPER_ = ; > > and then use `sed` to postprocess Rust code by generated by bindgen to > remove the distinct prefix, so user of the binding crate can refer to > the name directly. > > Reviewed-by: Benno Lossin > Reviewed-by: Andreas Hindborg > Reviewed-by: Martin Rodriguez Reboredo > Signed-off-by: Gary Guo Reviewed-by: Alice Ryhl