lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 15 Feb 2008 17:13:12 +0000
From:	Richard Kennedy <richard@....demon.co.uk>
To:	rdunlap@...otime.net
Cc:	lkml <linux-kernel@...r.kernel.org>
Subject: kernel-doc : possible fix for non-fatal perl errors when parsing
	some function pointers

When running "make htmldocs" I'm seeing some non-fatal perl errors
caused by trying to parse the callback function definitions in
blk-core.c.

The errors are "Use of uninitialized value in concatenation (.)..."

The function pointers are defined without a * i.e. 
int (drv_callback)(struct request *)

The compiler is happy with them, but kernel-doc isn't. 

This patch teaches create_parameterlist in kernel-doc to parse this type
of function pointer definition, but is it the right way to fix the
problem ? The problem only seems to occur in blk-core.c.

However with the patch applied, kernel-doc finds the correct parameter
description for the callback in blk_end_request_callback, which is
doesn't normally.
(the patch is against v2.6.25-rc1)

I thought it would be a bit odd to change to code to use the more normal
form of function pointers just to get the documentation to work, so I
fixed kernel-doc instead - even though this is teaching it to understand
code that might go away (The comment for blk_end_request_callback says
that it should not be used and will removed at some point). 

Any ideas on which is the best way to fix this?
 
Thanks
Richard






diff --git a/scripts/kernel-doc b/scripts/kernel-doc
index 26146cb..68b2e4e 100755
--- a/scripts/kernel-doc
+++ b/scripts/kernel-doc
@@ -1512,13 +1512,13 @@ sub create_parameterlist($$$) {
 	    # corresponding data structures "correctly". Catch it later in
 	    # output_* subs.
 	    push_parameter($arg, "", $file);
-	} elsif ($arg =~ m/\(.*\*/) {
+	} elsif ($arg =~ m/\(.+\)\s*\(/) {
 	    # pointer-to-function
 	    $arg =~ tr/#/,/;
-	    $arg =~ m/[^\(]+\(\*\s*([^\)]+)\)/;
+	    $arg =~ m/[^\(]+\(\*?\s*(\w*)\s*\)/;
 	    $param = $1;
 	    $type = $arg;
-	    $type =~ s/([^\(]+\(\*)$param/$1/;
+	    $type =~ s/([^\(]+\(\*?)$param/$1/;
 	    push_parameter($param, $type, $file);
 	} elsif ($arg) {
 	    $arg =~ s/\s*:\s*/:/g;
--  

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