linux-doc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Linux Doc Mailing List <linux-doc@vger.kernel.org>,
	linux-kernel@vger.kernel.org, Jonathan Corbet <corbet@lwn.net>,
	Alexandre Torgue <alexandre.torgue@st.com>,
	Andreas Klinger <ak@it-klinger.de>,
	Anton Vorontsov <anton@enomsg.org>,
	Baolin Wang <baolin.wang7@gmail.com>,
	Bartosz Golaszewski <bgolaszewski@baylibre.com>,
	Benson Leung <bleung@chromium.org>,
	Bjorn Andersson <bjorn.andersson@linaro.org>,
	Boris Brezillon <bbrezillon@kernel.org>,
	Chao Yu <chao@kernel.org>, Chunyan Zhang <zhang.lyra@gmail.com>,
	Colin Cross <ccross@android.com>,
	Daniel Thompson <daniel.thompson@linaro.org>,
	Enric Balletbo i Serra <enric.balletbo@collabora.com>,
	Fabrice Gasnier <fabrice.gasnier@st.com>,
	Heikki Krogerus <heikki.krogerus@linux.intel.com>,
	Jaegeuk Kim <jaegeuk@kernel.org>,
	Jingoo Han <jingoohan1@gmail.com>,
	Johan Hovold <johan@kernel.org>,
	Johannes Berg <johannes@sipsolutions.net>,
	Jonathan Cameron <jic23@kernel.org>,
	Kees Cook <keescook@chromium.org>,
	Lee Jones <lee.jones@linaro.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	Mathieu Poirier <mathieu.poirier@linaro.org>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Mike Kravetz <mike.kravetz@oracle.com>,
	Ohad Ben-Cohen <ohad@wizery.com>,
	Orson Zhai <orsonzhai@gmail.com>, Peter Rosin <peda@axentia.se>,
	Richard Cochran <richardcochran@gmail.com>,
	Richard Gong <richard.gong@linux.intel.com>,
	Sebastian Reichel <sre@kernel.org>,
	Srinivas Kandagatla <srinivas.kandagatla@linaro.org>,
	Stefan Achatz <erazor_de@users.sourceforge.net>,
	Tony Luck <tony.luck@intel.com>, Wu Hao <hao.wu@intel.com>
Subject: Re: [PATCH 00/33] ABI: add it to the documentation build system
Date: Wed, 28 Oct 2020 16:10:30 +0100	[thread overview]
Message-ID: <20201028161030.4e88b297@coco.lan> (raw)
In-Reply-To: <20201028143937.GA2302095@kroah.com>

Em Wed, 28 Oct 2020 15:39:37 +0100
Greg Kroah-Hartman <gregkh@linuxfoundation.org> escreveu:

