checkpatch false positon on EXPORT_SYMBOL
From: Daniel Walker
Date: Thu Mar 31 2016 - 11:01:14 EST
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