Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp5459084img; Wed, 27 Mar 2019 08:54:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqyTM2BB/fW+G3GyoqdVVYzhj277LuGjNisO5xeZM4Aet6FskG7HNX5qfChVNUPs4dhmv4Jw X-Received: by 2002:a62:5206:: with SMTP id g6mr20525381pfb.227.1553702072071; Wed, 27 Mar 2019 08:54:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553702072; cv=none; d=google.com; s=arc-20160816; b=dkOc4Zdgld5MCYlEMWK2lbDxWYyRMVU0b5otHVqdEpAPFp84n0OkSsgevK6osUopnX t7UjyEwk4GWmVFC6y3f3dfFkHvahHeMRzbfTYCBSFrT5ff1lPdO/9gcAiSUKevBaCrLR n77UwQu1rKvQe6DNka2oV0cIs7VGNo/cFw5tmhwgbrPxb3i86FxkJUwdD0Dwf511MNGA gbSkyrASjdCOqm9z/6WAqC7QpjmNu7kiNCjkJp/3FX6cZJZfjqCoHecq3L4KlOW95RnD zUQiLOxtK+/RsFSm7w+BaOxp1GLWvTWVzjhUDYcFeXFNGcLqHCoRjGIrlxcWk1/hHGo9 7kBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=iQLVqhFyxB1a56Dn9utLmmubAdT9PxjAd1o5dVbddVU=; b=I3olO5ulHGAB7qWX8sYv43L1RCzC9U1gaGc314Sd+ScTXZ+vi+5ocSR00fOarCh9Yb PBIYmjDkRFakKQOPVDmm/BfYhjFtrQrtheZUSRUMAo7NslxgNd5iI/ILQ+fJzpINI2fv w6WIIbKoI/TV0CRol5PPHRCD1E3niofURGHastzkFnuVzOe8nwvsPEI5k/Xjp+HE06Hm nTGcpQVzyIYMJ6T7N4FSFlwRQfOrkfgTL53c+YLyrmoc9WBITJL83tmIUcllYynHAqGT NShxYwOYpc2oJw3Gk9Gb21dffZoiBQ1YC1oBvuVawJGxBnJXDB8gONL1Y7CGjpZAvSx+ I2+w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 3si94751pfh.36.2019.03.27.08.54.16; Wed, 27 Mar 2019 08:54:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727432AbfC0Pxd (ORCPT + 99 others); Wed, 27 Mar 2019 11:53:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:56134 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726500AbfC0Pxd (ORCPT ); Wed, 27 Mar 2019 11:53:33 -0400 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 26B2520449; Wed, 27 Mar 2019 15:53:32 +0000 (UTC) Date: Wed, 27 Mar 2019 11:53:30 -0400 From: Steven Rostedt To: Hariprasad Kelam Cc: mingo@redhat.com, roopa@cumulusnetworks.com, davem@davemloft.net, linux-kernel@vger.kernel.org Subject: Re: [PATCH] trace: events: fix error directive in argument list Message-ID: <20190327115330.04b5b481@gandalf.local.home> In-Reply-To: <20190325195303.GA20629@hari-Inspiron-1545> References: <20190325195303.GA20629@hari-Inspiron-1545> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 26 Mar 2019 01:23:03 +0530 Hariprasad Kelam wrote: > This patch fixes below spare errors. > > Sparse error: > make C=2 CF=-D__CHECK_ENDIAN__ M=net/core > ./include/trace/events/neigh.h:73:1: error: directive in argument list > ./include/trace/events/neigh.h:78:1: error: directive in argument list > ./include/trace/events/neigh.h:150:1: error: directive in argument list > ./include/trace/events/neigh.h:155:1: error: directive in argument list > I have nothing really against these patches, but why is the current code considered wrong? Note, TRACE_EVENTS() are "special macros". They hold structure definitions and full code inside the argument list. There should be no reason that this is causing a warning. Perhaps we should blacklist the include/trace directory from sparse checking for these types of "errors". -- Steve > Changes below two lines to signle line to avoid sparse error > #if IS_ENABLED(CONFIG_IPV6) > if (n->tbl->family == AF_INET6) { > to if (IS_ENABLED(CONFIG_IPV6) && n->tbl->family == AF_INET6) > > and removes reassigning pin6 pointer when IPV6 is enabled > > Signed-off-by: Hariprasad Kelam > --- > include/trace/events/neigh.h | 19 +++++-------------- > 1 file changed, 5 insertions(+), 14 deletions(-) > > diff --git a/include/trace/events/neigh.h b/include/trace/events/neigh.h > index 0bdb085..6e310ea 100644 > --- a/include/trace/events/neigh.h > +++ b/include/trace/events/neigh.h > @@ -70,15 +70,11 @@ TRACE_EVENT(neigh_update, > else > *p32 = 0; > > -#if IS_ENABLED(CONFIG_IPV6) > - if (n->tbl->family == AF_INET6) { > - pin6 = (struct in6_addr *)__entry->primary_key6; > + if (IS_ENABLED(CONFIG_IPV6) && n->tbl->family == AF_INET6) > *pin6 = *(struct in6_addr *)n->primary_key; > - } else > -#endif > - { > + else > ipv6_addr_set_v4mapped(*p32, pin6); > - } > + > __entry->confirmed = n->confirmed; > __entry->updated = n->updated; > __entry->used = n->used; > @@ -147,15 +143,10 @@ DECLARE_EVENT_CLASS(neigh__update, > else > *p32 = 0; > > -#if IS_ENABLED(CONFIG_IPV6) > - if (n->tbl->family == AF_INET6) { > - pin6 = (struct in6_addr *)__entry->primary_key6; > + if (IS_ENABLED(CONFIG_IPV6) && n->tbl->family == AF_INET6) > *pin6 = *(struct in6_addr *)n->primary_key; > - } else > -#endif > - { > + else > ipv6_addr_set_v4mapped(*p32, pin6); > - } > > __entry->confirmed = n->confirmed; > __entry->updated = n->updated;