Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp1046736rda; Mon, 23 Oct 2023 00:01:59 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFRD5iQTeiwt+5DfsvHJqMMXdWajotycAANrbxkf9XP2ROMZ5OyM0oIZGS59BXDeA0PVO3X X-Received: by 2002:a05:6a00:b8c:b0:690:cae9:714d with SMTP id g12-20020a056a000b8c00b00690cae9714dmr6893202pfj.13.1698044519535; Mon, 23 Oct 2023 00:01:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698044519; cv=none; d=google.com; s=arc-20160816; b=A2n6LGMPr0lwxYdHnrmEPE1Xn6+Ew1Ll6kHS6lerqRDmI8iH0E6VWnREAZZwneLazP BqjccscgnvYnL5BDKMt6i3RRX2IEqoiaa9g/ydBKI3ecpQH3SaTDg9VwDhkGb6JLujeJ GIqq/lCh2TMdyYtLp4fyMCAlc/6/poEJDMcqDY/M6DpWwHOBKIrsxYaUAkJQryoLuZI8 zud+md4Mn8VQXz+d6pI7zUCCmroJDFV2IrpDjki+pIWkEFoaY8KjQHfgK4CrglyCzt3Y /5BFo/ErBXw/xhqHuCbg4EACbQO68k88qBM0u0PBP1unhTWoMY2tQEqbJjOMhGofNkAu sNtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :feedback-id:references:in-reply-to:message-id:subject:cc:from:to :date:dkim-signature; bh=aDzL3P4c++HPB9/QZEWqLcqCnvnrKJCxXeKLtziOMrY=; fh=plLnUkaFsU/abFgXpXlCauYWTNY1ohPUQpHwhg4vdYg=; b=ueka2Lc/5Yd3j20N97ittY5bYsykLf+GOvGQJa6D7rslojSaDv12m9Sqol9tRuhE2w pHZiRD/OF3YvskZHyNkcfdu7Hua/h7cwJa48uqS1McIzC153sOXB+1HCG0g8QXIQVAYR +1yfMcpyn8A/57qcAyRS5Bmva2PFSgVUkBqYIeYwFC1483k9C2vTXhAwbz5vuY2/Jmv9 DWEZrDNlO3sLQvadBcGnFW+WNDKDHr1IZr8r6If4hWHWB2LKjGprKwJsTSkfvT7rHrNA AjFPCGRStVjLiuIiAiWkMRHSB6rHazf8suez8qdSjQpWIiwGl/0z1CLfgxXLOgjba5Su +2wQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@proton.me header.s=n6gvyn43rfhurm23bk4ehn3pdq.protonmail header.b=KSZ6HIkk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=proton.me Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id w25-20020a637b19000000b005b02d7bb426si5810342pgc.282.2023.10.23.00.01.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Oct 2023 00:01:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@proton.me header.s=n6gvyn43rfhurm23bk4ehn3pdq.protonmail header.b=KSZ6HIkk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=proton.me Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id A755C807CEEE; Mon, 23 Oct 2023 00:01:56 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233370AbjJWHBo (ORCPT + 99 others); Mon, 23 Oct 2023 03:01:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41452 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229450AbjJWHBm (ORCPT ); Mon, 23 Oct 2023 03:01:42 -0400 Received: from mail-4322.protonmail.ch (mail-4322.protonmail.ch [185.70.43.22]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BCFB1EE for ; Mon, 23 Oct 2023 00:01:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proton.me; s=n6gvyn43rfhurm23bk4ehn3pdq.protonmail; t=1698044498; x=1698303698; bh=aDzL3P4c++HPB9/QZEWqLcqCnvnrKJCxXeKLtziOMrY=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=KSZ6HIkkAiRAmNQA9mLy63yB4G/B/C5qV9I0ZFlJrOaHw+nMFBcqzZAzm2ux752Wa OLnSwIgQk6I6ZZWHvsdhm5KnP9gq9xHWLfyCuXqWUk7Rc/4VIt5i7jzjwKU54Ib2Lw yjNE+X00e7pKIbDEK4xFeMbrOOfNjgHRHLwNR4NYQdRSEtfLGGQxgX55CC1I4NePFn LzZlFX13Cvwy7HA/hUa64rp7Bcx676XwLqRBOpam3vRBpxi/EzOxjrLyKtnkFairme ixG4md6SpLG73FMRVQNc9w5v5e76RDrFp8d3npeDNHjn9D85vCo5usJDWpT7mg8lBk Z7I4SbTJQr9oA== Date: Mon, 23 Oct 2023 07:01:28 +0000 To: Alice Ryhl From: 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 Subject: Re: [PATCH v2] rust: macros: improve `#[vtable]` documentation Message-ID: <06d27457-6b6c-4392-9be1-d1fecfbfd9f3@proton.me> In-Reply-To: <1cc11492-248e-4b37-9608-b475acde3da2@ryhl.io> References: <20231019171540.259173-1-benno.lossin@proton.me> <1cc11492-248e-4b37-9608-b475acde3da2@ryhl.io> Feedback-ID: 71780778:user:proton MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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 pete.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 (pete.vger.email [0.0.0.0]); Mon, 23 Oct 2023 00:01:56 -0700 (PDT) On 21.10.23 14:45, Alice Ryhl wrote: > 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 >=20 > Reviewed-by: Alice Ryhl >=20 > There is a minor nit below, and in reviews sent by others, but overall > this looks fine to me. >=20 >> /// # 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. What do you guys think of putting the const it in the prelude? --=20 Cheers, Benno