Em Wed, 28 Oct 2020 15:39:37 +0100 Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> 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);