linux/Documentation/s390
Mauro Carvalho Chehab a20aa857e0 s390: include/asm/debug.h add kerneldoc markups
Instead of keeping the documentation inside s390dbf.rst,
move them to arch/s390/include/asm/debug.h, using standard
kernel-doc markups.

Keeping the documentation close to the code helps to keep it
updated. It also makes easier to document other stuff inside
debug.h, as all it needs is to add kernel-doc markups inside
it, as the file will be already be included at the produced
documentation.

-

Those were converted to kerneldoc using this script specially
designed to parse ths file, and manually editted:

<script>
use strict;

my $mode = "";
my $parameter = "";
my $ret = "";
my $descr = "";

sub add_var($)
{
	my $ln = shift;

	$ln =~ s/^\s+//;
	$ln =~ s/\s+$//;

	return if ($ln eq "");

	$ln =~ s/^(\S+)\s+/$1\t/;

	print " * \@$ln\n";
}

sub add_return($)
{
	my $ln = shift;

	print " *\n * Return:\n" if ($mode ne "Return Value:");

	$ln =~ s/^\s+//;
	$ln =~ s/\s+$//;

	return if ($ln eq "");

	print " * -   $ln\n";
}

sub add_description($)
{
	my $ln = shift;

	print " *\n * \n" if ($mode ne "Description:");

	$ln =~ s/^\s+//;
	$ln =~ s/\s+$//;

	return if ($ln eq "");

	print " * $ln\n";
}

sub flush_results()
{
	print " */\n\n";
}

while (<>) {
	if (m/^[\-]+$/) {
		flush_results();
		$mode = "";
		$parameter = "";
		$ret = "";
		$descr = "";
		next;
	}
	if (m/(Parameter:)(.*)/) {
		print " *\n" if ($mode eq "func");
		add_var($2);
		$mode = $1;
		next;
	}
	if (m/(Return Value:)(.*)/) {
		add_return($2);
		$mode = $1;
		next;
	}
	if (m/(Description:)(.*)/) {
		add_description($2);
		$mode = $1;
		next;
	}
	if ($mode eq "Parameter:") {
		add_var($_);
		next;
	}
	if ($mode eq "Return Value:") {
		add_return($_);
		next;
	}
	if ($mode eq "Description:") {
		add_description($_);
		next;
	}
	next if (m/^\s*$/);

	if (m/^\S+.*\s\*?(\S+)\s*\(/) {
		if ($mode eq "") {
			print "/**\n * $1()\n";
		} else {
			print " * $1()\n";
		}
		$mode="func";
	}
}
flush_results();
</script>

Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
2019-06-11 09:48:20 +02:00
..
3270.ChangeLog Documentation: Use "while" instead of "whilst" 2018-11-20 09:30:43 -07:00
3270.rst docs: s390: convert docs to ReST and rename to *.rst 2019-06-11 09:48:14 +02:00
cds.rst docs: s390: convert docs to ReST and rename to *.rst 2019-06-11 09:48:14 +02:00
common_io.rst docs: s390: convert docs to ReST and rename to *.rst 2019-06-11 09:48:14 +02:00
config3270.sh
dasd.rst docs: s390: convert docs to ReST and rename to *.rst 2019-06-11 09:48:14 +02:00
debugging390.rst docs: s390: convert docs to ReST and rename to *.rst 2019-06-11 09:48:14 +02:00
driver-model.rst docs: s390: convert docs to ReST and rename to *.rst 2019-06-11 09:48:14 +02:00
index.rst docs: s390: convert docs to ReST and rename to *.rst 2019-06-11 09:48:14 +02:00
monreader.rst docs: s390: convert docs to ReST and rename to *.rst 2019-06-11 09:48:14 +02:00
qeth.rst docs: s390: convert docs to ReST and rename to *.rst 2019-06-11 09:48:14 +02:00
s390dbf.rst s390: include/asm/debug.h add kerneldoc markups 2019-06-11 09:48:20 +02:00
text_files.rst docs: s390: convert docs to ReST and rename to *.rst 2019-06-11 09:48:14 +02:00
vfio-ap.rst docs: s390: convert docs to ReST and rename to *.rst 2019-06-11 09:48:14 +02:00
vfio-ccw.rst docs: s390: convert docs to ReST and rename to *.rst 2019-06-11 09:48:14 +02:00
zfcpdump.rst docs: s390: convert docs to ReST and rename to *.rst 2019-06-11 09:48:14 +02:00