Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp3299913rwr; Sun, 7 May 2023 08:43:28 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4cf33CPQ0KfdFovJp1pleB+4eGotLmdJDC9PkTk4XTcSyAZmrYyGWF369zYEhTK7yQKB1G X-Received: by 2002:a05:6a20:4295:b0:fe:1383:eab2 with SMTP id o21-20020a056a20429500b000fe1383eab2mr9889115pzj.2.1683474207789; Sun, 07 May 2023 08:43:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683474207; cv=none; d=google.com; s=arc-20160816; b=krDQKZJXG/5yEjsrSUmk+p9/rESwwPTLayN0T7M5BiyapICOx36Aelt06biNrRDNV7 oLenedtaH04dtbHPK/Q1illGT6BScsYM4wsb7JzxlBVOyGNyhAJj7X40CYMdfZjS/exJ F/+tN6/IIMGxhFXX7/KBIiuL6k1bCxaDR2PGF8n4JoLx+CMmvCMWOzXEnLuHnLiJHdnZ dySaJXVL9qeO0oaWUSKYDiUdiVD01PXPgJHqtfKWA5moQTUoyNwim/NWmUknrILY56wV RfPUsQYyobHsaqnxKcoXaC1T15bBvzlEp/zTGFPDD4notgEvkJN/kn0nBsNWc6LGExzd Onjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:content-transfer-encoding:mime-version :message-id:date:subject:cc:from:dkim-signature; bh=cXfYAxy/0WQK3eurmoC5L3aB81s98dVICzFWcsOt+GA=; b=RIvX3LBsGk/JWJ5VqvWrqzk1k1CMuwiTNYokK5u//rxtrR/RtVkfUXX9co/0z3b0pM HJe6gt8YERababsH4O5ff0EA4ma4FK2zxJfysSG80Ta+N0WZAaS5touTIvwOcygnJQdF PcfJw6YEfQx9UiFBkK+gA8k/zxAhoz0eN7pz7A2dSAnSJcKjpXRTCL1alQcxYTVT1ekN q90Gyopa2hmMltzM26ayK3D5roHYoB0Fu20bRLoQ1FFqZiYL5u3ekqJlufZbfbJva1ql tj5FV+vxmbkJPLLI/FG0T2MbRCvaS9PUR/3hOtv6XAdYgk53LXSGGSurnO6ssVb3pUf1 B/9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20221208 header.b=opwmOyCf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a204-20020a621ad5000000b0063b5e220edasi6360877pfa.400.2023.05.07.08.43.15; Sun, 07 May 2023 08:43:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20221208 header.b=opwmOyCf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231676AbjEGPXZ (ORCPT + 99 others); Sun, 7 May 2023 11:23:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59404 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231653AbjEGPXY (ORCPT ); Sun, 7 May 2023 11:23:24 -0400 Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A65C17FCD; Sun, 7 May 2023 08:23:16 -0700 (PDT) Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-3f19afc4f60so23341445e9.1; Sun, 07 May 2023 08:23:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683472994; x=1686064994; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=cXfYAxy/0WQK3eurmoC5L3aB81s98dVICzFWcsOt+GA=; b=opwmOyCf3zacpjaTp05ZgrNC6QDcPbiGf7IX0xqQX9eOnaeApS9sKjzDIuQBbTE6h6 YupY3Mu69A/dY4z0ts4OSW2sCPKzM4w9fkS1NdIYmrYlVfq8wNzuHFWB9E37m1UzwB3+ tvsv8do87qGhJNcKk2ii71nCmU+jFXcIP9TvyUxX+go03o4W0XG1jqQsNOK4BUfBy87v 2FdEsnAyM7XcF49BJsiNVOp20RBLIXAy7CErnypx/LExlyZ8ebn+pQLhXDQGMORzToW2 KmgS+m/KyaNMEOFsQIifgIdD7+X+bU+0d2ut4sq5RSV8lRQuqHZZjVg9Y2D55PnIt0W+ tT8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683472994; x=1686064994; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=cXfYAxy/0WQK3eurmoC5L3aB81s98dVICzFWcsOt+GA=; b=MiJxYKVYC9C9EBjMFNIWRmQ0rJUaxbYn4juDANk1yVxLWcsSJ5/3zAyWfdNeqaX3q7 UNiAGiqQ/MV8wmjSGEGNqWIQK+gzG+Ovrp02VjAmHI6lW5+7DsT+AQCpg7eqsM5QjcOc 80bA+/Ps9ZTKqwrChVVEfkfd3E9wl5+fX2ACfJB8iyIr0FF4oTJCOe66NNoG0wnBRQ8m cpb+GaB7T+oPF/y61fsB82qbGAl/pSCAswiHBCTYoFxfrbGG3IL0+9DPKH5m6syNzDcY HGArSYOCkcZjs87qRm2S4B5643xOhyUz9CPQnot7/N+N2es7Xs+qLFe5hr7MnwJqU6bv TKPw== X-Gm-Message-State: AC+VfDyGp5s8rqBAhxCErsMknkxjt9HJEc+me+lHPaiQ83sAk9/M3fK5 a89CZfo5H0WUSIuVEduJANA= X-Received: by 2002:a1c:720f:0:b0:3f4:16bc:bd1c with SMTP id n15-20020a1c720f000000b003f416bcbd1cmr3169835wmc.3.1683472994534; Sun, 07 May 2023 08:23:14 -0700 (PDT) Received: from localhost.localdomain ([2.222.93.88]) by smtp.gmail.com with ESMTPSA id c17-20020adffb11000000b003075428aad5sm8231630wrr.29.2023.05.07.08.23.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 May 2023 08:23:14 -0700 (PDT) From: Ben Gooding Cc: ben.gooding.dev@gmail.com, Benno Lossin , Miguel Ojeda , Alex Gaynor , Wedson Almeida Filho , Boqun Feng , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Martin Rodriguez Reboredo , rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] rust: lock: Add intra-doc links to the Backend trait Date: Sun, 7 May 2023 16:22:29 +0100 Message-Id: <20230507152232.803-1-ben.gooding.dev@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,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 To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Also fix a minor typo in one of the comments Suggested-by: Benno Lossin Link: https://lore.kernel.org/rust-for-linux/94625fe6-b87a-a8f0-5b2a-a8152d5f7436@proton.me/ Link: https://github.com/Rust-for-Linux/linux/issues/1001 Signed-off-by: Ben Gooding --- rust/kernel/sync/lock.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rust/kernel/sync/lock.rs b/rust/kernel/sync/lock.rs index a2216325632d..95466201dab7 100644 --- a/rust/kernel/sync/lock.rs +++ b/rust/kernel/sync/lock.rs @@ -72,7 +72,7 @@ pub unsafe trait Backend { /// A mutual exclusion primitive. /// -/// Exposes one of the kernel locking primitives. Which one is exposed depends on the lock backend +/// Exposes one of the kernel locking primitives. Which one is exposed depends on the lock [backend](Backend) /// specified as the generic parameter `B`. #[pin_data] pub struct Lock { @@ -90,7 +90,7 @@ pub struct Lock { pub(crate) data: UnsafeCell, } -// SAFETY: `Lock` can be transferred across thread boundaries iff the data it protects can. +// SAFETY: `Lock` can be transferred across thread boundaries if the data it protects can. unsafe impl Send for Lock {} // SAFETY: `Lock` serialises the interior mutability it provides, so it is `Sync` as long as the @@ -126,7 +126,7 @@ impl Lock { /// A lock guard. /// -/// Allows mutual exclusion primitives that implement the `Backend` trait to automatically unlock +/// Allows mutual exclusion primitives that implement the [`Backend`] trait to automatically unlock /// when a guard goes out of scope. It also provides a safe and convenient way to access the data /// protected by the lock. #[must_use = "the lock unlocks immediately when the guard is unused"] -- 2.34.1