Received: by 2002:a25:5b86:0:0:0:0:0 with SMTP id p128csp2396624ybb; Sat, 30 Mar 2019 04:08:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqwSwwvd3oOLHw6UefFNqjLv+kOWV5pGe7PrzsYW13h8l3m6a2lQAfQVMghuxJNlAPCTvqAh X-Received: by 2002:a63:e755:: with SMTP id j21mr47746241pgk.418.1553944133289; Sat, 30 Mar 2019 04:08:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553944133; cv=none; d=google.com; s=arc-20160816; b=lTFfNIZ/kVy7h3EwAwQJDuYnMvFky6Xzxg4nVJ+SelBUSvccL6diiFtHnugaAI4APO NuhAsNBKI7n8h2AgJilxOr9mB+UGmWesHrkSWPx9xRTX24zl5aCpQ4wxGzIdfYMS1PwE Cb1feNogbZ00zJYtC4YLHNlVb6m4RZ0HsIH9Qya6P0ItVohE0tPi2XsHS/CIE5sNFXFu TWttl7W3XzaIedyJceGAAr8LXWb89/QJgHEWbjpq2yGRW4Zys7n0txtNBKbAMuj1kHAf fabs7IDOihVqaoWXpH91aVfCeScnXXNwwKNfYYpM+UrsUaQlWGZLAid45khVj8mH2KEA gUNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:to :from:date:dkim-signature; bh=hEzqti2at/SdXPxvZZZcw5JS0bkMUItsjBSbx22Zqgs=; b=OYhNtESbNeiPqahqYbcI1UtUUFvoyOGTCakTskAraUxj8w3yifcRc82YM0d36X5Iy/ LUekB+/IIjY8R95cfDsoMATHnL+i26fT1ud4oDPr/u0aDMZDjWwgFWkkBBk3cV4YhX7S 0e+j0nY70APhmMqcLEum5IclTwfuQMCmTubEIN/k5k5JT9c/Mih2xsqINIebQxXiShJk gfMKVRNe9Evuw7VLrfdBg6p8DNvg6EuBWK7lYCdqdE71LlZf/pyTvEyYnhNYimHQXBB0 Ox//CA64PeOQAQAOTWvuGoMgn1VZhbUdwdzdY5KPuMqlJWvE5gGi7zX4tUE0lLq3PYpy ahjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=NKE7oOSx; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i63si4189490pfb.171.2019.03.30.04.08.34; Sat, 30 Mar 2019 04:08:53 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=NKE7oOSx; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730684AbfC3LHy (ORCPT + 99 others); Sat, 30 Mar 2019 07:07:54 -0400 Received: from mail-pl1-f196.google.com ([209.85.214.196]:43079 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730597AbfC3LHx (ORCPT ); Sat, 30 Mar 2019 07:07:53 -0400 Received: by mail-pl1-f196.google.com with SMTP id m10so2204424plt.10; Sat, 30 Mar 2019 04:07:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=hEzqti2at/SdXPxvZZZcw5JS0bkMUItsjBSbx22Zqgs=; b=NKE7oOSxwW2EatecRzi2gLjJym8Czl4k2QQC0tKWp2LfnV9PmhpGkXxDd1nlpwdsUf R5Vp3BL4kaWG4RmN3k/J2Tc8jbi1HWB2VO5ABbefhXMsyPUnNi+LTSuIHWvWU3/tAGzX qaj9RMHXI9DHfsnr+rRVc69HktJsr6Qp1Gh3G559pHfdbstG0I+7F3ThqWQXwWTXL0M6 46VUf/2DmMuQyHx1on8AlS6iM79AEaxebSM058V6H67hXaOuJAD5y00YnbRWemTEAjCi /iQGfFyQD+85bCb/x5liSw8bQAbDe0IcMOVKkNZFEiRiALDilb7aAJWr3D6BfcQHgpBW Yrxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=hEzqti2at/SdXPxvZZZcw5JS0bkMUItsjBSbx22Zqgs=; b=BwT+ZkS1+Q0eDMy2gNrqYMGPCTB8/Che8yEju7FkkyIk2AAlnyHe9dCaLZ3kEq7WrN /dzkKUUEneWldOvHa5PJmA0ycmXS6uC5/qa+90dmLFFDbhz/L96zJHvQRAQf0NobFcRO 7rcSkRbXTrwK33FV9JKlYAjwW81vitfu0/EDfOyTNnAwCYIcMePv6M5/tYzjMMM/PPhK LehDPRGanDAAMwas4NLERzyIe6zyoeXfZJBnizmjfHrAY/RXzWljsRG8MCJvwC32LawX /fPOzt0yNQUO29RSNoZpxMZr8ap+aCR3znBPxCtH/qC/szAUZVO0vxOQXY72VdBTOY4b 31bQ== X-Gm-Message-State: APjAAAVAVa2/WLc9MuDRL7QmoO6959gNspiggNDVgl1/9nCzm7+d2aRs egX4cV4DFeqmgr77/o2M9SE= X-Received: by 2002:a17:902:be09:: with SMTP id r9mr1224529pls.215.1553944073212; Sat, 30 Mar 2019 04:07:53 -0700 (PDT) Received: from hari-Inspiron-1545 ([183.83.91.90]) by smtp.gmail.com with ESMTPSA id h3sm5480109pgv.38.2019.03.30.04.07.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 30 Mar 2019 04:07:52 -0700 (PDT) Date: Sat, 30 Mar 2019 16:37:48 +0530 From: Hariprasad Kelam To: Luc Van Oostenryck , Steven Rostedt , mingo@redhat.com, roopa@cumulusnetworks.com, davem@davemloft.net, linux-kernel@vger.kernel.org, linux-sparse@vger.kernel.org Subject: Re: [PATCH] trace: events: fix error directive in argument list Message-ID: <20190330110747.GA3461@hari-Inspiron-1545> References: <20190325195303.GA20629@hari-Inspiron-1545> <20190329232215.itsvo3jj3lu4gr7k@ltop.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190329232215.itsvo3jj3lu4gr7k@ltop.local> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Mar 30, 2019 at 12:22:17AM +0100, Luc Van Oostenryck wrote: > On Tue, Mar 26, 2019 at 01:23:03AM +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 > > > > 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; > > Why removing the line wheer pin6 is assigned? > IMO, the patch should be: > -#if IS_ENABLED(CONFIG_IPV6) > - if (n->tbl->family == AF_INET6) { > + if (IS_ENABLED(CONFIG_IPV6) && n->tbl->family == AF_INET6) > pin6 = (struct in6_addr *)__entry->primary_key6; > *pin6 = *(struct in6_addr *)n->primary_key; > > > @@ -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; > pin6 is already assinged .Assinging pin6 is redudant in if loop Below is the original code pin6 = (struct in6_addr *)__entry->primary_key6; p32 = (__be32 *)__entry->primary_key4; if (n->tbl->family == AF_INET) *p32 = *(__be32 *)n->primary_key; else *p32 = 0; #if IS_ENABLED(CONFIG_IPV6) if (n->tbl->family == AF_INET6) { pin6 = (struct in6_addr *)__entry->primary_key6; *pin6 = *(struct in6_addr *)n->primary_key; } else #endif { ipv6_addr_set_v4mapped(*p32, pin6); } > Same here. > > -- Luc Van Oostenryck