Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp2844740rdb; Sat, 9 Dec 2023 01:06:49 -0800 (PST) X-Google-Smtp-Source: AGHT+IE0m7jEuZUsCVs543GsEihFvBZ6ojxoISYaI9xUfJnyQiVgwlGAjbGCmzr+yuLuvhHjZ9Ml X-Received: by 2002:a05:6871:3a2a:b0:1fa:261f:5336 with SMTP id pu42-20020a0568713a2a00b001fa261f5336mr1540173oac.10.1702112809026; Sat, 09 Dec 2023 01:06:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702112808; cv=none; d=google.com; s=arc-20160816; b=lGhHAPWldGkPZLbF6r6PKZ9XqlPkdzQmBo8LppyhsKVk54VweeAPYl2edKI6JIC7YF QZaRrdjuJxZfCtrkfdmIxYAdnLQqwwhjxD2R3+tnlEw7yo2JIHr2Dqlhu0JyQnD8PbsO Bt/s4hzo9ySHeTTbEqpk1XtarxPBYdD2FVfOjn9MO/Xd9aRosw3Q3VxaBmSyGPHhws6P F9MAeXh934fhebUjXSuOLTUHYbQ7XFVHU/Cs0/UvM01GAzGvcGhUt5QYIoMOhEqx+FJH HSNyQzO/gJraKYrh6eXjWOzgRgM76yNVZiV02p/qoupux9uYpDPvdb6N6DtyTBmXANrK 3zug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=8UD8Ez1dm6NAw93ymam0W1mumgICS6ONMy4VjBDU50s=; fh=JqXj+rmsFFkPtkp5CW0DOxne9q5hWuqznbsED1BeZX8=; b=EZjBBypdLoBqtcH7840ohI8LFF8EZH+lOJF6etY/pr6jOZTEOCeZZWy8xpka0qAGnu 04SCfxBqLH5jxSwMx+R2hk+NcnXQT4PSoOAazUz1+wpIZvMLYt9LPPDuDcn8eczlBwUG fmPTiwcHkZO6yGSyNp1Ld3csQygi5WJwY1O1MTYcMGrZxCRSCwwHIEeqwEDyEznqC6Bv 2VHbFwaQzhOZ0KrHzXggCyjCPlt+a7RG+fUGnXvU6wyrchFA6C5wq2W/BVhBjaI2s6rO GqBpxkl8+CgnPNeeKmomSIKdzjN/Le7PoGg5Tnz2x77SyBwyH7lq0MZiibI4l8OqJy2H apBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=r3AuxtUn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id t12-20020a6564cc000000b005c66b15ec25si2693265pgv.824.2023.12.09.01.06.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 Dec 2023 01:06:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=r3AuxtUn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id AF227836E273; Sat, 9 Dec 2023 01:06:46 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229664AbjLIJFd (ORCPT + 99 others); Sat, 9 Dec 2023 04:05:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39774 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229510AbjLIJF3 (ORCPT ); Sat, 9 Dec 2023 04:05:29 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BCE92EB for ; Sat, 9 Dec 2023 01:05:35 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8B341C433C9; Sat, 9 Dec 2023 09:05:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1702112735; bh=sfBK3FVn8RoSAAqkF2aTG/P8DWIJRncdWIjDsR6jFYs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=r3AuxtUn1FrzlX6jgof7CR3ENcy2cnRDsZgNlRAo5Z4SM/kh6Ms9ZuBvTQG0qCYx9 DOutLj0KHhYm22EaXfOi8SEz05gcyIejpg0HKFl71moRDKgQIbF2/3NE5JorBK5njH VcreswWWrlIky05atE63wVf0zH+2zlaDyf8hUKqo= Date: Sat, 9 Dec 2023 10:05:32 +0100 From: Greg Kroah-Hartman To: Alice Ryhl Cc: Arve =?iso-8859-1?B?SGr4bm5lduVn?= , Todd Kjos , Martijn Coenen , Joel Fernandes , Christian Brauner , Carlos Llamas , Suren Baghdasaryan , Li Li , linux-kernel@vger.kernel.org, kernel-team@android.com, rust-for-linux@vger.kernel.org Subject: Re: [PATCH] binder: use enum for binder ioctls Message-ID: <2023120936-decency-engraved-5346@gregkh> References: <20231208152801.3425772-1-aliceryhl@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231208152801.3425772-1-aliceryhl@google.com> X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email 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 (morse.vger.email [0.0.0.0]); Sat, 09 Dec 2023 01:06:46 -0800 (PST) On Fri, Dec 08, 2023 at 03:28:01PM +0000, Alice Ryhl wrote: > All of the other constants in this file are defined using enums, so make > the constants more consistent by defining the ioctls in an enum as well. > > This is necessary for Rust Binder since the _IO macros are too > complicated for bindgen to see that they expand to integer constants. > Replacing the #defines with an enum forces bindgen to evaluate them > properly, which allows us to access them from Rust. Does this mean that we will have to wrap every ioctl definition in an enum just to get access to it in rust code? What makes these defines so magical that bindgen can't decode them? Is it just the complexity of the C preprocessor logic involved? Any plans for bindgen to resolve this? Note, I'm not objecting to this patch (I'll queue it up next week when I get the chance), just curious about the rust tooling side here. thanks, greg k-h