Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp5075849pxj; Wed, 9 Jun 2021 08:36:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxykrBrw1/1pWJgRzqev/w3FkqE341jLHs6q3km3u082xfla0coTYg+j1AEd/xCR8oQZrZR X-Received: by 2002:a17:906:5949:: with SMTP id g9mr492192ejr.296.1623252996304; Wed, 09 Jun 2021 08:36:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623252996; cv=none; d=google.com; s=arc-20160816; b=xnB6Eb4OVApyr8IeREcNHWK8uo2kjo3bOHIZ8ey66rduks4IXkSQ7lguoma8T0nze7 Cj/Jd6Y1YVbnoEd1+4/WJ/sOtLUVMdM0pQOjD1ykLO74QXU4XRiIJS6n7VEG2ZSLtEsB tQ+3mz9g8Ah1433bCCDSwubkyQKsV0AgFmJ/HRu2+BDC1XoKpSqzP5ljpfswu88l7vk4 nY1PLHv0YZdYbA4lCazD0b0KyRvdRkF0yGp8ruiSrqAt0HdPgNfO1cf1fE4fDvQXy7rc jj7xC26OTNW2lMNKMVh8FkbwsKjOu3S9Qgi/+VMdMt7UZiMtOYNlvEEyOdVydQmRUcsj byaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=eN8+eR8AJAlCzAe6aRKwBFZ94zTbqJRc3z44p4oPAck=; b=WqcqiTAZKdMmyHNnR79WpwgWrDzndBw5wBrwpVG6XM6UGqYihYuu7LdyGoehNrK9iI HQxOLE0YQiCA4x3Hgn1dDL48dpbDOIMH1/KZxpS/Bz4QQgUIY0KCLdAkbgX2pgb2uft+ zN+uPGkyCuC/To1nw5foAg3N4uWXtdEEr0qmU6jh8FKUqAVrqRdWy8LvDmqsZ+gaFjTs 0DWt7vIaUjV5DFtQu7vCEZgYbzdXwm2Pwo/CwBmoz8dizwBg/WkdxRdlIiXbGFTmHmk+ bqn2HyVG8AQdzXydHWx8gMnwDs3TWKmHEk3Fsh+azvSKTxUgXU85jqyw4phNVfseaRlj t03A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=nKL1lZcd; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m7si55374edd.133.2021.06.09.08.36.12; Wed, 09 Jun 2021 08:36:36 -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; dkim=pass header.i=@chromium.org header.s=google header.b=nKL1lZcd; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237692AbhFIOTO (ORCPT + 99 others); Wed, 9 Jun 2021 10:19:14 -0400 Received: from mail-il1-f173.google.com ([209.85.166.173]:44895 "EHLO mail-il1-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237686AbhFIOTO (ORCPT ); Wed, 9 Jun 2021 10:19:14 -0400 Received: by mail-il1-f173.google.com with SMTP id i17so26281016ilj.11 for ; Wed, 09 Jun 2021 07:17:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=eN8+eR8AJAlCzAe6aRKwBFZ94zTbqJRc3z44p4oPAck=; b=nKL1lZcdAIrnIUr94pyY8xPmYLDscVVSqjC8tPRaNT/Jdo0cIsYXYxdqeAm73Um5z+ t1ksbwzZSDhNpd6vcguU9iWR6GAiRnzG/Df/hUwX1tWDG9n11vCbCLcvL4sSWqXl6yhc rbrY5TSxSTR7564S3VpN9AYicF17NrPXBkv20= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=eN8+eR8AJAlCzAe6aRKwBFZ94zTbqJRc3z44p4oPAck=; b=C4orpUZTVvbsntC0qoSOgzb46AYq5r8DOy6CIynM2ZTKI0ZWNqORFbKcRJtsXKrmrk o+nVFFp4YEBQeXCXcj6O+sZUIZiK38TfJa6hug20kOlI42ecLcGSDy8/SqYkh7V2jpjs q3MVXTT1K4Rpr2JZ4NOsiXgBzgLCJTuR4OwkG/eKAhXSELFX3aL+CKT6tHDifCt2bIhv OkbyC9+GN+5joXV8kGRtmzL+190rGnBpQGkPXgxDPwTUljBLbKXIfh8JR0SjyDDuqlY+ yPl7ONI1+w7kNkHht30MkJyXgY9fiy7gazc1DHeaOAInWrXZ+2CMOMhQ83XNgvHnJNFm RGJA== X-Gm-Message-State: AOAM532JpHvjoMQQrkzZ4mowOPC4OixvL10+4SZ/wpqansAtftAidiZs 5Enxzp2OXafzEdVAgmS1xcteogHtaE8IlQ== X-Received: by 2002:a02:9109:: with SMTP id a9mr188745jag.93.1623248167951; Wed, 09 Jun 2021 07:16:07 -0700 (PDT) Received: from mail-il1-f178.google.com (mail-il1-f178.google.com. [209.85.166.178]) by smtp.gmail.com with ESMTPSA id u18sm97637ilb.51.2021.06.09.07.16.07 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 09 Jun 2021 07:16:07 -0700 (PDT) Received: by mail-il1-f178.google.com with SMTP id x18so26300765ila.10 for ; Wed, 09 Jun 2021 07:16:07 -0700 (PDT) X-Received: by 2002:a05:6638:27a:: with SMTP id x26mr204405jaq.144.1623248166593; Wed, 09 Jun 2021 07:16:06 -0700 (PDT) MIME-Version: 1.0 References: <20210604092638.985694-1-ribalda@chromium.org> In-Reply-To: From: Ricardo Ribalda Date: Wed, 9 Jun 2021 16:15:55 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] tools/perf: Do not set a variable unless it will be used To: Peter Zijlstra Cc: Linux Kernel Mailing List , linux-perf-users@vger.kernel.org, Ingo Molnar , Arnaldo Carvalho de Melo Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Peter On Tue, 8 Jun 2021 at 13:29, Peter Zijlstra wrote: > > On Fri, Jun 04, 2021 at 09:24:23PM +0200, Ricardo Ribalda wrote: > > Hi Peter > > > > On Fri, 4 Jun 2021 at 11:36, Peter Zijlstra wrote: > > > > > > On Fri, Jun 04, 2021 at 11:26:38AM +0200, Ricardo Ribalda wrote: > > > > clang-13 triggers the following warning: > > > > > > > > bench/inject-buildid.c:351:6: error: variable 'len' set but not used [-Werror,-Wunused-but-set-variable] > clue here: ^^^^^^^^^^^^^ > > > > > u64 len = 0; > > > > > > > > This patch sets the value to len only if it will be used afterwards. > > > > > > My vote would be to kill that warning, what absolute shite. > > > > My knowledge of llvm codebase is close to NULL, so it is much easier > > for me to "fix" the code. > > That's what -Wno-unused-but-set-variable is for, which is trivial to add > to the Makefile. Yes, that is quite easy to add, the problem is that we might hide real bugs. I completely agree that this one is borderline :) -- Ricardo Ribalda