Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp246445rda; Sat, 21 Oct 2023 06:19:17 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFRUOQTx90fsXjHJTdOlmTiYN5yGJkdYQTNXrxtnKQUriBu92W/QIfTiHSdLQiRkdOqXVNO X-Received: by 2002:a17:90a:6b08:b0:274:8951:b5ed with SMTP id v8-20020a17090a6b0800b002748951b5edmr6228284pjj.20.1697894357327; Sat, 21 Oct 2023 06:19:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697894357; cv=none; d=google.com; s=arc-20160816; b=QaHIP69B8Hw0ntyiM6avFha3CaW+oCkHvJEzOw4CwsRi1+bj/xb3keRbkpThfSfNFu HaopaGWvUPgobYgcGM00sYLSc/a3qx2F9QD+z0NjtqJxIs8/EC+3BETsgTt7+oddw61O b3aSmv+8LEOwBBNszvat2tdUm7f2vRHDezkEHXDozGmWlqFtS7XCPvczT4KetsYlosLk /neU3z/iGuYVgfreRzTk2pOUd1O5A4ZGhxpWd4IV/x2XYdJpd14dWFBNCJ2Eta/9zqIH ctJt3Ba+mDnRSQeVMKrswL2YbiGHcQMXcsxTEwO+fcLIoUXAy4fqNi7NAt3M/VyqngcE dHMQ== 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=Vz93kvNHnltIJPk151Ct3Vlh5dYIx/Zn9LBX7dhQlAM=; fh=6A40W5l/h8lgOshmEGjHBj0yHmjPExZO0kSs8Xr50CE=; b=HtQ00ntFRPlwt23YttHLy5vYdiDfG4aMnZsG7O1o1kSIT6LlNMTPB5fF1hx+MEKtjc LqMr6HO0I9TuT1Ud7HifchCnXo2WVEeXtq0s74dGOjkKvSG2ovtniHgAVtO0Sfp8Abx/ 6+ev+m+Z/Z40wGjHG4IHq6PCuJ0M9K86xpv7H8s/qE4cMK/ef5X541GLL/L1G2heXJAX TnnKf1/+pJvEym+tOLGDFXHDn+3RuV92B80jwodCzXp3J/BQrLWaHbQ5+3BAeVdQ9BFs afKE7PL6hzxYk58hp+KPofHUnBac90CRO4IRCPDnbWlSOabgFKTpIdrEUGCbXL4eH+aN SWaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ryhl.io header.s=fm3 header.b=T9VHeW0z; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=m0Y29Ie2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id y11-20020a17090a8b0b00b00276c22ca6a4si6053793pjn.147.2023.10.21.06.19.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Oct 2023 06:19:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@ryhl.io header.s=fm3 header.b=T9VHeW0z; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=m0Y29Ie2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (Postfix) with ESMTP id 9F1E6802B139; Sat, 21 Oct 2023 06:19:12 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229686AbjJUMpW (ORCPT + 99 others); Sat, 21 Oct 2023 08:45:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41742 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229478AbjJUMpW (ORCPT ); Sat, 21 Oct 2023 08:45:22 -0400 Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BF2A11A4; Sat, 21 Oct 2023 05:45:16 -0700 (PDT) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id DCA865C018A; Sat, 21 Oct 2023 08:45:13 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Sat, 21 Oct 2023 08:45:13 -0400 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= 1697892313; x=1697978713; bh=Vz93kvNHnltIJPk151Ct3Vlh5dYIx/Zn9LB X7dhQlAM=; b=T9VHeW0zSi66w42NwPQP5cGb2Cc9u8FP707io0qFOuvIiAObutw V4jYgtOPz4t0L6DWWx0Y4TKKExp4NbCoULWk06DGmCyBxP649f269OHYac8A0hTZ 2LAX2gSzb/hCbYc21H3srBXglU9/BqXQgOFhEKkWTPk8AmpEKiUtMF2X7HtkM8v/ oDbUdj605yDQKjvIlUuJF7XMAClPsu2ChMvDFQcCdSWHIX14CiP9gpmvI43Ucc7h HrYB3R6uh+cmZbySOnVnwtFklhe43iPAP5EHakj87OiMBgWWO5vZy3PODMF59+me Q0YYdDYikJSn3CKCvOcHnvjskS0yndnEUKA== 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= 1697892313; x=1697978713; bh=Vz93kvNHnltIJPk151Ct3Vlh5dYIx/Zn9LB X7dhQlAM=; b=m0Y29Ie2RPJn7Mg7LMQ33Rlq6QwZrO6QIdtYEn0ASAkiWZZOiju 2QxlbNNnbuaINVJEQg8nuJIHOvHCSkzNyhycravPn7aYDxCBmYbuNdGNIrQni1Em Gs++5e0jHfgu6I45sIuG9phs8p7WS64tnQJe/Tv+bVZXQRS4vKqbgM1Ag2U/1SCW IwRFKH1MXj3N3Z/XQ4siYy/8BMOUAbdLzYhLfhgGMEATfdOBvZ3r09H/gD/7jfsV Brk1v1cigoQu0KFXvH8aBTGjyZ5+oWc9spwDLIYiwGf8Bc/t82D01F58H4Xh65so vGUJMWe5v1OBIjvl35XmRmsKYCc6JTZlpCQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrkedtgdehvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefkffggfgfuvfevfhfhjggtgfesthejredttddvjeenucfhrhhomheptehlihgt vgcutfihhhhluceorghlihgtvgesrhihhhhlrdhioheqnecuggftrfgrthhtvghrnhepfe fguefgtdeghfeuieduffejhfevueehueehkedvteefgfehhedtffdutdfgudejnecuvehl uhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghlihgtvgesrh ihhhhlrdhioh X-ME-Proxy: Feedback-ID: i56684263:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 21 Oct 2023 08:45:11 -0400 (EDT) Message-ID: <1cc11492-248e-4b37-9608-b475acde3da2@ryhl.io> Date: Sat, 21 Oct 2023 14:45:09 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2] rust: macros: improve `#[vtable]` documentation Content-Language: en-US-large To: Benno Lossin Cc: Boqun Feng , Gary Guo , =?UTF-8?Q?Bj=C3=B6rn_Roy_Baron?= , Alice Ryhl , Andreas Hindborg , rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, Miguel Ojeda , Wedson Almeida Filho , Alex Gaynor References: <20231019171540.259173-1-benno.lossin@proton.me> From: Alice Ryhl In-Reply-To: <20231019171540.259173-1-benno.lossin@proton.me> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS 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, 21 Oct 2023 06:19:12 -0700 (PDT) On 10/19/23 19:15, Benno Lossin wrote: > Traits marked with `#[vtable]` need to provide default implementations > for optional functions. The C side represents these with `NULL` in the > vtable, so the default functions are never actually called. We do not > want to replicate the default behavior from C in Rust, because that is > not maintainable. Therefore we should use `build_error` in those default > implementations. The error message for that is provided at > `kernel::error::VTABLE_DEFAULT_ERROR`. > > Signed-off-by: Benno Lossin Reviewed-by: Alice Ryhl There is a minor nit below, and in reviews sent by others, but overall this looks fine to me. > /// # Examples > /// > /// ```ignore > +/// # use kernel::error::VTABLE_DEFAULT_ERROR; > /// use kernel::prelude::*; I probably wouldn't hide the import of VTABLE_DEFAULT_ERROR from this example.