Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

perf namespaces: Fixup the nsinfo__in_pidns() return type, its bool

When adding support for refconunt checking a cut'n'paste made this
function, that is just an accessor to a bool member of 'struct nsinfo',
return a pid_t, when that member is a boolean, fix it.

Fixes: bcaf0a97858de7ab ("perf namespaces: Add functions to access nsinfo")
Reported-by: Francesco Nigro <fnigro@redhat.com>
Reported-by: Ilan Green <igreen@redhat.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Clark Williams <williams@redhat.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: James Clark <james.clark@linaro.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Yonatan Goldschmidt <yonatan.goldschmidt@granulate.io>
Link: https://lore.kernel.org/r/20241206204828.507527-6-acme@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

+2 -2
+1 -1
tools/perf/util/namespaces.c
··· 266 266 return RC_CHK_ACCESS(nsi)->pid; 267 267 } 268 268 269 - pid_t nsinfo__in_pidns(const struct nsinfo *nsi) 269 + bool nsinfo__in_pidns(const struct nsinfo *nsi) 270 270 { 271 271 return RC_CHK_ACCESS(nsi)->in_pidns; 272 272 }
+1 -1
tools/perf/util/namespaces.h
··· 58 58 pid_t nsinfo__tgid(const struct nsinfo *nsi); 59 59 pid_t nsinfo__nstgid(const struct nsinfo *nsi); 60 60 pid_t nsinfo__pid(const struct nsinfo *nsi); 61 - pid_t nsinfo__in_pidns(const struct nsinfo *nsi); 61 + bool nsinfo__in_pidns(const struct nsinfo *nsi); 62 62 void nsinfo__set_in_pidns(struct nsinfo *nsi); 63 63 64 64 void nsinfo__mountns_enter(struct nsinfo *nsi, struct nscookie *nc);