All of lore.kernel.org
 help / color / mirror / Atom feed
From: domen@coderock.org
To: linux-kernel@vger.kernel.org
Cc: damm@opensource.se, domen@coderock.org
Subject: [patch 3/5] autoparam: extract script
Date: Thu, 07 Jul 2005 13:25:54 +0200	[thread overview]
Message-ID: <20050707112635.804534000@homer> (raw)
In-Reply-To: 20050707112551.331553000@homer

[-- Attachment #1: autoparam_3-extract_script --]
[-- Type: text/plain, Size: 1617 bytes --]

From: Domen Puncer <domen@coderock.org>


A simple perl script which extracts parameters, types and
descriptions from binary file.

Signed-off-by: Domen Puncer <domen@coderock.org>

 scripts/kernelparams.pl |   49 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 49 insertions(+)

Index: a/scripts/kernelparams.pl
===================================================================
--- /dev/null
+++ a/scripts/kernelparams.pl
@@ -0,0 +1,49 @@
+#!/usr/bin/perl
+use strict;
+my ($p, @params, %param_t, %param_d);
+
+while (<>) {
+	my @params = split '\0', $_;
+	foreach $p (@params) {
+		next if (!$p);
+		# module_param, "m:module.param:type"
+		if ($p =~ /^(m:.+?):(.*)/) {
+			$param_t{$1} = " ($2)";
+		}
+		# __setup, "s:"; obsolete_setup; early_param
+		elsif ($p =~ /^([soe]:.+)/) {
+			$param_t{$1} = '';
+		}
+		# description, "d:module.param:description"
+		elsif ($p =~ /^d:(.+?):(.+)/) {
+			$param_d{$1} = $2;
+		}
+		# i.e. ide uses __setup("", blah)
+		elsif ($p !~ /^[soe]:$/) {
+			print STDERR "Parameter error: \"$p\"\n";
+		}
+	}
+}
+
+# print the parameters
+foreach $p (sort(keys(%param_t))) {
+	print "$p$param_t{$p}\n";
+	my $pn = substr($p, 2);
+	if (!$param_d{$pn}) {
+		# only warn for module parameters
+		if ($p =~ "^m:") {
+			print "  No description\n";
+		}
+	} else {
+		print "  $param_d{$pn}\n";
+	}
+	print "\n";
+}
+
+# descriptions alone; typos, deprecated
+foreach $p (sort(keys(%param_d))) {
+	if (!exists $param_t{"m:".$p} && !exists $param_t{"s:".$p} &&
+			!exists $param_t{"o:".$p}) {
+		print STDERR "$p only has description (MODULE_PARM?)\n";
+	}
+}

--

  parent reply	other threads:[~2005-07-07 15:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-07 11:25 [patch 0/5] autoparam v0.2: generating parameter descriptions on compile domen
2005-07-07 11:25 ` [patch 1/5] autoparam: includes domen
2005-07-07 11:25 ` [patch 2/5] autoparam: makefile domen
2005-07-07 11:25 ` domen [this message]
2005-07-07 11:25 ` [patch 4/5] autoparam: af_unix workaround domen
2005-07-07 17:13   ` Alexey Dobriyan
2005-07-07 11:25 ` [patch 5/5] autoparam: ide workarounds domen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050707112635.804534000@homer \
    --to=domen@coderock.org \
    --cc=damm@opensource.se \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.