Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp953457pxj; Sat, 8 May 2021 03:44:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJywngSAXHukrAr2MD+21Yoye1Leak7mMSQbWWbY/eiHgL3E3gDkl66gtuVFR22TKKrLsbJo X-Received: by 2002:a50:cdd1:: with SMTP id h17mr17140412edj.178.1620470690889; Sat, 08 May 2021 03:44:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620470690; cv=none; d=google.com; s=arc-20160816; b=UGjcTP8ZQzMTSNMbVnmaOxI9UB7WteMmqN6qE9DW+qNH0+wU96ge4YNannjdTd0bI7 9qyZ7hmx/xrMvSE6qkvtKK4HRd/T3Fti0FhoEygXLTrum4IDTughqpyiaHKGTwNW2Q/B 7YssK/L60m0dGhjb9b+2qj4QaWGWLjA9suhR7gnI/ZYUDf3sjsDy7QybcDgneTHTVFIq EsGXZDuxNLBVUP9PX8WBSC12DdDPTk6SKfTFf5my/S23c3bjvweqU9SJqU+/DyV+2i6G WvPd8Wa2JGcU9rNpPjR0VmhEOt+G4R5ysA9mcW+E4MynVO0aLTzs/jLLW2FgNmUC0yhG TQ8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=QGH37b+tvwoFaf7AQURICJ0sCAHFRPpbP/w608Hwedg=; b=ve/a+uWXvRrxvd9Owu5m0Lj7aXg9uHNuzxKTBTnIBdeb+0j+H7ftGxfv/LHaAHtYqu B4xz2oEhs9FL80LMBNjJmXdj8aLhSH/yjMa/IgPVZOBSNrah5cWY0V2X33MUjhBzycsx ufk/AtZbnUEnzF2O7OHyWO2NTefoLorpF6peCxZN+b1NSEzJagcNXoiz8Mb/II7JAQ9v CM4ekQktFBKSaOigUmLV43GPUgTCRiP2EAu2t02lYYzWOiDLlud5IbY7E0vBmqsR5zU0 shIYquMKFMBr7NX7bqs6LHfu23Nh9Xnmh7tx0rbT4FYUcQi93LUfT/QBgJ2LYm9wAnVW ks2A== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o13si7877283edi.135.2021.05.08.03.44.27; Sat, 08 May 2021 03:44:50 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230452AbhEHKid (ORCPT + 99 others); Sat, 8 May 2021 06:38:33 -0400 Received: from out30-132.freemail.mail.aliyun.com ([115.124.30.132]:39643 "EHLO out30-132.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230234AbhEHKi3 (ORCPT ); Sat, 8 May 2021 06:38:29 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R181e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04400;MF=jiapeng.chong@linux.alibaba.com;NM=1;PH=DS;RN=4;SR=0;TI=SMTPD_---0UY9-dYp_1620470237; Received: from j63c13417.sqa.eu95.tbsite.net(mailfrom:jiapeng.chong@linux.alibaba.com fp:SMTPD_---0UY9-dYp_1620470237) by smtp.aliyun-inc.com(127.0.0.1); Sat, 08 May 2021 18:37:26 +0800 From: Jiapeng Chong To: rostedt@goodmis.org Cc: mingo@redhat.com, linux-kernel@vger.kernel.org, Jiapeng Chong Subject: [PATCH v2] tracing: Remove redundant assignment to event_var Date: Sat, 8 May 2021 18:37:16 +0800 Message-Id: <1620470236-26562-1-git-send-email-jiapeng.chong@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- Changes in v2: -Move the declaration of event_var below 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. For the follow advice: https://lore.kernel.org/patchwork/patch/1422518/ 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..dacd6fe 100644 --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c @@ -2434,12 +2434,12 @@ 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_trigger_data *hist_data; unsigned int i, n, first = true; struct field_var_hist *var_hist; struct trace_event_file *file; struct hist_field *key_field; + struct hist_field *event_var; char *saved_filter; char *cmd; int ret; -- 1.8.3.1