From nobody Mon Apr 6 18:22:51 2026 Received: from mail-dy1-f201.google.com (mail-dy1-f201.google.com [74.125.82.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 66486376479 for ; Wed, 18 Mar 2026 17:58:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773856706; cv=none; b=l/Kv5J7lmv5d+XORm2ECZU9dRy5pavp7r0QgzDz21tEdQLg54z719sy+dRmxmBttEFUfC1h2GWx86qRdKVX4037LmYVFv59BNigUN3g07+u1Kgdw1PfNcXsWbZ+wuAem/eOUkRZGCWZn1rI0NG/SzOy6bQOi+SKzSZyauUkDQNM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773856706; c=relaxed/simple; bh=AT0BGB6UrGLZA1M+tVNdNXzlDjYmvZvAEkPOTSTH+IM=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=SPGvPbxbw9MszFNRA+8j4r3j7JH30/rDk/UuFyYlgb16xMZYy0h1yQokjumT0RGCsPUeWNoWsPdkqtKt94Lc51qLcbsPR5HRLeg4hkGidQ9DMrhuHu7gbsPRPrGQv3ASPX9qVNwRZBpCs5VSgyzd2hpLSYVIkLnEUpbjy43t96g= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=LWCfF2UN; arc=none smtp.client-ip=74.125.82.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="LWCfF2UN" Received: by mail-dy1-f201.google.com with SMTP id 5a478bee46e88-2bdf75bc88fso242497eec.0 for ; Wed, 18 Mar 2026 10:58:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1773856704; x=1774461504; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=tQVp2xNbIouZw2DsKLWRE3G9FMoorezshWZvQPd6XX0=; b=LWCfF2UNhL6Jch4lENdJtDfdQMjYCnFOzHoN2rh4tKKe5Cl42qytHZZ026UAWqrMOo ACUGTC9dreo1Onar5rihAFpmDq75OvJClxhU0djsBdTYxhxEYubWh1k/WoAlLqhNuioh xPjmUeRB1U8b6FeY3lKpWXprUVVQy7G3ARPugdyprX/kGGl0nqibWdN5tWzDd047j5Ro e3qsXozx637II3laFWyYyV0Ew89Hke29fEO3N270aLasXPVPKMaK8UY5NwCalFUfcqRY hdH8cMj1WgwSRCsfsIYfeKs2rmRj6Ssx/w71viUtstAcI0HaIoOs42/my5ISLXcx+zTf 3PPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773856704; x=1774461504; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=tQVp2xNbIouZw2DsKLWRE3G9FMoorezshWZvQPd6XX0=; b=VrfR/bGQs6IHOvWICe/kmN7YkqBQzZ2lPdzXpiG7j+7mkXFig8e51Hu/f/PyLQh4/C YL+uz25o/9NsMnRwYFmvS+RrEdTl9pw8p89eCJhtU3QN2nn2GVBxXOwjmHjmQf8fw1SU vBZUJV9TUKBAIdBEl9fZKihqjQrBzP9xgUvtb/FkW3JFG3du4ZQfT/Ann4IqXAk9Ozkl 3YyW5BNjvDq6alZu4qBA4p0tAS+1Y20dmg6GtEGCfwSj1B4f2zheKoHBfjwdUEOcmnHP MQrY3fnKKur0EZVPsFXvCY/oc9xeIAixyoXTANL+ZfhmsH6JiEd3bSI1yQox5CELeQXW OnCQ== X-Forwarded-Encrypted: i=1; AJvYcCWUDk6YtP0j31AY1hMjyfnX0TM1onDIpn9Gm9xvuHHM/119CwHUca3mwji/NUFJ5L7Ce1mZlqGfxnCc7y0=@vger.kernel.org X-Gm-Message-State: AOJu0YxB8+l0mvjuzHDNoZffMBYswxxEkHOe5AkMhEm+T5Zy+loMlaer 3biCdH1kumlw9ML/+MmGMiQWMwGbwUhcA8claEkg8ledaHVu2K92oWwYeKeuZiYVJNQknI5Cn6Y u6j9mpECY9g== X-Received: from dycrm13.prod.google.com ([2002:a05:693c:2a0d:b0:2c0:d104:830b]) (user=irogers job=prod-delivery.src-stubby-dispatcher) by 2002:a05:7300:dc91:b0:2b7:fdb6:ccf6 with SMTP id 5a478bee46e88-2c0e4fb8e1dmr2171218eec.14.1773856704365; Wed, 18 Mar 2026 10:58:24 -0700 (PDT) Date: Wed, 18 Mar 2026 10:58:05 -0700 In-Reply-To: <20260318175808.582009-1-irogers@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260318175808.582009-1-irogers@google.com> X-Mailer: git-send-email 2.53.0.851.ga537e3e6e9-goog Message-ID: <20260318175808.582009-3-irogers@google.com> Subject: [PATCH v7 2/5] perf target: Constify simple check functions From: Ian Rogers To: tmricht@linux.ibm.com Cc: irogers@google.com, acme@kernel.org, agordeev@linux.ibm.com, gor@linux.ibm.com, hca@linux.ibm.com, japo@linux.ibm.com, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-s390@vger.kernel.org, namhyung@kernel.org, sumanthk@linux.ibm.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Allow the target to be const in callers. Signed-off-by: Ian Rogers Tested-by: Thomas Richter --- tools/perf/util/target.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/perf/util/target.h b/tools/perf/util/target.h index 84ebb9c940c6..bc2bff9c6842 100644 --- a/tools/perf/util/target.h +++ b/tools/perf/util/target.h @@ -49,22 +49,22 @@ uid_t parse_uid(const char *str); =20 int target__strerror(struct target *target, int errnum, char *buf, size_t = buflen); =20 -static inline bool target__has_task(struct target *target) +static inline bool target__has_task(const struct target *target) { return target->tid || target->pid; } =20 -static inline bool target__has_cpu(struct target *target) +static inline bool target__has_cpu(const struct target *target) { return target->system_wide || target->cpu_list; } =20 -static inline bool target__none(struct target *target) +static inline bool target__none(const struct target *target) { return !target__has_task(target) && !target__has_cpu(target); } =20 -static inline bool target__enable_on_exec(struct target *target) +static inline bool target__enable_on_exec(const struct target *target) { /* * Normally enable_on_exec should be set if: @@ -75,12 +75,12 @@ static inline bool target__enable_on_exec(struct target= *target) return target__none(target) && !target->initial_delay; } =20 -static inline bool target__has_per_thread(struct target *target) +static inline bool target__has_per_thread(const struct target *target) { return target->system_wide && target->per_thread; } =20 -static inline bool target__uses_dummy_map(struct target *target) +static inline bool target__uses_dummy_map(const struct target *target) { bool use_dummy =3D false; =20 --=20 2.53.0.851.ga537e3e6e9-goog