From patchwork Wed Jan 31 20:23:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Valentin Obst via B4 Relay X-Patchwork-Id: 19746 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:106:209c:c626 with SMTP id mn5csp3491dyc; Wed, 31 Jan 2024 12:26:55 -0800 (PST) X-Google-Smtp-Source: AGHT+IF37uI36ZA1IS9BDTslgyfJ9SNG97oXhRLWOCKQSP16JFgEtOZjQ9SzJjh1GfOddXrfw3eP X-Received: by 2002:a05:622a:1054:b0:42b:f0e2:6f9f with SMTP id f20-20020a05622a105400b0042bf0e26f9fmr701374qte.59.1706732815774; Wed, 31 Jan 2024 12:26:55 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706732815; cv=pass; d=google.com; s=arc-20160816; b=qD9ghrONVSKihI5K/U2nZOwwc+JCYi6Ev0lhSGralS/mSeEnv2yhaJgeWm176dxmrX WuNdhzJ5sECOZW0ecQwGLNOGq2Ge3C9Da6NdlKEw4cTo7okXaqs6czACJfysk2lK1ntQ eRderIuXNys7pPrwL2of2O5t3nvlL68/XfKnYGhYqKzC3rmNlQQRutNZSG5ADF8Px2lE EtnQyzFXKSWQnaNgDOtH7siM7dwCExpN2gvwd2JrR+y8Yu9H77TXkaXB/BR1J3x/Dgee 6dhOm7YfVqP5q0qWW+pWOju3tbcKAtpDiYVm7dTdvQgxRby/25xWARm7b3f4GrIJxZQ/ lVdg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=reply-to:cc:to:content-transfer-encoding:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:message-id:date :subject:from:dkim-signature; bh=N6avKP2+qsNCYE2Vrk7u8TtulOlxYj87UikFh6dtmE8=; fh=O1KRi+3ss0UFwhje/K6lxQm56JG/2+DT1Kac4WDqeVQ=; b=oxal30wtJJa/BCHr609920izWny0gb6vdLe7yjuhSSD40r+hThoI/JWg0s+PIQW4/v XDVGFwN5L5o6dNVDv4SApcg2pIKUc3r/5r0cizwIih9OVXp8H9s0wvPe+PRxjowPax/h hL1P37p2rkY9Lgj/QyrQGE9mtzP39zqw0JX7jbIagFPQk62SQopsyQKDh1GhFlp9MdrW 0lzbaHgK6NYC1H8vjZaaQj2BOUK02qO34xlnuel5kpnPzolGx+W64v8SoiyZQgijhfzA MEwAnCKf6d4PPN5apnvVWvOPGH2wQqVJQlan/r1NQSYpUbIJs6dPiHo6yKlI6UIHcwdM KVgA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XCqS+aDt; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-47066-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47066-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=1; AJvYcCWj3TL+z9GPGDNbRIVxJBfLr3tEYrOmaAbOZWIC1CyxEsZk1PBu+xASEQngzmqPJwTru7DZN4nLzv0OEVh3xoOK0NRX2g== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id j16-20020a05622a039000b0042a5dbc7e98si12621893qtx.635.2024.01.31.12.26.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 12:26:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-47066-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XCqS+aDt; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-47066-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47066-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 095F71C2319D for ; Wed, 31 Jan 2024 20:26:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5F01713B7BD; Wed, 31 Jan 2024 20:24:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="XCqS+aDt" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3A0C9405FE; Wed, 31 Jan 2024 20:24:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706732649; cv=none; b=MYpycJVKgDCeHUXWgsyBLmixXRYq5NGaeutDIbxD/7SYF6cwXzki9A21rVcS5sSREaYqay2MT768E6gTGYN99QOQ3y4qUqSCeTcjK6kzSeVbt8+dZ3qWB+8+uol4kFyZpczfF9lQaMTSrgXQuzc19+QV9qUIHF/LJ3vrGsuccbU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706732649; c=relaxed/simple; bh=hC2mjadfbWNTXdCp+iDgEDDn3h44Sq3ssmfR5EiK618=; h=From:Subject:Date:Message-Id:MIME-Version:Content-Type:To:Cc; b=R6lhGhK4bzsfwyllXccs1qbn8pYoCBdESbX6zSOPmjcvqs6bRZh2yx9fmoS+bpG1jBbEn0JYN3AFw/i83XbsXw2eBXFCJfG10KLWTW19XwwXj34NrUGJBXKedQJultddQQb6BNVGHGNprVB1+VAqLnUq2x/NgztXETMLVgF+P8E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=XCqS+aDt; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPS id B9AAAC433C7; Wed, 31 Jan 2024 20:24:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706732648; bh=hC2mjadfbWNTXdCp+iDgEDDn3h44Sq3ssmfR5EiK618=; h=From:Subject:Date:To:Cc:Reply-To:From; b=XCqS+aDtQuBGKjuV/srdOQZuQEJ6K4UzArIZT0PG85r1yQsIcNAWrCWhxuGGDRr76 YpzUoJYJWTVZcptysvv2a8u2b0lTwm2A9P4GcGUUYI9gAm2/rnfcB5nihDlAwYlVmG TGEP77pcPURgXOC7timEt2za55776xhb3T+l1TzqV2aDS7NePrlOZTlu9gpRIYB2js XnlldDsADjJFjEOjCN0zBW8fhrjbnCk5K6GMQFKBomKgPk14C3bbnFNQXvHWAcP5J4 3WOlDJ7/45ttdshamUh0OUKh/Hf7T3pJYFn0jOVTnvGwj7N23YRYHI5LLLFU9huUrC WsnLug2St2SHw== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9F93CC47258; Wed, 31 Jan 2024 20:24:08 +0000 (UTC) From: Valentin Obst via B4 Relay Subject: [PATCH v3 00/12] rust: kernel: documentation improvements Date: Wed, 31 Jan 2024 21:23:22 +0100 Message-Id: <20240131-doc-fixes-v3-v3-0-0c8af94ed7de@valentinobst.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIADqsumUC/03MQQ7CIBCF4as0s3YaBqoQV97DuEAYLLGCgYaYN L27xJXLLy//26ByiVzhPGxQuMUac+pQhwHcbNODMfpukEJOghShzw5D/HDFptAYG07OONJaQ0/ ehX9bL6637lDyC9e5sP07kYqOgkiO1GUmJHxySbxcml04rTHle11Hz7DvXxnpvLOfAAAA To: Miguel Ojeda , Alex Gaynor , Wedson Almeida Filho , Boqun Feng , Gary Guo , =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= , Benno Lossin , Andreas Hindborg , Alice Ryhl Cc: rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, Valentin Obst , Trevor Gross , Martin Rodriguez Reboredo X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=ed25519-sha256; t=1706732646; l=2912; i=kernel@valentinobst.de; s=20240131; h=from:subject:message-id; bh=hC2mjadfbWNTXdCp+iDgEDDn3h44Sq3ssmfR5EiK618=; b=pjeD6O87EU/R9JZ4wGfJiVtnCZ1taFiqeJwfEpkF7kfmfd7ldXLcsHwS+yxW0OzOBqb0CRUY3 mXewAIRUDKsD1RkswDY54GjOAJ64IUno5EstWR3bxBzni/XpHqXMVzm X-Developer-Key: i=kernel@valentinobst.de; a=ed25519; pk=3s7U8y0mqkaiurgHSQQTYWOo2tw5HgzCg5vnJVfw37Y= X-Endpoint-Received: by B4 Relay for kernel@valentinobst.de/20240131 with auth_id=124 X-Original-From: Valentin Obst Reply-To: X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789639068954340953 X-GMAIL-MSGID: 1789639068954340953 This patch set aims to make small improvements to the documentation of the kernel crate. It engages in a few different activities: - fixing trivial typos (commit #1), - updating code examples to better reflect an idiomatic coding style (commits #2,6), - increasing the consistency within the crate's documentation as a whole (commits #3,5,7,8,9,11,12), - adding more intra-doc links as well as srctree-relative links to C header files (commits #4,10). --- Changes in v3: - Adjusted word wrapping in "rust: locked_by: shorten doclink preview" to make use of the gained space. - Rebased with `rust-next`. - Link to v2: https://lore.kernel.org/lkml/20240123150112.124084-1-kernel@valentinobst.de/ Changes in v2: - Drop commit "rust: kernel: add doclinks with html tags" in response to review. - Fix another list item alignment issue pointed out during review of v1. Was added to commit "rust: kernel: fix multiple typos in documentation". - Commit "rust: error: move unsafe block into function call" is now "rust: error: improve unsafe code in example" and also rewords the SAFETY comment of the code example. - Did not add 'Reviewed-By' tags offered in v1 tags due to changes. - Link to v1: https://lore.kernel.org/lkml/20240116160141.165951-1-kernel@valentinobst.de/ --- Valentin Obst (12): rust: kernel: fix multiple typos in documentation rust: error: improve unsafe code in example rust: ioctl: end top-level module docs with full stop rust: kernel: add srctree-relative doclinks rust: str: use `NUL` instead of 0 in doc comments rust: str: move SAFETY comment in front of unsafe block rust: kernel: unify spelling of refcount in docs rust: kernel: mark code fragments in docs with backticks rust: kernel: add blank lines in front of code blocks rust: kernel: add doclinks rust: kernel: remove unneeded doclink targets rust: locked_by: shorten doclink preview rust/kernel/allocator.rs | 2 +- rust/kernel/error.rs | 10 ++---- rust/kernel/init.rs | 16 +++++----- rust/kernel/ioctl.rs | 6 ++-- rust/kernel/lib.rs | 2 +- rust/kernel/str.rs | 8 ++--- rust/kernel/sync/arc.rs | 14 ++++----- rust/kernel/sync/condvar.rs | 2 ++ rust/kernel/sync/lock.rs | 15 ++++++--- rust/kernel/sync/lock/spinlock.rs | 2 +- rust/kernel/sync/locked_by.rs | 7 +++-- rust/kernel/task.rs | 6 ++-- rust/kernel/types.rs | 3 ++ rust/kernel/workqueue.rs | 64 +++++++++++++++++++-------------------- 14 files changed, 84 insertions(+), 73 deletions(-) --- base-commit: f090f0d0eea9666a96702b29bc9a64cbabee85c5 change-id: 20240131-doc-fixes-v3-88af6c8c1777 Best regards,