Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp356264pxj; Fri, 7 May 2021 10:06:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzPBvXiuXs8iIowNv9B4tuN8HsA04+mmqq+pa760KO6aLD5M8iMMyBVIAs0+1k4YFKsKqLO X-Received: by 2002:a62:6142:0:b029:28e:b072:6b7 with SMTP id v63-20020a6261420000b029028eb07206b7mr11098502pfb.65.1620407181805; Fri, 07 May 2021 10:06:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620407181; cv=none; d=google.com; s=arc-20160816; b=d4Um8VnLe78DOlBWDNnzExQh5n+Ow5xnhOsgesz6aq+MuPa6X35xlPukChJO5KSjS1 CCJReRjUWxDdHhuCoT7weiOki+iyuvxsyH+cmSvDd18XEeGLXA98bFSEIX49YCtF71uv KeE3x+ZUt2nPilLUxN+2b0tIEJXS4JfzYk8w8ApnCnjRqS5++tA3zA5JvHu9FbaRk6fc Tz3fjvWTe59BiSzAiP76nGj8sYRkemuF/35se0o5h7xvQIIswLTMeUzlqjia1usvz+df 8hlAD+3ZoFsCEqIqZposKiDwGlUhwl4HX6u60GKIAWBGpIletGVXC2WU1eTc2VNhAiQw XB8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=qM6hf2aZxTlX0rNF9gyf7KK9/tn9amj5OVHBT5xpGqc=; b=tzhqOx01hZfpuUAzLqN+TG7hopEgXQnkEg0+nyAothIOlS2pfhk8hkYaMnXcCOed5w idmd9dIzTO+QnPe+VIY16zhvNsOP7uzjlXKGwY19iQHfDdSGrURWO5Lb+JM+7J345y3S hBGWhUEDgI9ZuSE//6cFnpPMnekk3bodJdmSPXoe1me8rOfk0qdsFL71zBFK5vEntvt6 vWG/4uykI27y5xpHTRWkPnCjFNEzaM2fNtQIfSh5DGeBpDR8ae/67mynIF62oe6htQoc cD4SOSzzynzKkz/25/V4yBKo61iBy9q72k4PPXYJhYSrgy9L/4YSivqk9jqE+Jx4Bmd9 PLmA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z7si7526487pfz.153.2021.05.07.10.06.09; Fri, 07 May 2021 10:06:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232521AbhEGNR2 (ORCPT + 99 others); Fri, 7 May 2021 09:17:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:46352 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229886AbhEGNR1 (ORCPT ); Fri, 7 May 2021 09:17:27 -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 1E5AB61468; Fri, 7 May 2021 13:16:27 +0000 (UTC) Date: Fri, 7 May 2021 09:16:25 -0400 From: Steven Rostedt To: Jiapeng Chong Cc: mingo@redhat.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] tracing: Remove redundant assignment to event_var Message-ID: <20210507091625.0bcccf43@gandalf.local.home> In-Reply-To: <1620383030-70462-1-git-send-email-jiapeng.chong@linux.alibaba.com> References: <1620383030-70462-1-git-send-email-jiapeng.chong@linux.alibaba.com> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 7 May 2021 18:23:50 +0800 Jiapeng Chong wrote: > Variable event_var is set to 'ERR_PTR(-EINVAL)', but this value > is never read as it is overwritten or not used later on, hence > it is a redundant assignment and can be removed. > > Clean up the following clang-analyzer warning: > > kernel/trace/trace_events_hist.c:2437:21: warning: Value stored to > 'event_var' during its initialization is never read > [clang-analyzer-deadcode.DeadStores]. > > Reported-by: Abaci Robot > Signed-off-by: Jiapeng Chong > --- > kernel/trace/trace_events_hist.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c > index c1abd63..b37342c 100644 > --- a/kernel/trace/trace_events_hist.c > +++ b/kernel/trace/trace_events_hist.c > @@ -2434,7 +2434,7 @@ static struct trace_event_file *event_file(struct trace_array *tr, > char *subsys_name, char *event_name, char *field_name) > { > struct trace_array *tr = target_hist_data->event_file->tr; > - struct hist_field *event_var = ERR_PTR(-EINVAL); > + struct hist_field *event_var; > struct hist_trigger_data *hist_data; > unsigned int i, n, first = true; > struct field_var_hist *var_hist; Thanks, but if you are going to make this change, please move the declaration of event_var below (or above) key_field, as their names are both the same size in length and are of the same type. This keeps the "upside-down x-mas tree" look of the declarations. -- Steve