Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp2778341lqz; Wed, 3 Apr 2024 08:21:37 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUGx9SHUYkFhtTfdQejbUCJSfOeLras+RcJzBI7bFDHk+MNdGpzaR6XgjlEGERfGD29/0bvGePAUKPznwqmq3AjAwYqzYf6aN9eFK5KXA== X-Google-Smtp-Source: AGHT+IHziFJdjC166LT6dwPEVTvJmMXW4T3kiRuEWL68d8rXEHEQv8CUwYPVU8wksvZ3rPYM5GYK X-Received: by 2002:a17:906:384d:b0:a46:a1d0:8451 with SMTP id w13-20020a170906384d00b00a46a1d08451mr10925659ejc.16.1712157697110; Wed, 03 Apr 2024 08:21:37 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712157697; cv=pass; d=google.com; s=arc-20160816; b=GKLrgFpg1gaRPkKRC3B0gxr2eNu+z0trvrGPEiUuvklMlae2zShDLiMQuBSs7N18P0 T1k3egycoIcYV1k4f38N+lT8eqkwLN8b+Z7h0XEN1YqHjMvirsneaEBsaCREffk/kcWp P/JDF+5SRgZwSmizNUg9hqOAfptn8zdqBjmlqdme7sbYwNPG7rE/TypMlLg1QKo+SNrQ Zr9jwgTbzxTr1Aso0449enUyethCMemW1t5U4ic9VYs1E0QY80EOeM/hceKmN8z2ehS2 sNyYGmDgmdW/oNFnflbecWYEXd//IreviwUUUBM2SyYqVSg02WLO6wUerr2LPAgIIh7P uxJA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-disposition:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:message-id:subject:cc:to:from:date :dkim-signature; bh=+7qkx0gFpfA0F0VKOpNVnR4L4uic0KI5qG/iEtdQHtI=; fh=EyWe0P73fPyeDH747e0yQkqJr8jU9wEoh208ROYzUDg=; b=ecYVeSAh3AwAnhcF37OJOz8Tt0p8juvYrOBlePB4dWOhcYZdvC/Xh4r4iM5FaI89El 12xLlEu0kXYwNzKONico8grHRj+vROxI5IpNYknIiYxWnPMcmu8CJVkvYgyd9qLJYT+5 ov7fz3Xh8COqrN49y/3jCXKZRnPdTJ1qzkmmpoHiUabR1JENBrNtrZ3bnKTNlqAvyS0B YqMQPGC7CD5eBt5doZc0dnMfy1VnTEQmsEqXUVosVKPeDbfyH+1kXO36ndKv2sayBdcr YG33ZyyYlpDNOkd34J68SaE0mz8V7cd0its8dlzYxRy8pxizcw5br8xJOvXozc9e9u7k vvFg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=EV7hJIgP; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-130078-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-130078-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id ds20-20020a170907725400b00a4e8aaa9f04si2018912ejc.518.2024.04.03.08.21.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Apr 2024 08:21:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-130078-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=EV7hJIgP; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-130078-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-130078-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 8614D1F2205C for ; Wed, 3 Apr 2024 15:20:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2288B14D6E2; Wed, 3 Apr 2024 15:16:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="EV7hJIgP" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 48D7826292 for ; Wed, 3 Apr 2024 15:16:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712157380; cv=none; b=EexPlykUWrzUxde6zncQJxNdWbzk9OJY0PuZJp+wbM8ayjXVNZIi6rN3nG+nhVz0a12i/3ma2XR62hy0BCz3PZOZuTKBrEJQgCpupAnvau8iZsJDNZBSkOGVfOnrORGI5gb8fJkr7N9TpqkzFX9GIymeJ3mA8RT67cNOT20UvPY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712157380; c=relaxed/simple; bh=riKi8wnczMz8UTMFc9nPxQ0MsS2H5IgGazls9fbwT4c=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=bwrYjyXCBZP3yfpQ9rznWBSwRNtvuCWIYn6wkfY8eKZhygJGo8do5hMYyO4KGuWxcCV/g/CHwOlLJWnb/swd1B3zSsVgHBHDv34/pWOguhn7pantwuJyG3VfDBjB6yGkyTgco2jJ3z7FEh0LXe0TJ/mYcCIULgaOJ/mqRBF87UM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=EV7hJIgP; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id B534EC433C7; Wed, 3 Apr 2024 15:16:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1712157380; bh=riKi8wnczMz8UTMFc9nPxQ0MsS2H5IgGazls9fbwT4c=; h=Date:From:To:Cc:Subject:From; b=EV7hJIgPnUPfC1PqLnYiJNImMHGwrLVqxEmvCO4iL+TKaQc1EpHlvXdEBpNY6EAgD JrI89htlDHWXATzVVXSd3PWcnt7Z6V9uFQoUU+BOnPnipbYZAlgUJ4iTIkenfxYXxp jNOQb0aQsz4OB+7EtY33o2S2bom2VKEzyxJhnWK6Fx/ZEAHMOHo28aixPTuYbs+itR YRRy9W1sa7bWB3fDIyMoEKPYcJSabc67NAgh0n39pQUJNXHTNbf7LmWBlw5zIetod5 RtsPAwHCixvoWgmceTl/98nvwxLA/8h9SwEB1nAATC40QSKlCSiFlVEPrTgKLGVPHB lopy4vxdM69YA== Date: Wed, 3 Apr 2024 12:16:16 -0300 From: Arnaldo Carvalho de Melo To: Namhyung Kim Cc: Adrian Hunter , Ian Rogers , Jiri Olsa , Linux Kernel Mailing List Subject: [PATCH 1/1] perf annotate: Initialize 'arch' variable not to trip some -Werror=maybe-uninitialized Message-ID: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In some older distros the build is failing due to -Werror=maybe-uninitialized, in this case we know that this isn't the case because 'arch' gets initialized by evsel__get_arch(), so just init it to NULL to silence those cases. E.g.: 32 17.12 opensuse:15.5 : FAIL gcc version 7.5.0 (SUSE Linux) util/annotate.c: In function 'hist_entry__get_data_type': util/annotate.c:2269:15: error: 'arch' may be used uninitialized in this function [-Werror=maybe-uninitialized] struct arch *arch; ^~~~ cc1: all warnings being treated as errors 43 7.30 ubuntu:18.04-x-powerpc64el : FAIL gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04) util/annotate.c: In function 'hist_entry__get_data_type': util/annotate.c:2351:36: error: 'arch' may be used uninitialized in this function [-Werror=maybe-uninitialized] if (map__dso(ms->map)->kernel && arch__is(arch, "x86") && ^~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors Cc: Adrian Hunter Cc: Ian Rogers Cc: Jiri Olsa Cc: Namhyung Kim Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/annotate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c index b795f27f26024f35..f316e0b65897957a 100644 --- a/tools/perf/util/annotate.c +++ b/tools/perf/util/annotate.c @@ -2266,7 +2266,7 @@ struct annotated_data_type *hist_entry__get_data_type(struct hist_entry *he) { struct map_symbol *ms = &he->ms; struct evsel *evsel = hists_to_evsel(he->hists); - struct arch *arch; + struct arch *arch = NULL; struct disasm_line *dl; struct annotated_insn_loc loc; struct annotated_op_loc *op_loc; -- 2.44.0