linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tony Jones <tonyj@suse.de>
To: Namhyung Kim <namhyung@kernel.org>
Cc: Michal Suchanek <msuchanek@suse.de>, linux-perf-users@vger.kernel.org
Subject: Re: [PATCH] perf hwmon_pmu: Fix uninitialized variable warning
Date: Thu, 23 Oct 2025 15:11:37 -0700	[thread overview]
Message-ID: <aPqoGTyM9nKSQYQ9@suse.de> (raw)
In-Reply-To: <aPqjMzxyYeKCp91K@google.com>

On Thu, Oct 23, 2025 at 02:50:43PM -0700, Namhyung Kim wrote:
> Hello,
> 
> On Wed, Oct 22, 2025 at 12:38:35PM +0200, Michal Suchanek wrote:
> > The line_len is only set on success. Check the return value instead.
> 
> Can you please share the actual warning messages from the compiler?
> 
> Thanks,
> Namhyung

[snipped CC]

I believe it was the following (gcc13):

[   38s] util/hwmon_pmu.c: In function ‘perf_pmus__read_hwmon_pmus’:
[   38s] util/hwmon_pmu.c:742:20: warning: ‘line_len’ may be used uninitialized [-Wmaybe-uninitialized]
[   38s]   742 |                 if (line_len > 0 && line[line_len - 1] == '\n')
[   38s]       |                    ^
[   38s] util/hwmon_pmu.c:719:24: note: ‘line_len’ was declared here
[   38s]   719 |                 size_t line_len;
[   38s]  


Tony

  reply	other threads:[~2025-10-23 22:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-22 10:38 [PATCH] perf hwmon_pmu: Fix uninitialized variable warning Michal Suchanek
2025-10-23 21:50 ` Namhyung Kim
2025-10-23 22:11   ` Tony Jones [this message]
2025-10-24  2:10     ` Namhyung Kim
2025-10-30  3:46 ` Namhyung Kim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aPqoGTyM9nKSQYQ9@suse.de \
    --to=tonyj@suse.de \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=msuchanek@suse.de \
    --cc=namhyung@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).