Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757018AbcCaPBI (ORCPT ); Thu, 31 Mar 2016 11:01:08 -0400 Received: from alln-iport-2.cisco.com ([173.37.142.89]:34139 "EHLO alln-iport-2.cisco.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750762AbcCaPBG (ORCPT ); Thu, 31 Mar 2016 11:01:06 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0D2AQBCO/1W/4cNJK1dgzS8ZQENgXCHU?= =?us-ascii?q?DgUAQEBAQEBAWUnhGsVQCoMAgUWCwILAwIBAgFLAQwIAQGII7EskQgBAQEBAQE?= =?us-ascii?q?EAQEBAQEbC3GFIowEglYFjjuJN44IiTiFVUSOUR4BAUKEBxyHYCOBGgEBAQ?= X-IronPort-AV: E=Sophos;i="5.24,422,1454976000"; d="scan'208";a="254265761" To: Andy Whitcroft , open list , Joe Perches , Daniel Walker , "xe-kernel@external.cisco.com" From: Daniel Walker Subject: checkpatch false positon on EXPORT_SYMBOL Message-ID: <56FD3BAE.1070209@cisco.com> Date: Thu, 31 Mar 2016 08:01:02 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Auto-Response-Suppress: DR, OOF, AutoReply Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1105 Lines: 37 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 /* sector_div */ #include +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