lkml.org 
[lkml]   [2016]   [Mar]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subjectcheckpatch false positon on EXPORT_SYMBOL
Date

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
\
 
 \ /
  Last update: 2016-03-31 17:41    [W:0.149 / U:0.152 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site