mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-04 20:19:47 +08:00
docs: Replace spaces with tabs in check-sysctl-docs
Remove the combination of spaces and tabs in favor of just tabs. Signed-off-by: Joel Granados <joel.granados@kernel.org>
This commit is contained in:
parent
30ec9fde45
commit
999aab7f56
@ -13,10 +13,10 @@
|
|||||||
# Specify -vdebug=1 to see debugging information
|
# Specify -vdebug=1 to see debugging information
|
||||||
|
|
||||||
BEGIN {
|
BEGIN {
|
||||||
if (!table) {
|
if (!table) {
|
||||||
print "Please specify the table to look for using the table variable" > "/dev/stderr"
|
print "Please specify the table to look for using the table variable" > "/dev/stderr"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
# Documentation title skiplist
|
# Documentation title skiplist
|
||||||
skiplist[0] = "^Documentation for"
|
skiplist[0] = "^Documentation for"
|
||||||
@ -43,23 +43,23 @@ BEGIN {
|
|||||||
|
|
||||||
# Remove punctuation from the given value
|
# Remove punctuation from the given value
|
||||||
function trimpunct(value) {
|
function trimpunct(value) {
|
||||||
while (value ~ /^["&]/) {
|
while (value ~ /^["&]/) {
|
||||||
value = substr(value, 2)
|
value = substr(value, 2)
|
||||||
}
|
}
|
||||||
while (value ~ /[]["&,}]$/) {
|
while (value ~ /[]["&,}]$/) {
|
||||||
value = substr(value, 1, length(value) - 1)
|
value = substr(value, 1, length(value) - 1)
|
||||||
}
|
}
|
||||||
return value
|
return value
|
||||||
}
|
}
|
||||||
|
|
||||||
# Print the information for the given entry
|
# Print the information for the given entry
|
||||||
function printentry(entry) {
|
function printentry(entry) {
|
||||||
seen[entry]++
|
seen[entry]++
|
||||||
printf "* %s from %s", entry, file[entry]
|
printf "* %s from %s", entry, file[entry]
|
||||||
if (documented[entry]) {
|
if (documented[entry]) {
|
||||||
printf " (documented)"
|
printf " (documented)"
|
||||||
}
|
}
|
||||||
print ""
|
print ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -71,105 +71,104 @@ FNR == NR && /^=+$/ {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# The previous line is a section title, parse it
|
# The previous line is a section title, parse it
|
||||||
$0 = prevline
|
$0 = prevline
|
||||||
if (debug) print "Parsing " $0
|
if (debug) print "Parsing " $0
|
||||||
inbrackets = 0
|
inbrackets = 0
|
||||||
for (i = 1; i <= NF; i++) {
|
for (i = 1; i <= NF; i++) {
|
||||||
if (length($i) == 0) {
|
if (length($i) == 0) {
|
||||||
continue
|
continue
|
||||||
|
}
|
||||||
|
if (!inbrackets && substr($i, 1, 1) == "(") {
|
||||||
|
inbrackets = 1
|
||||||
|
}
|
||||||
|
if (!inbrackets) {
|
||||||
|
token = trimpunct($i)
|
||||||
|
if (length(token) > 0 && token != "and") {
|
||||||
|
if (debug) print trimpunct($i)
|
||||||
|
documented[trimpunct($i)]++
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (inbrackets && substr($i, length($i), 1) == ")") {
|
||||||
|
inbrackets = 0
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (!inbrackets && substr($i, 1, 1) == "(") {
|
|
||||||
inbrackets = 1
|
|
||||||
}
|
|
||||||
if (!inbrackets) {
|
|
||||||
token = trimpunct($i)
|
|
||||||
if (length(token) > 0 && token != "and") {
|
|
||||||
if (debug) print trimpunct($i)
|
|
||||||
documented[trimpunct($i)]++
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (inbrackets && substr($i, length($i), 1) == ")") {
|
|
||||||
inbrackets = 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
FNR == NR {
|
FNR == NR {
|
||||||
prevline = $0
|
prevline = $0
|
||||||
next
|
next
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# Stage 2: process each file and find all sysctl tables
|
# Stage 2: process each file and find all sysctl tables
|
||||||
BEGINFILE {
|
BEGINFILE {
|
||||||
delete entries
|
delete entries
|
||||||
curtable = ""
|
curtable = ""
|
||||||
curentry = ""
|
curentry = ""
|
||||||
delete vars
|
delete vars
|
||||||
if (debug) print "Processing file " FILENAME
|
if (debug) print "Processing file " FILENAME
|
||||||
}
|
}
|
||||||
|
|
||||||
/^static( const)? struct ctl_table/ {
|
/^static( const)? struct ctl_table/ {
|
||||||
match($0, /static( const)? struct ctl_table ([^][]+)/, tables)
|
match($0, /static( const)? struct ctl_table ([^][]+)/, tables)
|
||||||
curtable = tables[2]
|
curtable = tables[2]
|
||||||
if (debug) print "Processing table " curtable
|
if (debug) print "Processing table " curtable
|
||||||
}
|
}
|
||||||
|
|
||||||
/^};$/ {
|
/^};$/ {
|
||||||
curtable = ""
|
curtable = ""
|
||||||
curentry = ""
|
curentry = ""
|
||||||
delete vars
|
delete vars
|
||||||
}
|
}
|
||||||
|
|
||||||
curtable && /\.procname[\t ]*=[\t ]*".+"/ {
|
curtable && /\.procname[\t ]*=[\t ]*".+"/ {
|
||||||
match($0, /.procname[\t ]*=[\t ]*"([^"]+)"/, names)
|
match($0, /.procname[\t ]*=[\t ]*"([^"]+)"/, names)
|
||||||
curentry = names[1]
|
curentry = names[1]
|
||||||
if (debug) print "Adding entry " curentry " to table " curtable
|
if (debug) print "Adding entry " curentry " to table " curtable
|
||||||
entries[curtable][curentry]++
|
entries[curtable][curentry]++
|
||||||
file[curentry] = FILENAME
|
file[curentry] = FILENAME
|
||||||
}
|
}
|
||||||
|
|
||||||
curtable && /UCOUNT_ENTRY.*/ {
|
curtable && /UCOUNT_ENTRY.*/ {
|
||||||
match($0, /UCOUNT_ENTRY\("([^"]+)"\)/, names)
|
match($0, /UCOUNT_ENTRY\("([^"]+)"\)/, names)
|
||||||
curentry = names[1]
|
curentry = names[1]
|
||||||
if (debug) print "Adding entry " curentry " to table " curtable
|
if (debug) print "Adding entry " curentry " to table " curtable
|
||||||
entries[curtable][curentry]++
|
entries[curtable][curentry]++
|
||||||
file[curentry] = FILENAME
|
file[curentry] = FILENAME
|
||||||
}
|
}
|
||||||
|
|
||||||
/register_sysctl.*/ {
|
/register_sysctl.*/ {
|
||||||
match($0, /register_sysctl(|_init|_sz)\("([^"]+)" *, *([^,)]+)/, tables)
|
match($0, /register_sysctl(|_init|_sz)\("([^"]+)" *, *([^,)]+)/, tables)
|
||||||
if (debug) print "Registering table " tables[3] " at " tables[2]
|
if (debug) print "Registering table " tables[3] " at " tables[2]
|
||||||
if (tables[2] == table) {
|
if (tables[2] == table) {
|
||||||
for (entry in entries[tables[3]]) {
|
for (entry in entries[tables[3]]) {
|
||||||
printentry(entry)
|
printentry(entry)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/kmemdup.*/ {
|
/kmemdup.*/ {
|
||||||
match($0, /([^ \t]+) *= *kmemdup\(([^,]+) *,/, names)
|
match($0, /([^ \t]+) *= *kmemdup\(([^,]+) *,/, names)
|
||||||
if (debug) print "Found variable " names[1] " for table " names[2]
|
if (debug) print "Found variable " names[1] " for table " names[2]
|
||||||
if (names[2] in entries) {
|
if (names[2] in entries) {
|
||||||
vars[names[1]] = names[2]
|
vars[names[1]] = names[2]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/__register_sysctl_table.*/ {
|
/__register_sysctl_table.*/ {
|
||||||
match($0, /__register_sysctl_table\([^,]+, *"([^"]+)" *, *([^,]+)/, tables)
|
match($0, /__register_sysctl_table\([^,]+, *"([^"]+)" *, *([^,]+)/, tables)
|
||||||
if (debug) print "Registering variable table " tables[2] " at " tables[1]
|
if (debug) print "Registering variable table " tables[2] " at " tables[1]
|
||||||
if (tables[1] == table && tables[2] in vars) {
|
if (tables[1] == table && tables[2] in vars) {
|
||||||
for (entry in entries[vars[tables[2]]]) {
|
for (entry in entries[vars[tables[2]]]) {
|
||||||
printentry(entry)
|
printentry(entry)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
END {
|
END {
|
||||||
for (entry in documented) {
|
for (entry in documented) {
|
||||||
if (!seen[entry]) {
|
if (!seen[entry])
|
||||||
print "No implementation for " entry
|
print "No implementation for " entry
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user