From nobody Wed Oct 8 09:02:18 2025 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 607A81FDD; Tue, 1 Jul 2025 08:57:18 +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=1751360238; cv=none; b=YBVGXakol41zZdpH4KRTTfuC8kyeH2VPDsb4BdWxbiBtf/FRDu+ktx47K/3DO1LwIJVQ5aLcirzjK6gBVAnt8Ms/RIornh9jQCXobFnO+Jurx4G6qEs7m4GC4IJGPOFt4AAi/p8UaqPbjz5HhFbuQInQmO5eWBywFY8gL3D1wIA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751360238; c=relaxed/simple; bh=WZgQ14D22dPLNcKEi9IjqUPAXlhupD02zXCi6Noet+Y=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=AuaSUXeoaFR3m+3bWjfwYzk/WYc+/DioS1iL6MfuYc7FYoFMl+WbuzhGhltgbWeFiIwVFiFUXDQSqMlcxH9XZfXWZ730VvwIjFNWC3GR/I9MDze7hGP0LSVeLC1yDlOcDRvbYe3qXQ6n0OtLEZYLUIVxyRrWhxa52SutbJwFbJ4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=J2ODeEEg; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="J2ODeEEg" Received: by smtp.kernel.org (Postfix) with ESMTPS id 06881C4CEFB; Tue, 1 Jul 2025 08:57:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1751360238; bh=WZgQ14D22dPLNcKEi9IjqUPAXlhupD02zXCi6Noet+Y=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=J2ODeEEgPNRDu9oYlBwdaulZ8f/3Ww5Kk8nUVcACl0lyxIWOq+C/F3UiWDFWJMfEs qmMj5jjkM5McIu4DeeV+9/Wdmg3f6Fe1JUKFpu10Fp0gVuCFe+ToHWKZbe8sVawX1w byhS/y3cnV0ir+h0ZV1cP1cD4on9v0P6HM4oCiqMRgKHqWcf673UHhTDoz2tTVrCnw 76BI6mYQtpnl3aa6hrEq/84gz2YEsTPXjzGjxDszyjBuMAivuPWvsUal1uY2alEabK obhrKcGhqsdLTTN0cpBcJ2Vxb7WcK6JzG8m9gigEnRkOeUqC6iJh3de3iM1k+0KEC2 OUWyGX7N4ilgg== 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 F045BC8303D; Tue, 1 Jul 2025 08:57:17 +0000 (UTC) From: Joel Granados Date: Tue, 01 Jul 2025 10:56:46 +0200 Subject: [PATCH 5/6] docs: Replace spaces with tabs in check-sysctl-docs Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250701-jag-sysctldoc-v1-5-936912553f58@kernel.org> References: <20250701-jag-sysctldoc-v1-0-936912553f58@kernel.org> In-Reply-To: <20250701-jag-sysctldoc-v1-0-936912553f58@kernel.org> To: Kees Cook , Jonathan Corbet , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-doc@vger.kernel.org, linux-riscv@lists.infradead.org, Joel Granados X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=6467; i=joel.granados@kernel.org; h=from:subject:message-id; bh=WZgQ14D22dPLNcKEi9IjqUPAXlhupD02zXCi6Noet+Y=; b=owJ4nAHtARL+kA0DAAoBupfNUreWQU8ByyZiAGhjouvcIQVcgTjcMwYVUzjN9clCy+sHEF9p5 hcxDDX/MlPGXokBswQAAQoAHRYhBK5HCVcl5jElzssnkLqXzVK3lkFPBQJoY6LrAAoJELqXzVK3 lkFPCLgL/0lRvZ0dCLUwkAUFUrId8D+HSxIbi5ts9LpkVtQN+/aLjDaApT5YXFq0LvXbe7+mGXF chBdiVr0jGNHhpELcWG5iXprYpknA2Ef0xPSNy/FEjuAymi4UFZuxSHwzfUZmytK/dyrodTb8oM j84G7XarKoIMoD8owzE8lI8n6O8BZ3u4C83ry8tepNb3DPYLA5HO7Dc/wcxTdrpc+sat11Vyg3S egynAQEAPwKaWvl2jkiZs7yJ8abu1jBagkLlFkcHi1K0r4TDeYl2GsjM7lu7aRNKcYXo8kXdPhu o0JiBR/V3vn4kmxpBX/sKDEHSfymiLrg2cGF28Q82vUVQod/lFPmLv9YijvgXRQt3jrurLAvQOy 0CFHlL1pTRaGINjgYDR74msCNjQtwWQ4OWAXAMaZNiCqcXu4w2dQfpo292e8loG23FwWq7Onte1 Iocgogu1KdbcEKBPjlPLGqh1AsbOCxy70cbzHq+vPwncrQDhzJUas7/ADAPU6oCpH9zLfx1r6F6 kU= X-Developer-Key: i=joel.granados@kernel.org; a=openpgp; fpr=F1F8E46D30F0F6C4A45FF4465895FAAC338C6E77 X-Endpoint-Received: by B4 Relay for joel.granados@kernel.org/default with auth_id=239 Remove the combination of spaces and tabs in favor of just tabs. Signed-off-by: Joel Granados --- scripts/check-sysctl-docs | 163 +++++++++++++++++++++++-------------------= ---- 1 file changed, 81 insertions(+), 82 deletions(-) diff --git a/scripts/check-sysctl-docs b/scripts/check-sysctl-docs index 3166012b9c6ea4435dc77afaadcff3a4944b1ca8..910fd8a9a2684aa709c1572e24f= c94d52b093381 100755 --- a/scripts/check-sysctl-docs +++ b/scripts/check-sysctl-docs @@ -13,10 +13,10 @@ # Specify -vdebug=3D1 to see debugging information =20 BEGIN { - if (!table) { + if (!table) { print "Please specify the table to look for using the table variable" > "= /dev/stderr" exit 1 - } + } =20 # Documentation title skiplist skiplist[0] =3D "^Documentation for" @@ -43,23 +43,23 @@ BEGIN { =20 # Remove punctuation from the given value function trimpunct(value) { - while (value ~ /^["&]/) { - value =3D substr(value, 2) - } - while (value ~ /[]["&,}]$/) { - value =3D substr(value, 1, length(value) - 1) - } - return value + while (value ~ /^["&]/) { + value =3D substr(value, 2) + } + while (value ~ /[]["&,}]$/) { + value =3D substr(value, 1, length(value) - 1) + } + return value } =20 # Print the information for the given entry function printentry(entry) { - seen[entry]++ - printf "* %s from %s", entry, file[entry] - if (documented[entry]) { - printf " (documented)" - } - print "" + seen[entry]++ + printf "* %s from %s", entry, file[entry] + if (documented[entry]) { + printf " (documented)" + } + print "" } =20 =20 @@ -71,105 +71,104 @@ FNR =3D=3D NR && /^=3D+$/ { } } =20 - # The previous line is a section title, parse it - $0 =3D prevline - if (debug) print "Parsing " $0 - inbrackets =3D 0 - for (i =3D 1; i <=3D NF; i++) { - if (length($i) =3D=3D 0) { - continue + # The previous line is a section title, parse it + $0 =3D prevline + if (debug) print "Parsing " $0 + inbrackets =3D 0 + for (i =3D 1; i <=3D NF; i++) { + if (length($i) =3D=3D 0) { + continue + } + if (!inbrackets && substr($i, 1, 1) =3D=3D "(") { + inbrackets =3D 1 + } + if (!inbrackets) { + token =3D trimpunct($i) + if (length(token) > 0 && token !=3D "and") { + if (debug) print trimpunct($i) + documented[trimpunct($i)]++ + } + } + if (inbrackets && substr($i, length($i), 1) =3D=3D ")") { + inbrackets =3D 0 + } } - if (!inbrackets && substr($i, 1, 1) =3D=3D "(") { - inbrackets =3D 1 - } - if (!inbrackets) { - token =3D trimpunct($i) - if (length(token) > 0 && token !=3D "and") { - if (debug) print trimpunct($i) - documented[trimpunct($i)]++ - } - } - if (inbrackets && substr($i, length($i), 1) =3D=3D ")") { - inbrackets =3D 0 - } - } } =20 FNR =3D=3D NR { - prevline =3D $0 - next + prevline =3D $0 + next } =20 =20 # Stage 2: process each file and find all sysctl tables BEGINFILE { - delete entries - curtable =3D "" - curentry =3D "" - delete vars - if (debug) print "Processing file " FILENAME + delete entries + curtable =3D "" + curentry =3D "" + delete vars + if (debug) print "Processing file " FILENAME } =20 /^static( const)? struct ctl_table/ { - match($0, /static( const)? struct ctl_table ([^][]+)/, tables) - curtable =3D tables[2] - if (debug) print "Processing table " curtable + match($0, /static( const)? struct ctl_table ([^][]+)/, tables) + curtable =3D tables[2] + if (debug) print "Processing table " curtable } =20 /^};$/ { - curtable =3D "" - curentry =3D "" - delete vars + curtable =3D "" + curentry =3D "" + delete vars } =20 curtable && /\.procname[\t ]*=3D[\t ]*".+"/ { - match($0, /.procname[\t ]*=3D[\t ]*"([^"]+)"/, names) - curentry =3D names[1] - if (debug) print "Adding entry " curentry " to table " curtable - entries[curtable][curentry]++ - file[curentry] =3D FILENAME + match($0, /.procname[\t ]*=3D[\t ]*"([^"]+)"/, names) + curentry =3D names[1] + if (debug) print "Adding entry " curentry " to table " curtable + entries[curtable][curentry]++ + file[curentry] =3D FILENAME } =20 curtable && /UCOUNT_ENTRY.*/ { - match($0, /UCOUNT_ENTRY\("([^"]+)"\)/, names) - curentry =3D names[1] - if (debug) print "Adding entry " curentry " to table " curtable - entries[curtable][curentry]++ - file[curentry] =3D FILENAME + match($0, /UCOUNT_ENTRY\("([^"]+)"\)/, names) + curentry =3D names[1] + if (debug) print "Adding entry " curentry " to table " curtable + entries[curtable][curentry]++ + file[curentry] =3D FILENAME } =20 /register_sysctl.*/ { - match($0, /register_sysctl(|_init|_sz)\("([^"]+)" *, *([^,)]+)/, table= s) - if (debug) print "Registering table " tables[3] " at " tables[2] - if (tables[2] =3D=3D table) { - for (entry in entries[tables[3]]) { - printentry(entry) - } - } + match($0, /register_sysctl(|_init|_sz)\("([^"]+)" *, *([^,)]+)/, tables) + if (debug) print "Registering table " tables[3] " at " tables[2] + if (tables[2] =3D=3D table) { + for (entry in entries[tables[3]]) { + printentry(entry) + } + } } =20 /kmemdup.*/ { - match($0, /([^ \t]+) *=3D *kmemdup\(([^,]+) *,/, names) - if (debug) print "Found variable " names[1] " for table " names[2] - if (names[2] in entries) { - vars[names[1]] =3D names[2] - } + match($0, /([^ \t]+) *=3D *kmemdup\(([^,]+) *,/, names) + if (debug) print "Found variable " names[1] " for table " names[2] + if (names[2] in entries) { + vars[names[1]] =3D names[2] + } } =20 /__register_sysctl_table.*/ { - match($0, /__register_sysctl_table\([^,]+, *"([^"]+)" *, *([^,]+)/, ta= bles) - if (debug) print "Registering variable table " tables[2] " at " tables= [1] - if (tables[1] =3D=3D table && tables[2] in vars) { - for (entry in entries[vars[tables[2]]]) { - printentry(entry) - } - } + match($0, /__register_sysctl_table\([^,]+, *"([^"]+)" *, *([^,]+)/, table= s) + if (debug) print "Registering variable table " tables[2] " at " tables[1] + if (tables[1] =3D=3D table && tables[2] in vars) { + for (entry in entries[vars[tables[2]]]) { + printentry(entry) + } + } } =20 END { - for (entry in documented) { - if (!seen[entry]) { - print "No implementation for " entry + for (entry in documented) { + if (!seen[entry]) + print "No implementation for " entry } - } } --=20 2.47.2