From nobody Tue Nov 26 21:40:55 2024 Received: from mail-pg1-f173.google.com (mail-pg1-f173.google.com [209.85.215.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 755ED1D5144; Tue, 15 Oct 2024 15:52:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729007537; cv=none; b=dJQdvh1mwiXriZQWyCRXUU+nEO3qb3ArcVHTa8O+EC6j2DHlhK3yIfmzXzsVlPnDx6C1U6JYz8d/U5lXJ8tIHPIYDpj8ZqGbCPJ4cTDKupLcK3Ty63ZQ+C7SAwMZK+2HryHmuuT46rB/z/m9AaQItR/hHKQ0MdJm68dNbRx1Z4g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729007537; c=relaxed/simple; bh=xM3QmGPYOaP0UHcuOOhwp6Lr5ugRT16Ld7IeqHdYrpY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Gar5JE2jj9OVfPz0nEdWBsFfvJLA7EWWVJ1eqiEwTDL0K1hkRd2W0ABk8J/ujySEJNhs1t9zc9glexSvEFS3/vxa7FFehacDceG1osLRHelwn309iKjIfYoQ5mw3LkW4WKTmHiqdqzjZ5Xi+Fb9elQcfg7pLJXKsdHapG6AY5kA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=fm/cpHjS; arc=none smtp.client-ip=209.85.215.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="fm/cpHjS" Received: by mail-pg1-f173.google.com with SMTP id 41be03b00d2f7-7ea9739647bso1125414a12.0; Tue, 15 Oct 2024 08:52:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1729007535; x=1729612335; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Kg8eaAXWXzuM+DpadepOogSQbjhJV0Lyf//6lAln8tk=; b=fm/cpHjSDLXg+BokDe9wm3Z32qwlH3+hR2FDI3N/D8NeMAoX8c3IEW8EAEzrzR/qAQ bjn8PLghXIpuFEOsf1gzG+AVr0kHOJ/ilN5GOQlExWjQd2mhGez6c448Hg9u03FrvyDd d3uWe5y+8gyMZH4hyf2q792v5T5NKsLYrfsuFhRBwbmELt2dmgRBOt8eHPlIDtEGRI8f OenmTaANGyZn7V2CWBbIVX7g4xe5hI6EVbczbi/QRxU5V1dHUA5aLPTVAWCESR9zaGgL +9kKY14jPOtHzlVrOs4Km7FWwNpP1cD3ccP+giJErr8UUoKfC7Uy9QT8oMhtTIAUsZO2 AnuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729007535; x=1729612335; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Kg8eaAXWXzuM+DpadepOogSQbjhJV0Lyf//6lAln8tk=; b=hkF3Xt0aqhd8TBQIhbd+G/gba4G/m6KB6VxW5eTPqmYa19NLCaSJ3F2nBzXCoxOAFv fhwJp/t23Fk6CM5FNGmeVFViqxfGSmF7W+ZkLEXhTomGWseYGG26/Kq72bvDmB02I7GT g8AuR6eE6BnpnWSn5Fd5gWRf977Mj/2v9G08QJHN8NTOlefQWt1BQB36zEVN4eHkT6Vk 2/vwHdmYzWof3N7j4yHfijdTPKLIwE3BCiTGMcXayAUaNwB/tBdfOqDR9lUdyp63EOsQ oeH/kKRjbIKmULNE4+9GCYJTe63JO+fV6WXBHnLwFyq3KM/CbUQvEreRqbw5+C0dbA1w DChA== X-Forwarded-Encrypted: i=1; AJvYcCXTIYJOnoCtaot3Xpl9W/u2M8IlLByybU0HmOxl44+3f/+MLtmc0z2gOtk+JusHkcsk9ayJ7ZhWmIAsM0I=@vger.kernel.org X-Gm-Message-State: AOJu0YzRWlBc7IpmukKzS3KjrdiMYPWfXdrlCcwckONUZ6TbQc7naP+S RmrEK3oqhBHYQ7TSf+xnA242DX+gbTuzoH/c5VW1LYMrqvUPfUlA5kXxRwB2kE4= X-Google-Smtp-Source: AGHT+IFWuhRjKxvrrrxnTxB+PGHsgL6hk1OCr6VM2byohhsaEbwvaCicOUwbTwKEOs+nCqgndiR7uw== X-Received: by 2002:a05:6a21:3a83:b0:1d8:f4d9:790c with SMTP id adf61e73a8af0-1d905ecb8demr858673637.15.1729007535436; Tue, 15 Oct 2024 08:52:15 -0700 (PDT) Received: from Hridesh-ArchLinux.am.students.amrita.edu ([123.63.2.2]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71e774a2561sm1461753b3a.97.2024.10.15.08.52.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Oct 2024 08:52:14 -0700 (PDT) From: Hridesh MG To: rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Andreas Hindborg , Boqun Feng , Miguel Ojeda , Alex Gaynor , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Benno Lossin , Alice Ryhl , Trevor Gross , Andy Whitcroft , Joe Perches , Dwaipayan Ray , Lukas Bulwahn , Hridesh MG , Jens Axboe , Wedson Almeida Filho , Valentin Obst , Patrick Miller , Alex Mantel , Matt Gilbride , Aswin Unnikrishnan , Martin Rodriguez Reboredo , FUJITA Tomonori Subject: [PATCH v6 1/4] rust: make section names plural Date: Tue, 15 Oct 2024 21:21:36 +0530 Message-ID: X-Mailer: git-send-email 2.46.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Patrick Miller Update existing rust documentation section headers to use plural names. Suggested-by: Miguel Ojeda Link: https://github.com/Rust-for-Linux/linux/issues/1110 Signed-off-by: Patrick Miller Signed-off-by: Hridesh MG --- rust/kernel/init.rs | 2 +- rust/kernel/list/arc.rs | 2 +- rust/kernel/sync/arc.rs | 2 +- rust/macros/lib.rs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/rust/kernel/init.rs b/rust/kernel/init.rs index 25057cbed40b..2036846fc579 100644 --- a/rust/kernel/init.rs +++ b/rust/kernel/init.rs @@ -744,7 +744,7 @@ macro_rules! try_init { /// Asserts that a field on a struct using `#[pin_data]` is marked with `#= [pin]` ie. that it is /// structurally pinned. /// -/// # Example +/// # Examples /// /// This will succeed: /// ``` diff --git a/rust/kernel/list/arc.rs b/rust/kernel/list/arc.rs index 3483d8c232c4..e85d026ace4b 100644 --- a/rust/kernel/list/arc.rs +++ b/rust/kernel/list/arc.rs @@ -461,7 +461,7 @@ impl core::ops::DispatchFromDyn> for ListArc =20 /// A utility for tracking whether a [`ListArc`] exists using an atomic. /// -/// # Invariant +/// # Invariants /// /// If the boolean is `false`, then there is no [`ListArc`] for this value. #[repr(transparent)] diff --git a/rust/kernel/sync/arc.rs b/rust/kernel/sync/arc.rs index 9325cc5a16a4..d814032e0ccb 100644 --- a/rust/kernel/sync/arc.rs +++ b/rust/kernel/sync/arc.rs @@ -433,7 +433,7 @@ fn from(item: Pin>) -> Self { /// There are no mutable references to the underlying [`Arc`], and it rema= ins valid for the /// lifetime of the [`ArcBorrow`] instance. /// -/// # Example +/// # Examples /// /// ``` /// use kernel::sync::{Arc, ArcBorrow}; diff --git a/rust/macros/lib.rs b/rust/macros/lib.rs index a626b1145e5c..3879e1162866 100644 --- a/rust/macros/lib.rs +++ b/rust/macros/lib.rs @@ -307,7 +307,7 @@ pub fn pinned_drop(args: TokenStream, input: TokenStrea= m) -> TokenStream { /// literals (lifetimes and documentation strings are not supported). Ther= e is a difference in /// supported modifiers as well. /// -/// # Example +/// # Examples /// /// ```ignore /// use kernel::macro::paste; --=20 2.46.1 From nobody Tue Nov 26 21:40:55 2024 Received: from mail-pf1-f175.google.com (mail-pf1-f175.google.com [209.85.210.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 603A11CBA18; Tue, 15 Oct 2024 15:52:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.175 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729007551; cv=none; b=s6JoW4aYR9FWo1JaJDBOHDm2V3JHcNb5hrctdskirkvOXCDv7iLATuxPqafGb/5i1rEkN3VeHMJrzOdtivpl3Rd5RsoPhzNmX4H8to5TNXD5RsaBlH2SLcfOwxuB4CfCwh1Zjhhwf97QrrFL4xs+8yJWGXuTOJteclY7u+IVxSo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729007551; c=relaxed/simple; bh=+Fp5ImgtvT/g8YQzRUmLKeuXeZI3mdgbhmU4ODD+i9w=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=lr3ey8uPcYVXbguGgzSuj7MAxOz2OCtNWdmsEHnWEjIDWtwuItpRLYQY4Vatc2KGVQlRz8tAGkIFEkGDx+6f/R8JoV16VWwdtsDF6tb9zHxVkWHMrKi5FLD/MTUsvzuAuguOUbN+mcZEYg2RX+Hmj0Es4ocRIlwgbbA/Fdw3oBg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=JrC/+mh3; arc=none smtp.client-ip=209.85.210.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="JrC/+mh3" Received: by mail-pf1-f175.google.com with SMTP id d2e1a72fcca58-71e6f085715so1566128b3a.2; Tue, 15 Oct 2024 08:52:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1729007549; x=1729612349; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=351WEUHsLBNMjnwFGj/YaHLkFIDuudwz/R8NEtbQqd8=; b=JrC/+mh3L4SerHjvLBcJycfOBmuBNtEHa09H4KxLtsFHkxw9yEL+VGrAEY0fCdocRp M3ITqFUR/LDCjsxHV/zGQMcW4x8k6IIWQhpUr63TnddH0O6FLo69WBy60nrnY7HrPakf 1ef547Ro8IR+jGULnmUAFjkz8D6CGzG1crKVqHHnV97U0hGr4btpCwDF56d/S2KRVgbe J6KGKI7uMP1nfh2FvKb6jtcMkPUp37upBQXPW4Vs0mYAgUyeKc5cRI1C3DFyTDjR1Bcn Z/ttkcuwJoRu7tihiAdbCOnSp5a+eJDpXIyR5kpAq1rvmO9YxRdQ9j23qs5fzVZyI7se jPbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729007549; x=1729612349; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=351WEUHsLBNMjnwFGj/YaHLkFIDuudwz/R8NEtbQqd8=; b=M9KrQoCKP0nQ8r41sAqBj16vrTBmw7jqyLd4YGqWBnMNglMZMaOwd7E1CgxewUt6C7 qU9b9SGw8+zTgtfuhFiSgH75TKtVpP6i0MZI+9LclEUv8FPgWlUjqkJ5s2HLQcrPaM18 ODgVOw2jmvOpdW/6A8aG74TQfqQvR8My68WMiC64dwTkoBaXSFhy9NWttUkpg+wodKOp 6F2UbtzrBbKXHg7woratbkB3xlcRWIj9lCKjAY7rHf54fN7n30wdw+ihL2DsdVzyLr/F /RINiEqSwd7XOqVbXAmnsD4pl+bGTXMiyiFe+GBRuDGfme0Hdw4kdpAxPbAGRuWlppZY LCVw== X-Forwarded-Encrypted: i=1; AJvYcCWJcjF8k3G1P73u+hmBs9A5xCwThMiEYOqnHW6mfIYHQ5qSbm6ZLtpV+9mmjJ5qQhCefoGm3gVTqUaGleg=@vger.kernel.org X-Gm-Message-State: AOJu0YwW6mOL8JueoSHd+AZKFFK6U40iAVCHnajca28eu0K4TFdRbrd+ i2dpNacMZh3sdm+cUPXMbzWfjjJWhI+k3+35u+EdjjBASUgYVj2ssHGZP6l2ulE= X-Google-Smtp-Source: AGHT+IHDO1X3FNYdrJ+gs37IQiBKhlQ9JngCoqgyknUGtlhXnGGzA/uxDLJVfWLQCuIdCStO++H+3Q== X-Received: by 2002:a05:6a00:1250:b0:71e:fb4:6c98 with SMTP id d2e1a72fcca58-71e4c1cfc05mr22451433b3a.23.1729007549172; Tue, 15 Oct 2024 08:52:29 -0700 (PDT) Received: from Hridesh-ArchLinux.am.students.amrita.edu ([123.63.2.2]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71e774a2561sm1461753b3a.97.2024.10.15.08.52.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Oct 2024 08:52:28 -0700 (PDT) From: Hridesh MG To: rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Andreas Hindborg , Boqun Feng , Miguel Ojeda , Alex Gaynor , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Benno Lossin , Alice Ryhl , Trevor Gross , Andy Whitcroft , Joe Perches , Dwaipayan Ray , Lukas Bulwahn , Hridesh MG , Jens Axboe , Wedson Almeida Filho , Valentin Obst , Patrick Miller , Alex Mantel , Matt Gilbride , Aswin Unnikrishnan , Martin Rodriguez Reboredo , FUJITA Tomonori Subject: [PATCH v6 2/4] checkpatch: warn on known non-plural rust doc headers Date: Tue, 15 Oct 2024 21:21:37 +0530 Message-ID: <088495172736416665325802594aeb6996159f9a.1728818976.git.hridesh699@gmail.com> X-Mailer: git-send-email 2.46.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Patrick Miller Add a check for documentation in rust files. Warn if certain known documentation headers are not plural. The rust maintainers prefer document headers to be plural. This is to enforce consistency as well as to protect against errors when additions are made. For instance, if a header says "Example" for a single example, adding a second example may cause confusion. The maintainers wish to avoid reminding users to update their documentation for such cases. Suggested-by: Miguel Ojeda Link: https://github.com/Rust-for-Linux/linux/issues/1110 Signed-off-by: Patrick Miller Signed-off-by: Hridesh MG --- v1: https://lore.kernel.org/rust-for-linux/2024090628-bankable-refusal-5f20= @gregkh/T/#t v2: https://lore.kernel.org/rust-for-linux/92be0b48-cde9-4241-8ef9-7fe4d7c4= 2466@proton.me/T/#t - fixed whitespace that was formatted due to editor settings=20 v3: https://lore.kernel.org/rust-for-linux/da34f89c-f94c-43aa-946c-57fec359= 7974@proton.me/T/#t - move && to previous line and remove whitespace in WARN per Joe Perches - reformat following C coding style v4: https://lore.kernel.org/rust-for-linux/20240914181618.837227-2-paddymil= ls@proton.me/ - add @fix option (credit: Joe Perches) - add Error to list of checked section headers - make check for rust file its own if statement because more rust checks are planned v5: https://lore.kernel.org/rust-for-linux/20241002022749.390836-2-paddymil= ls@proton.me/ - merged Hridesh MG's patch[1] to check against consecutive empty rustdoc= comments - revised Hridesh MG's patch to match against $prevrawline being new or existing - added fix to Hridesh MG's patch v6: - undid the merging of Hridesh MG's patch - revised opening comment to be more explicit per Miguel Ojeda - The --fix option was throwing an uninitialized variable error, fixed it and made it automatically convert the headers to plural. [1]: https://lore.kernel.org/rust-for-linux/bf6544faba2b53ce901b2e031f3d944= babcc7018.1727606659.git.hridesh699@gmail.com/ --- scripts/checkpatch.pl | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 4427572b2477..c390a9926cd5 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -3900,6 +3900,19 @@ sub process { "Avoid using '.L' prefixed local symbol names for denoting a range= of code via 'SYM_*_START/END' annotations; see Documentation/core-api/asm-= annotations.rst\n" . $herecurr); } =20 +# checks that only apply to Rust files + if ($realfile =3D~ /\.rs$/) { + # check that document section headers are plural + if ($rawline =3D~ /^\+\s*\/\/\/\s+#+\s+(Example|Error|Guarantee|Invaria= nt|Panic)\s*$/i) { + if (WARN("RUST_DOC_HEADER", + "Rust doc section names should be plural\n" . $herecurr) && + $fix) { + my $header =3D $1; + $fixed[$fixlinenr] =3D~ s/\b$header\b/ucfirst(lc($header)) . 's'/e; + } + } + } + # check we are in a valid source file C or perl if not then ignore this hu= nk next if ($realfile !~ /\.(h|c|pl|dtsi|dts)$/); =20 --=20 2.46.1 From nobody Tue Nov 26 21:40:55 2024 Received: from mail-oa1-f51.google.com (mail-oa1-f51.google.com [209.85.160.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 782581CBA18; Tue, 15 Oct 2024 15:52:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729007563; cv=none; b=CgZqA9c9UU+EvgOjS/Bg7IUay8dzJCQgBeQgEYkk84PqKbM1j5S+yAJXreYTzk7+GrlP1GIkWvqhD9S6SiXI+33sILblFvxyJO3wWvFKTZ6bxyPPIpwm5/UleY+DLUzwbejE5GJ0tdjvQzO+FDuv5YjK5wlaelwvulvoPqSc8GU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729007563; c=relaxed/simple; bh=uN1REU0Di5I3mklfKwwzumFIR1apUk4/wC9sJd6e83w=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=QtcE4B//cs4PZxhOkxYxsAhKAFRmrO7wp+ddI0bO/h3yu1DvdUHcT6UwCXBDF+K89K3oK+LfvfgmKsnmJ6NvEd9J1ACUE+Wk+AJBB+P3aR2RI9IhxDkC93UWcVMzxW5jA+rx2Yd0y8d5GwsXLFGrVPiuCGBrqOyGyuFYFk77i6I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=XU4OCjBi; arc=none smtp.client-ip=209.85.160.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="XU4OCjBi" Received: by mail-oa1-f51.google.com with SMTP id 586e51a60fabf-288642376bcso2452534fac.1; Tue, 15 Oct 2024 08:52:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1729007561; x=1729612361; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=GrJdz13VBM6PnyfIrWk3YM9luzWUsilA55w4yeLkO7s=; b=XU4OCjBipdYW0yE0++7DKe4MZF9gaTMeZF3/JI/DYzlYV1qEGDdAkazashJv16zNsn Md4MdIgrQlCAff6nuJnst3RdwxGi1+Fx9fc18/WVuVpu/6vqhj8/87QdQIdKkTPN9aRO wmin+pP/LJEWmD3T4dBpQE/zZVcF1uXADf2Z10EHGRMJzWhTwKHVDZmCcPlWT0AZMfGw asgJd1eRGw181bzirm5p95yyqwKVIuzcsDeUgUAKXP8QCVjOKVCRUJAeS4QxnX+bZrBB n3XGQS0pK2VkMHGEEdgfcGXxvbKL4/qV+HJ1Z++5wxNLhzIOU+NUqQ9DMEhw43JtZDrL zEeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729007561; x=1729612361; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GrJdz13VBM6PnyfIrWk3YM9luzWUsilA55w4yeLkO7s=; b=Qh3W5ewXL50AMXrNIoTW2nEn2IvA0GlJSKIVA6Og7oBpRJ4yQmpf0Eym2XJTlUGxAJ VA3xsjptY9+s7QJQESYLGPmVxDVSJ1JmP7jXJELk7XMHKz2b5YnTVZuW8HtJ1iXjaEtK xSLsOOV2cMLHvItu7NNnYrZL5Q9NU0YssOGfSVub3k1bxomFldq6COpoyn8RskunMSkT cy9G0ILyDhaG31aQoBfl+uafTPaw+wUxKhVS6uiyIu+GkpHUB1HvMJChlgwOdf5Jjss6 m6DFR5EwUAFN9GpnrWnFXePHmAI3WoJMlBBhA6XJc5ymh0S6BYIdajZjQG8cTEBm/HhH 9dKA== X-Forwarded-Encrypted: i=1; AJvYcCVfFfPBVpZ+0Hs/5KeHZDIDAYGvXnDmM2m3gUq3oOt6inDPJUWK3Q6CdtcS1qxaAnn8RXI3/2yFe0omyh8=@vger.kernel.org X-Gm-Message-State: AOJu0Yx+wdTXDiI/XDhewob5CFA4VESAdrBAEOeLnYRCwPmqYARt1sLm pGwKOyXKIfbU0gBsLdby/5KKo/Ly2Ixime/0ZYxaGR/klBcMkcdkrQp8obUYh20= X-Google-Smtp-Source: AGHT+IGvIvlkwmUzaoU7B8CSaATLdDpPybawEbZcgXCffHNDVSH7wRChKyPeweYtqsa/fce2pakVGA== X-Received: by 2002:a05:6870:ac26:b0:288:2b44:5577 with SMTP id 586e51a60fabf-2888734357amr6494708fac.18.1729007561144; Tue, 15 Oct 2024 08:52:41 -0700 (PDT) Received: from Hridesh-ArchLinux.am.students.amrita.edu ([123.63.2.2]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71e774a2561sm1461753b3a.97.2024.10.15.08.52.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Oct 2024 08:52:40 -0700 (PDT) From: Hridesh MG To: rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Andreas Hindborg , Boqun Feng , Miguel Ojeda , Alex Gaynor , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Benno Lossin , Alice Ryhl , Trevor Gross , Andy Whitcroft , Joe Perches , Dwaipayan Ray , Lukas Bulwahn , Hridesh MG , Jens Axboe , Wedson Almeida Filho , Valentin Obst , Patrick Miller , Alex Mantel , Matt Gilbride , Aswin Unnikrishnan , Martin Rodriguez Reboredo , FUJITA Tomonori Subject: [PATCH v6 3/4] rust: kernel: clean up empty `///` lines Date: Tue, 15 Oct 2024 21:21:38 +0530 Message-ID: <5f42e19fe52adc07d44d1fde225e8d933fde54f8.1728818976.git.hridesh699@gmail.com> X-Mailer: git-send-email 2.46.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Remove unnecessary empty `///` lines in the rust docs. Suggested-by: Miguel Ojeda Link: https://github.com/Rust-for-Linux/linux/issues/1109 Reviewed-by: Trevor Gross Reviewed-by: Alice Ryhl Signed-off-by: Hridesh MG --- Changelog: v1->v2 - Fixed typo in commit title and description - Removed backslashes in kernel::block::mq::Request - Link to v1: https://lore.kernel.org/rust-for-linux/20240909161749.147076-= 1-hridesh699@gmail.com/ v2->v3 - Fixed From: tag in patch header - Link to v2: https://lore.kernel.org/rust-for-linux/aa1b4059dfac001945745d= b02b6f6d9db2e5d1cb.1726072795.git.hridesh699@gmail.com/ No changes from v3->v6 --- rust/kernel/block/mq/request.rs | 1 - rust/kernel/rbtree.rs | 1 - 2 files changed, 2 deletions(-) diff --git a/rust/kernel/block/mq/request.rs b/rust/kernel/block/mq/request= .rs index a0e22827f3f4..313334b1bf18 100644 --- a/rust/kernel/block/mq/request.rs +++ b/rust/kernel/block/mq/request.rs @@ -30,7 +30,6 @@ /// D) Request is owned by driver with more than one `ARef` in existence /// (refcount > 2) /// -/// /// We need to track A and B to ensure we fail tag to request conversions = for /// requests that are not owned by the driver. /// diff --git a/rust/kernel/rbtree.rs b/rust/kernel/rbtree.rs index d03e4aa1f481..c0730c1f9707 100644 --- a/rust/kernel/rbtree.rs +++ b/rust/kernel/rbtree.rs @@ -1034,7 +1034,6 @@ fn next(&mut self) -> Option { =20 /// A memory reservation for a red-black tree node. /// -/// /// It contains the memory needed to hold a node that can be inserted into= a red-black tree. One /// can be obtained by directly allocating it ([`RBTreeNodeReservation::ne= w`]). pub struct RBTreeNodeReservation { --=20 2.46.1 From nobody Tue Nov 26 21:40:55 2024 Received: from mail-pg1-f179.google.com (mail-pg1-f179.google.com [209.85.215.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0018D1DD0D8; Tue, 15 Oct 2024 15:52:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729007574; cv=none; b=ZfUXRhX0LzeJhdB5/j4X6g1GlMSBCrzBC6MC9eE3rEz7fQHwZWhYpXSnUoMaq3Xy6BrOeFnXibdWvist2r9J2VLoSJmXNO8LVLA7jSskd85w9LEJbA1RVPv2px54QCIikaYzubMKLVdjjz/Bkr224+X5wYe6FDShKKFQ8NfCu6Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729007574; c=relaxed/simple; bh=8Dxngxm3PKoGPubk+nvP9wf4wpuZgaDMrU6hT7hubVo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=QhIskTD5AY3LQJ3A5o5RaJfzhS1Y+8kD99wI7p/VbBBV+ta3D11meWcXc/vairMjScuqktsnEjBc+ZoqXYh/xtBUWKqURpI7k+vmBR2romix6tb6VUILO2oxwyqpQ18o2fVZ4EgjvITsHAr/WNNE2YVsdQeVZX1LXUURsdXRY2k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=euFUF/Du; arc=none smtp.client-ip=209.85.215.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="euFUF/Du" Received: by mail-pg1-f179.google.com with SMTP id 41be03b00d2f7-7ea7ad1e01fso1819301a12.0; Tue, 15 Oct 2024 08:52:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1729007572; x=1729612372; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=/sQCvJD715/TLzicIGZLXAFOT6C/C41EPnvD4MXjx14=; b=euFUF/DueaBiGgF2D2jSpPI+aESB7pou4XNGYZ7NP7xel6Fg9n9jBc8puZcpH0fwQ/ Ix2PbIj8PA5U2RqdVUiVze73gWry75GIuOQASOH5LqdrNVT0IH1x9ppmteUJMGcfV8XP sBHuT3YwdJW9a/eHLqFvHjn770TrqNed7/ekT1S3+BI+4/RDrn+ZvgOv4dQ9Wr2FZ4p5 wr6LHnYvrn11l8wDRllEFw8X6FyTq6zwPX9bOsujB1bK6Kq13+dIQA9nEtLb/rLWLYsf jJuYhL9nZXWxjzhfMiWZ9meLOvOvjz4NKQvcb9cKZliQxYS1xUeVQO8QR8tx9m8E0t+w UO8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729007572; x=1729612372; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/sQCvJD715/TLzicIGZLXAFOT6C/C41EPnvD4MXjx14=; b=cq3bf82ufkHApRWPK++yqxCuR3nuRw6eSv4PPjQjDpqJaBDaE6PaPOTuwkMgpEF/j8 IBXco2aMiyRDibMHYgN45cyogcdNyjKv4RZrDb9Qqr2onAej32gpWj/IPRp2VSQGE0Tg 7z9pQnflt7KmeOMjdD0UxyuKWsVhXYrLDkgAWyKOUm4HD54r2p5F7lO0KcsOjnDkzPEL uUIUw4CPdzmw27+qBzXF4WcvMBsNpnewZ2d6RWCGmFghhsrpfJ+dSP+RqlkAvqWiIiH6 GG43xoiyp69uu351KcjJuqXFu6XIjT8ffXgJW5qWkiwEAUOw+pbbIxdT21jQ63gzApbm hv5g== X-Forwarded-Encrypted: i=1; AJvYcCUY7FglM/Dkt0/XuhNLpBNPGfUr/8dYp65r9D29u5lEuDod9QBvDFlr836Isb7X/x+9JHxXkl8VHItZ754=@vger.kernel.org X-Gm-Message-State: AOJu0Yy32Xu9d0ZEt4ELda329jI0LIRJDkQ42J777lQIcsaJzojXb92c CYI7n9gzjP+M0ZuCf0KTfVsX9O462ZRGwmuJ+t0on6AIOD99fJkEfXje6W6JuoA= X-Google-Smtp-Source: AGHT+IFYPaqAglwoiW7FHEIVR4+5UzMRm39kklNaQpPpIeLzKJbmzNPx6bNLFhbFFP3WXff/8vy8sg== X-Received: by 2002:a05:6a21:a4c2:b0:1d5:143d:5197 with SMTP id adf61e73a8af0-1d8bc8066e8mr20649901637.6.1729007571724; Tue, 15 Oct 2024 08:52:51 -0700 (PDT) Received: from Hridesh-ArchLinux.am.students.amrita.edu ([123.63.2.2]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71e774a2561sm1461753b3a.97.2024.10.15.08.52.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Oct 2024 08:52:51 -0700 (PDT) From: Hridesh MG To: rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Andreas Hindborg , Boqun Feng , Miguel Ojeda , Alex Gaynor , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Benno Lossin , Alice Ryhl , Trevor Gross , Andy Whitcroft , Joe Perches , Dwaipayan Ray , Lukas Bulwahn , Hridesh MG , Jens Axboe , Wedson Almeida Filho , Valentin Obst , Patrick Miller , Alex Mantel , Matt Gilbride , Aswin Unnikrishnan , Martin Rodriguez Reboredo , FUJITA Tomonori Subject: [PATCH v6 4/4] checkpatch: warn on empty rust doc comments Date: Tue, 15 Oct 2024 21:21:39 +0530 Message-ID: <32382c55dbcb6482d6e686d541c2e15b282908cd.1728818976.git.hridesh699@gmail.com> X-Mailer: git-send-email 2.46.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add a check to warn if there are consecutive empty `///` lines in rust files. Suggested-by: Miguel Ojeda Link: https://github.com/Rust-for-Linux/linux/issues/1109 Signed-off-by: Hridesh MG Acked-by: Miguel Ojeda --- v2: https://lore.kernel.org/rust-for-linux/7877d23adba22e2f89a61efc129ecf1b= 0627510b.1726072795.git.hridesh699@gmail.com/ - new patch v3: https://lore.kernel.org/rust-for-linux/bf6544faba2b53ce901b2e031f3d944b= abcc7018.1727606659.git.hridesh699@gmail.com/ - no changes v6: - added --fix support which deletes the unnecessary line --- scripts/checkpatch.pl | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index c390a9926cd5..baadc345bf87 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -3911,6 +3911,15 @@ sub process { $fixed[$fixlinenr] =3D~ s/\b$header\b/ucfirst(lc($header)) . 's'/e; } } + + # check for consecutive empty rustdoc lines + if ($rawline =3D~ /^\+\s*\/\/\/$/ && $prevrawline =3D~ /^\+?\s*\/\/\/$/= ) { + if (WARN("RUST_DOC_EMPTY", + "avoid using consecutive empty rustdoc comments\n" . $herecur= r) && + $fix) { + fix_delete_line($fixlinenr, $rawline); + } + } } =20 # check we are in a valid source file C or perl if not then ignore this hu= nk --=20 2.46.1