From: David Miller Subject: Re: [PATCH net] tcp: Avoid preprocessor directives in tracepoint macro args Date: Tue, 26 Dec 2017 17:25:56 -0500 (EST) Message-ID: <20171226.172556.476441061823840553.davem@davemloft.net> References: <20171221182910.4785-1-mathew.j.martineau@linux.intel.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org, dsahern@gmail.com To: mathew.j.martineau@linux.intel.com Return-path: Received: from shards.monkeyblade.net ([184.105.139.130]:58102 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750822AbdLZW0K (ORCPT ); Tue, 26 Dec 2017 17:26:10 -0500 In-Reply-To: <20171221182910.4785-1-mathew.j.martineau@linux.intel.com> Sender: netdev-owner@vger.kernel.org List-ID: From: Mat Martineau Date: Thu, 21 Dec 2017 10:29:09 -0800 > Using a preprocessor directive to check for CONFIG_IPV6 in the middle of > a DECLARE_EVENT_CLASS macro's arg list causes sparse to report a series > of errors: > > ./include/trace/events/tcp.h:68:1: error: directive in argument list > ./include/trace/events/tcp.h:75:1: error: directive in argument list > ./include/trace/events/tcp.h:144:1: error: directive in argument list > ./include/trace/events/tcp.h:151:1: error: directive in argument list > ./include/trace/events/tcp.h:216:1: error: directive in argument list > ./include/trace/events/tcp.h:223:1: error: directive in argument list > ./include/trace/events/tcp.h:274:1: error: directive in argument list > ./include/trace/events/tcp.h:281:1: error: directive in argument list > > Once sparse finds an error, it stops printing warnings for the file it > is checking. This masks any sparse warnings that would normally be > reported for the core TCP code. > > Instead, handle the preprocessor conditionals in a couple of auxiliary > macros. This also has the benefit of reducing duplicate code. > > Cc: David Ahern > Signed-off-by: Mat Martineau Applied.