> On Wed, Oct 28, 2020 at 03:22:58PM +0100, Mauro Carvalho Chehab wrote:
> > Hi Greg,
> > 
> > As requested, this is a rebased version on the top of v5.10-rc1
> > adding support for having the Linux ABI documentted inside
> > the Linux admin manual.
> > 
> > When compared with the version I sent years ago, this
> > version has:
> > 
> > - a logic to detect duplicated ABI symbols;
> > - it auto-generate cross-reference markups for ABI symbols,
> >   ABI files and .rst files;
> > - Other files from 5.10-rc1 required adjustments in order
> >   to be accepted by the script in rst-source mode;
> > - Some bug fixes.
> > 
> > PS.: I didn't try to merge it against linux-next yet. So,
> > I won't doubt that applying it could cause some conflicts.
> > 
> > Feel free to review it.  
> 
> After applying the first 10 patches, and running it, I see a bunch of
> these types of warnings:
> 
> Use of uninitialized value $kernelversion in substitution (s///) at ./scripts/get_abi.pl line 444.
> Use of uninitialized value $users in substitution (s///) at ./scripts/get_abi.pl line 446.
> Use of uninitialized value $users in substitution (s///) at ./scripts/get_abi.pl line 447.

Hmm.. I didn't test search after adding "use warnings".

The thing is that "use warnings" was added on one of get_abi.pl
patches, just to be sure that some ABI parsers were 100%.

That makes perl very pedantic, as it won't accept things like:

	my $foo;
	...
	my $bar = $foo;

Without "warnings", $bar will be undefined, and everything
works properly, but, when this used, the above will still
work properly, but will start producing warnings like the
one you're seeing.

I'm enclosing a diff addressing it for "search" mode.

It should be fold on this patch:

	scripts: get_abi.pl: cleanup ABI cross-reference logic

Which is the one that added "use warnings".

Feel free to fold it there. Otherwise, I'll fold it and
send you on a v2 of this series.

> 
> When doing something like:
> $ ./scripts/get_abi.pl search usb --dir Documentation/ABI/stable/
> 
> Is that expected?
> 
> thanks,
> 
> greg k-h


Thanks,
Mauro

diff --git a/scripts/get_abi.pl b/scripts/get_abi.pl
index bdef3e5c35c7..00b6ddec0ebb 100755
--- a/scripts/get_abi.pl
+++ b/scripts/get_abi.pl
@@ -442,17 +442,20 @@ sub search_symbols {
 
 		print "\n$what\n$bar\n\n";
 
-		my $kernelversion = $data{$what}->{kernelversion};
-		my $contact = $data{$what}->{contact};
-		my $users = $data{$what}->{users};
-		my $date = $data{$what}->{date};
-		my $desc = $data{$what}->{description};
-		$kernelversion =~ s/^\s+//;
-		$contact =~ s/^\s+//;
-		$users =~ s/^\s+//;
-		$users =~ s/\n//g;
-		$date =~ s/^\s+//;
-		$desc =~ s/^\s+//;
+		my $kernelversion = $data{$what}->{kernelversion} if (defined($data{$what}->{kernelversion}));
+		my $contact = $data{$what}->{contact} if (defined($data{$what}->{contact}));
+		my $users = $data{$what}->{users} if (defined($data{$what}->{users}));
+		my $date = $data{$what}->{date} if (defined($data{$what}->{date}));
+		my $desc = $data{$what}->{description} if (defined($data{$what}->{description}));
+
+		$kernelversion =~ s/^\s+// if ($kernelversion);
+		$contact =~ s/^\s+// if ($contact);
+		if ($users) {
+			$users =~ s/^\s+//;
+			$users =~ s/\n//g;
+		}
+		$date =~ s/^\s+// if ($date);
+		$desc =~ s/^\s+// if ($desc);
 
 		printf "Kernel version:\t\t%s\n", $kernelversion if ($kernelversion);
 		printf "Date:\t\t\t%s\n", $date if ($date);



  reply	other threads:[~2020-10-29  0:58 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-28 14:22 [PATCH 00/33] ABI: add it to the documentation build system Mauro Carvalho Chehab
2020-10-28 14:22 ` [PATCH 01/33] scripts: get_abi.pl: change script to allow parsing in ReST mode Mauro Carvalho Chehab
2020-10-28 14:23 ` [PATCH 02/33] scripts: get_abi.pl: fix parsing on " Mauro Carvalho Chehab
2020-10-28 14:23 ` [PATCH 03/33] scripts: get_abi.pl: Allow optionally record from where a line came from Mauro Carvalho Chehab
2020-10-28 14:23 ` [PATCH 04/33] scripts: get_abi.pl: improve its parser to better catch up indentation Mauro Carvalho Chehab
2020-10-28 14:23 ` [PATCH 05/33] scripts: get_abi.pl: cleanup ABI cross-reference logic Mauro Carvalho Chehab
2020-10-28 14:23 ` [PATCH 06/33] scripts: get_abi.pl: detect duplicated ABI definitions Mauro Carvalho Chehab
2020-10-28 14:23 ` [PATCH 07/33] scripts: get_abi.pl: output users in ReST format Mauro Carvalho Chehab
2020-10-28 14:23 ` [PATCH 08/33] scripts: get_abi.pl: prevent duplicated file names Mauro Carvalho Chehab
2020-10-28 14:23 ` [PATCH 09/33] scripts: get_abi.pl: use bold font for ABI definitions Mauro Carvalho Chehab
2020-10-28 14:23 ` [PATCH 10/33] scripts: get_abi.pl: auto-generate cross references Mauro Carvalho Chehab
2020-10-28 14:23 ` [PATCH 11/33] docs: kernellog.py: add support for info() Mauro Carvalho Chehab
2020-10-28 14:23 ` [PATCH 12/33] docs: kernel_abi.py: add a script to parse ABI documentation Mauro Carvalho Chehab
2020-10-28 16:21   ` Jonathan Corbet
2020-10-28 17:02     ` Mauro Carvalho Chehab
2020-10-28 14:23 ` [PATCH 13/33] docs: kernel_abi.py: fix UTF-8 support Mauro Carvalho Chehab
2020-10-28 14:23 ` [PATCH 14/33] docs: kernel_abi.py: make it compatible with Sphinx 1.7+ Mauro Carvalho Chehab
2020-10-28 14:23 ` [PATCH 15/33] docs: kernel_abi.py: use --enable-lineno for get_abi.pl Mauro Carvalho Chehab
2020-10-28 14:23 ` [PATCH 16/33] docs: kernel_abi.py: Handle with a lazy Sphinx parser Mauro Carvalho Chehab
2020-10-28 14:23 ` [PATCH 17/33] docs: add ABI documentation to the admin-guide book Mauro Carvalho Chehab
2020-10-28 14:23 ` [PATCH 18/33] docs: ABI: README: specify that files should be ReST compatible Mauro Carvalho Chehab
2020-10-28 14:23 ` [PATCH 19/33] docs: ABI: stable: make files " Mauro Carvalho Chehab
2020-10-28 14:23 ` [PATCH 21/33] docs: ABI: make it parse ABI/stable as ReST-compatible files Mauro Carvalho Chehab
2020-10-28 14:23 ` [PATCH 22/33] docs: ABI: create a 2-depth index for ABI Mauro Carvalho Chehab
2020-10-28 14:23 ` [PATCH 23/33] docs: ABI: don't escape ReST-incompatible chars from obsolete and removed Mauro Carvalho Chehab
2020-11-05 13:56   ` Linus Walleij
2020-10-28 14:23 ` [PATCH 24/33] docs: abi-testing.rst: enable --rst-sources when building docs Mauro Carvalho Chehab
2020-10-28 14:23 ` [PATCH 25/33] docs: Kconfig/Makefile: add a check for broken ABI files Mauro Carvalho Chehab
2020-10-28 14:23 ` [PATCH 26/33] docs: ABI: convert testing/configfs-acpi to ReST Mauro Carvalho Chehab
2020-10-28 14:23 ` [PATCH 27/33] docs: ABI: fix syntax to be parsed using ReST notation Mauro Carvalho Chehab
2020-10-28 14:23 ` [PATCH 28/33] docs: ABI: vdso: use the right format for ABI Mauro Carvalho Chehab
2020-10-28 14:23 ` [PATCH 29/33] docs: ABI: sysfs-bus-nvdimm: " Mauro Carvalho Chehab
2020-10-28 14:23 ` [PATCH 31/33] docs: ABI: change read/write attributes Mauro Carvalho Chehab
2020-10-28 14:23 ` [PATCH 32/33] docs: ABI: stable: remove a duplicated documentation Mauro Carvalho Chehab
2020-10-28 14:57   ` Wei Liu
2020-10-28 14:23 ` [PATCH 33/33] docs: ABI: unify /sys/class/leds/<led>/max_brightness documentation Mauro Carvalho Chehab
2020-10-29 17:16   ` Pavel Machek
2020-10-29 22:11   ` Jacek Anaszewski
2020-10-28 14:39 ` [PATCH 00/33] ABI: add it to the documentation build system Greg Kroah-Hartman
2020-10-28 15:10   ` Mauro Carvalho Chehab [this message]
2020-10-28 14:43 ` Greg Kroah-Hartman
2020-10-28 16:22   ` Jonathan Corbet
2020-10-28 16:54     ` Greg Kroah-Hartman
2020-10-29  9:07   ` Mauro Carvalho Chehab
     [not found] ` <4ebaaa0320101479e392ce2db4b62e24fdf15ef1.1603893146.git.mchehab+huawei@kernel.org>
2020-10-28 17:44   ` [PATCH 20/33] docs: ABI: testing: make the files compatible with ReST output Richard Cochran
2020-10-29  7:21     ` Mauro Carvalho Chehab
2020-10-29 14:49   ` Jonathan Cameron
2020-10-30  7:11     ` Mauro Carvalho Chehab
2020-11-02 15:06   ` Gautham R Shenoy
     [not found] ` <95ef2cf3a58f4e50f17d9e58e0d9440ad14d0427.1603893146.git.mchehab+huawei@kernel.org>
2020-10-29 14:54   ` [PATCH 30/33] docs: ABI: cleanup several ABI documents Tom Rix
2020-10-30  6:33   ` Vaibhav Jain
2020-11-03 15:24   ` Bjorn Andersson

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=20201028161030.4e88b297@coco.lan \
    --to=mchehab+huawei@kernel.org \
    --cc=ak@it-klinger.de \
    --cc=alexandre.torgue@st.com \
    --cc=anton@enomsg.org \
    --cc=baolin.wang7@gmail.com \
    --cc=bbrezillon@kernel.org \
    --cc=bgolaszewski@baylibre.com \
    --cc=bjorn.andersson@linaro.org \
    --cc=bleung@chromium.org \
    --cc=ccross@android.com \
    --cc=chao@kernel.org \
    --cc=corbet@lwn.net \
    --cc=daniel.thompson@linaro.org \
    --cc=enric.balletbo@collabora.com \
    --cc=erazor_de@users.sourceforge.net \
    --cc=fabrice.gasnier@st.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hao.wu@intel.com \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=jaegeuk@kernel.org \
    --cc=jic23@kernel.org \
    --cc=jingoohan1@gmail.com \
    --cc=johan@kernel.org \
    --cc=johannes@sipsolutions.net \
    --cc=keescook@chromium.org \
    --cc=lee.jones@linaro.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.poirier@linaro.org \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=mike.kravetz@oracle.com \
    --cc=ohad@wizery.com \
    --cc=orsonzhai@gmail.com \
    --cc=peda@axentia.se \
    --cc=richard.gong@linux.intel.com \
    --cc=richardcochran@gmail.com \
    --cc=sre@kernel.org \
    --cc=srinivas.kandagatla@linaro.org \
    --cc=tony.luck@intel.com \
    --cc=zhang.lyra@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).