Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1368379 > unrolled thread

checkpatch false positon on EXPORT_SYMBOL

Started byDaniel Walker <danielwa@cisco.com>
First post2016-03-31 17:10 +0200
Last post2016-03-31 21:30 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  checkpatch false positon on EXPORT_SYMBOL Daniel Walker <danielwa@cisco.com> - 2016-03-31 17:10 +0200
    Re: checkpatch false positon on EXPORT_SYMBOL Joe Perches <joe@perches.com> - 2016-03-31 21:30 +0200

#1368379 — checkpatch false positon on EXPORT_SYMBOL

FromDaniel Walker <danielwa@cisco.com>
Date2016-03-31 17:10 +0200
Subjectcheckpatch false positon on EXPORT_SYMBOL
Message-ID<riMoq-6WJ-5@gated-at.bofh.it>
The below looks like normal code but the last export symbol gets the 
warning,


WARNING:EXPORT_SYMBOL: EXPORT_SYMBOL(foo); should immediately follw its 
function/variable
#16: FILE: kernel/acct.c:70:
+EXPORT_SYMBOL(test_export);    /* Error ! */

It seems to have to do with the comments at the end of the line. The 
first two examples don't have warnings because I removed the comments on 
different lines. comments on the variable and export symbol lines gets 
the error tho.

(warning may not be a proper patch)

diff --git a/kernel/acct.c b/kernel/acct.c
index 8d6e145..a0cc002 100644
--- a/kernel/acct.c
+++ b/kernel/acct.c
@@ -60,6 +60,15 @@
  #include <linux/blkdev.h> /* sector_div */
  #include <linux/pid_namespace.h>

+int test_export;
+EXPORT_SYMBOL(test_export);    /* No Error ! */
+
+int test_export;    /* No Error below */
+EXPORT_SYMBOL(test_export);
+
+int test_export;    /* Error below */
+EXPORT_SYMBOL(test_export);    /* Error ! */
+
  /*
   * These constants control the amount of freespace that suspend and
   * resume the process accounting system, and the time delay between

[toc] | [next] | [standalone]


#1368571

FromJoe Perches <joe@perches.com>
Date2016-03-31 21:30 +0200
Message-ID<riQs2-1gf-13@gated-at.bofh.it>
In reply to#1368379
On Thu, 2016-03-31 at 08:01 -0700, Daniel Walker wrote:
> The below looks like normal code but the last export symbol gets the 
> warning,
> 
> 
> WARNING:EXPORT_SYMBOL: EXPORT_SYMBOL(foo); should immediately follw its 
> function/variable
> #16: FILE: kernel/acct.c:70:
> +EXPORT_SYMBOL(test_export);    /* Error ! */
> 
> It seems to have to do with the comments at the end of the line. The 
> first two examples don't have warnings because I removed the comments on 
> different lines. comments on the variable and export symbol lines gets 
> the error tho.

That looks like a false positive I'll leave for Andy.

$ cat ~/export_symbol.c
int test_export_no_comment;
EXPORT_SYMBOL(test_export_no_comment);
int test_export_comment_int;		/* comment int */
EXPORT_SYMBOL(test_export_int);
int test_export_comment_symbol;
EXPORT_SYMBOL(test_export_symbol);	/* comment symbol */
int test_export_both;			/* comment both 1 */
EXPORT_SYMBOL(test_export_both);	/* comment both 2 */
$

Something's a bit off with the $stat variable:

test_export_int doesn't match the EXPORT_SYMBOL test.
test_export_symbol and test_export_both get warnings.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web