mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Namhyung Kim <namhyung@kernel.org>
To: Arnaldo Carvalho de Melo <acme@kernel.org>,
	 Ian Rogers <irogers@google.com>,
	Kan Liang <kan.liang@linux.intel.com>,
	 Namhyung Kim <namhyung@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>,
	Adrian Hunter <adrian.hunter@intel.com>,
	 Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@kernel.org>,
	 LKML <linux-kernel@vger.kernel.org>,
	linux-perf-users@vger.kernel.org,  bpf@vger.kernel.org
Subject: Re: [PATCH 1/2] perf tools: Fix possible compiler warnings in hashmap
Date: Wed, 16 Oct 2024 10:12:41 -0700	[thread overview]
Message-ID: <172909876148.288721.10451526265503632803.b4-ty@kernel.org> (raw)
In-Reply-To: <20241009202009.884884-1-namhyung@kernel.org>

On Wed, 09 Oct 2024 13:20:08 -0700, Namhyung Kim wrote:

> The hashmap__for_each_entry[_safe] is accessing 'map' as if it's a
> pointer.  But it does without parentheses so passing a static hash map
> with an ampersand (like &slab_hash below) caused compiler warnings due
> to unmatched types.
> 
>   In file included from util/bpf_lock_contention.c:5:
>   util/bpf_lock_contention.c: In function ‘exit_slab_cache_iter’:
>   linux/tools/perf/util/hashmap.h:169:32: error: invalid type argument of ‘->’ (have ‘struct hashmap’)
>     169 |         for (bkt = 0; bkt < map->cap; bkt++)                                \
>         |                                ^~
>   util/bpf_lock_contention.c:105:9: note: in expansion of macro ‘hashmap__for_each_entry’
>     105 |         hashmap__for_each_entry(&slab_hash, cur, bkt)
>         |         ^~~~~~~~~~~~~~~~~~~~~~~
>   /home/namhyung/project/linux/tools/perf/util/hashmap.h:170:31: error: invalid type argument of ‘->’ (have ‘struct hashmap’)
>     170 |                 for (cur = map->buckets[bkt]; cur; cur = cur->next)
>         |                               ^~
>   util/bpf_lock_contention.c:105:9: note: in expansion of macro ‘hashmap__for_each_entry’
>     105 |         hashmap__for_each_entry(&slab_hash, cur, bkt)
>         |         ^~~~~~~~~~~~~~~~~~~~~~~
> 
> [...]

Applied to perf-tools-next, thanks!

Best regards,
Namhyung


      parent reply	other threads:[~2024-10-16 17:12 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-09 20:20 Namhyung Kim
2024-10-09 20:20 ` [PATCH 2/2] perf tools: Remove unnecessary parentheses Namhyung Kim
2024-10-11  1:48 ` [PATCH 1/2] perf tools: Fix possible compiler warnings in hashmap Andrii Nakryiko
2024-10-11 16:44   ` Namhyung Kim
2024-10-11 18:00     ` Andrii Nakryiko
2024-10-16 17:12 ` Namhyung Kim [this message]

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=172909876148.288721.10451526265503632803.b4-ty@kernel.org \
    --to=namhyung@kernel.org \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=bpf@vger.kernel.org \
    --cc=irogers@google.com \
    --cc=jolsa@kernel.org \
    --cc=kan.liang@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.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

all inboxes | Powered by JetHome®