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-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 30 Sep 2009 18:46:44 +0100
From:	Andy Whitcroft <apw@...onical.com>
To:	Daniel Walker <dwalker@...o99.com>
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	linux-kernel@...r.kernel.org, Ingo Molnar <mingo@...e.hu>,
	"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
Subject: Re: [PATCH 5/5] checkpatch: fix false EXPORT_SYMBOL warning

On Mon, Sep 21, 2009 at 07:14:51PM -0700, Daniel Walker wrote:
> Ingo reported that the following lines triggered a false warning,
> 
> static struct lock_class_key rcu_lock_key;
> struct lockdep_map rcu_lock_map =
>         STATIC_LOCKDEP_MAP_INIT("rcu_read_lock", &rcu_lock_key);
> EXPORT_SYMBOL_GPL(rcu_lock_map);
> 
> from kernel/rcutree.c , and the false warning looked like this,
> 
> WARNING: EXPORT_SYMBOL(foo); should immediately follow its
> function/variable
> +EXPORT_SYMBOL_GPL(rcu_lock_map);
> 
> This change corrects this. It was caused because checkpatch doesn't check
> more than one line above the "EXPORT_SYMBOL" for additional context (ie.
> variable name, or initializer). Things are somewhat more complicated
> because STATIC_LOCKDEP_MAP_INIT() doesn't accept the variable name that
> is being initialized. I just added another check that checks two lines
> above "EXPORT_SYMBOL" for the variable declaration.

In theory the thing we are exporting can be an arbitrary number of lines
prior to the EXPORT_SYMBOL statement.  We actually want to look at the
statement before the EXPORT_*. 

I had a go at doing it this way and it seems to work on my test sets.
Perhaps you could test the version at the url below:

  http://www.kernel.org/pub/linux/kernel/people/apw/checkpatch/checkpatch.pl-testing

NOTE: you want at least version 0.29-5-* which is in the process of 
mirroring out.

-apw
--
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