Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp743430rdh; Thu, 26 Oct 2023 14:41:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFF3JuTOwEKwSgOPqxcwFia9A/zQ4VJwULihsXHzyH5av7UMY3qo+xvu6Oq9T2qTd4SOjwP X-Received: by 2002:a81:b60e:0:b0:5a7:acae:3bb0 with SMTP id u14-20020a81b60e000000b005a7acae3bb0mr900468ywh.5.1698356462350; Thu, 26 Oct 2023 14:41:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698356462; cv=none; d=google.com; s=arc-20160816; b=dE5bAoyzY3SLK9yv4x2s8tX4fE1BG6E/O7Kr5dns0CiOPe8b4X9wNeyhm2LEkkRd1o Z57282LHah/ABWRHOLYel8DMnz9/Hljdkj1ozPznxiakF6sOTVgSyrdeRVzg6Nj4oT6W iDhHPx2K1A10o1kdW3IHdEBsJ+UnmDyy4rcTXCEsRZNbfq9jem1anN7/x+WIEdN8sYpD JtyC/F94Yp4F2AGZJqshULrmZhBm5L2DMGlj/eLCKTO6TIF9TYRNKLjrliC33VvCKCcA ke+FH1XJUxy7vHokNK2BRDBAs5mv6hup+cN/570CC5mFbMXF3pz3s+RnpcNi809E4DjI DAZA== 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:dkim-signature; bh=Z/kCC9Xleu4oCsZEw8qSGwEvAQ/otiVovpFVr+FE6EI=; fh=rAEAxeQRXZRScZN81mFMtGq2Gs/SNUO2xV9QEN6pSUY=; b=bO6eg7IZe8/lfAS9gEQ2dqb0qRUdfzXCt4dbFEJTWP/JKHjjKxJ06+e5acg5pAbOGl WkNqxLmgdlN0obePskfIKUXZ/aOzRAqbSo5yq8R7lU7xrjWzvDy9BLqDlzUUSJEoOTh+ 9lLfoOy2q/bFQo2RYLW+NQeLauXzx6ncKT1eiaInK2ZmhD4abU1AUsyqi4+OJfNHavIY gUJDrVxlmEWvKCHvT+2T1cOe0fk+pUIGTKET/Yyr/Wp0kWlORw8h6X2MEQU6H/cYxbGi r7r4LYODi5IYhCa57gP/Kvli8HkBUhOKRCyMe/d3u2KTAwjdPzxwv6NW5LB2DP6iVH+m C4Hw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=LuP+gdWI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id x22-20020a0dd516000000b0059f4fa06dd0si405532ywd.241.2023.10.26.14.41.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Oct 2023 14:41:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=LuP+gdWI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 51FFC80732A0; Thu, 26 Oct 2023 14:40:16 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344860AbjJZVkH (ORCPT + 99 others); Thu, 26 Oct 2023 17:40:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53010 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229621AbjJZVkF (ORCPT ); Thu, 26 Oct 2023 17:40:05 -0400 Received: from mail-oo1-xc30.google.com (mail-oo1-xc30.google.com [IPv6:2607:f8b0:4864:20::c30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DCD2DDC; Thu, 26 Oct 2023 14:40:03 -0700 (PDT) Received: by mail-oo1-xc30.google.com with SMTP id 006d021491bc7-5845213c583so813093eaf.0; Thu, 26 Oct 2023 14:40:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698356403; x=1698961203; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=Z/kCC9Xleu4oCsZEw8qSGwEvAQ/otiVovpFVr+FE6EI=; b=LuP+gdWIsdfpnbiBETNDxhrm31VQ5VhJhRsC8bm0EExMag/bhQxs0WBJJg0IVa7/me 2k5VLrYQgqIBBBfgp9VxwQbEfg7iFzoIKe1V9qG/WsSQUTfrqdi2LTNyAyWovpDSzubl A0/wgUxzvI9KUzSv4UXFkLLodVwgWo6C+m4rfGUzzSi1WOwpYkMSajfmElZnBhkm3u0g 4bSV6gpWR29CBWAbAbdM3Vfnf/rUER7azakJ/KIU9al4b+cBI+b4gylZrEMQ57145JqN T/wBTVrj4I46OAa94q4+wbUe3Y1XjODXoCeYxZAxTVIdFZLQkBn4Wz1omf0nNrjqwoKC wuJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698356403; x=1698961203; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Z/kCC9Xleu4oCsZEw8qSGwEvAQ/otiVovpFVr+FE6EI=; b=NGO7TizRbS14k0vOATmEdMU5a01r9bYlW73u/PfC9l4ZX+OX5NjEBbNYWgyGIiPg8b vHrxEMXOffCBcsa9Z0IHLOGOF6wpGZNB5L3V/xYUlmXooW/wAQ35GNkbHtp04/M6ZIEG uH9dRxU+cr4cN3QXXKnKMkLrYLLmtCJpern6OjTnqu7unsxrUNSIVDLhXIkUmHj3LCom 2pfM1k/Jv02Xa+y0h1rdothjMrEuifwgktsCpi+hQQIiQ37M9FpJ40nKEoC2BUK7eshN FB10OjLe5dS08MqHut04KtjPSqc7olZeuNEIvDzZvhXnTaiwFxmwav8xseoXsDUk/jLK YnaQ== X-Gm-Message-State: AOJu0Yw2/nAzrVWOvky7Ffmr+djIAJI1EEj4W4s6Ii4Un8dVoyCc9ncU Dm5UOkvk5LFTOvCCZHnH9O4= X-Received: by 2002:a05:6358:5292:b0:168:d3b3:7173 with SMTP id g18-20020a056358529200b00168d3b37173mr1469635rwa.25.1698356403089; Thu, 26 Oct 2023 14:40:03 -0700 (PDT) Received: from [192.168.54.90] (static.220.238.itcsa.net. [190.15.220.238]) by smtp.gmail.com with ESMTPSA id c26-20020a63961a000000b005891f3af36asm68472pge.87.2023.10.26.14.39.59 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 26 Oct 2023 14:40:02 -0700 (PDT) Message-ID: <14fc783f-43a3-46cd-98a1-01556b9f99f6@gmail.com> Date: Thu, 26 Oct 2023 18:39:57 -0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3] rust: macros: improve `#[vtable]` documentation Content-Language: en-US To: Benno Lossin , Miguel Ojeda , Wedson Almeida Filho , Alex Gaynor , Boqun Feng , Gary Guo , =?UTF-8?Q?Bj=C3=B6rn_Roy_Baron?= , Andreas Hindborg , Alice Ryhl , Asahi Lina , Sven Van Asbroeck , Viktor Garske , Finn Behrens Cc: rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org References: <20231026201855.1497680-1-benno.lossin@proton.me> From: Martin Rodriguez Reboredo In-Reply-To: <20231026201855.1497680-1-benno.lossin@proton.me> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, 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 fry.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 (fry.vger.email [0.0.0.0]); Thu, 26 Oct 2023 14:40:16 -0700 (PDT) On 10/26/23 17:19, 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 > --- > v2 -> v3: > - don't hide the import of the constant in the example > - fixed "function" typo > - improve paragraph about optional functions > - do not remove the `Send + Sync + Sized` bounds on the example > > v1 -> v2: > - removed imperative mode in the paragraph describing optional > functions. > > [...] Reviewed-by: Martin Rodriguez Reboredo