Re: kernel-doc bug?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 09:16-20130305, Rob Landley wrote:
> On 03/04/2013 03:35:58 PM, Randy Dunlap wrote:
> >On 03/04/13 13:29, Nishanth Menon wrote:
> >> Hi,
> >> While playing with 3.9-rc1 tag, I found the following interesting:
> >> Warning(lib/crc32.c:143): No description found for parameter
> >'tab)[256]'
> >> Code in question is as follows:
> >>
> >> /**
> >>  * crc32_le() - Calculate bitwise little-endian Ethernet AUTODIN
> >II CRC32
> >>  * @crc: seed value for computation.  ~0 for Ethernet, sometimes
> >0 for
> >>  *	other uses, or the previous crc32 value if computing
> >incrementally.
> >>  * @p: pointer to buffer over which CRC is run
> >>  * @len: length of buffer @p
> >>  */
> >> static inline u32 __pure crc32_le_generic(u32 crc, unsigned char
> >const *p,
> >> 					  size_t len, const u32 (*tab)[256],
> >> 					  u32 polynomial)
> >> Ignore the polynomial for the moment, the fix would probably be
> >to add:
> >> @tab: something
> >>
> >> but it still does not work.
> >> With a bit of tracing added[1], it looks like this:
> >> Trace begun at scripts/kernel-doc line 1976
> >> main::push_parameter(undef, 'const u32 ( *', 'lib/crc32.c')
> >called at scripts/kernel-doc line 1911
> >> main::create_parameterlist('u32 crc, unsigned char const *p,
> >^I^I^I^I^I  size_t len, const u32 (*tab)[256], ^I^I^I^I^I  u32
> >polynomial', ',', 'lib/crc32.c') called at scripts/kernel-doc line
> >2128
> >> main::dump_function('static inline u32 __pure
> >crc32_le_generic(u32 crc, unsigned char const *p, ^I^I^I^I^I
> >size_t len, const u32 (*tab)[256], ^I^I^I^I^I  u32 polynomial) ',
> >'lib/crc32.c') called at scripts/kernel-doc line 2261
> >> main::process_state3_function('{^J', 'lib/crc32.c') called at
> >scripts/kernel-doc line 2489
> >> main::process_file('{^J') called at scripts/kernel-doc line 2597
> >> Warning(lib/crc32.c:143): No description found for parameter
> >'tab)[256]'
> >>
> >> So far, at the point of calling create_parameterlist we have args
> >> properly identified
> >> args=u32 crc, unsigned char const *p, size_t len, const u32
> >(*tab)[256], u32 polynomial
> >> at the point of push_parameter, we see the problem with a print
> >patch as
> >> in [2]:
> >> 1=* type=const u32 ( 2=tab)[256]
> >>
> >> It looks like a cleanup of parameter problem, but I dont seem to
> >> immediately see where exactly might be a good place to do it.
> >>
> >> [1] http://pastebin.com/puGBafm6
> >> [2] http://pastebin.com/c5ijQGtW
> >>
> >> Just for the background: The warning seems to have been
> >introduced by:
> >> commit 46c5801e (crc32: bolt on crc32c)
> >
> >Yes, I have been aware of it for quite some time but I haven't
> >made a patch for it yet.  If you come up with a patch, that would
> >be great.
> 
> Please cc: me if you do, I _finally_ got my kernel.org account back
> (yesterday) and am regarding my backlog of flagged documentation
> emails with dread...
The following seems to work without any visible side effect I can find.
I used omap2plus_defconfig to verify. If no one can find any possible
side-effects, I can post this patch as an official patch.
Before patch:
Warning(/home/nmenon/Src/opensource/linux-2.6//lib/crc32.c:143): No description found for parameter 'tab)[256]'
Warning(/home/nmenon/Src/opensource/linux-2.6//lib/crc32.c:143): No description found for parameter 'polynomial'
After patch:
Warning(/home/nmenon/Src/opensource/linux-2.6//lib/crc32.c:143): No description found for parameter 'tab'
Warning(/home/nmenon/Src/opensource/linux-2.6//lib/crc32.c:143): No description found for parameter 'polynomial'

diff --git a/scripts/kernel-doc b/scripts/kernel-doc
index 4305b2f..2e381f9 100755
--- a/scripts/kernel-doc
+++ b/scripts/kernel-doc
@@ -1884,6 +1884,7 @@ sub create_parameterlist($$$) {
 	    save_struct_actual($param);
 	    push_parameter($param, $type, $file);
 	} elsif ($arg) {
+	    $arg =~ s/\((.+)\)\s*/$1/gos;
 	    $arg =~ s/\s*:\s*/:/g;
 	    $arg =~ s/\s*\[/\[/g;
 
@@ -2122,6 +2123,8 @@ sub dump_function($$) {
 	$return_type = $1;
 	$declaration_name = $2;
 	my $args = $3;
+	# clean up array arguments
+	$args =~ s/\[[^,]+\]//gos;
 
 	create_parameterlist($args, ',', $file);
     } else {
-- 
Regards,
Nishanth Menon
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux