From nobody Tue Apr 7 02:34:20 2026 Received: from mail-dl1-f73.google.com (mail-dl1-f73.google.com [74.125.82.73]) (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 026D42C11F8 for ; Tue, 17 Mar 2026 03:06:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.73 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773716778; cv=none; b=lgPBszPzmCE/CMXgOEzf6lzGUL9CSW5EEzNUU0RUcHdNUyrQid3X+eZTQagM+n4Q9vuPYVm/OhqHifWJfGsA/zrVGkWHomlOJbM3fnyXc1EJ6k+cRe0YTIfQ9+kJ4VJI4mH8HznLUSsOik/zo3kdvqZ63lSBBN9jlyda09kTsRY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773716778; c=relaxed/simple; bh=4mSJoDt19c1s52Ar2qiFo/PGbNpyNgJireRDLID11TM=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=I1v1wLsAil0vMRFRcA80a9okLlyzJlEjUeWZJiWiElzDXVUxOZSuCcqns+RmaSy4LjMkEeaITYh2tbvvjXIBvx813VoMualkneMQ+GT3KSXnPuOIDvdqc1RNCd0OMltrIPBkUgg8X5Lm4WoDzSLykdLxtIHljo1YG97A+XFIdzA= 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=HP0tPOAR; arc=none smtp.client-ip=74.125.82.73 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="HP0tPOAR" Received: by mail-dl1-f73.google.com with SMTP id a92af1059eb24-128d0b690feso106724189c88.0 for ; Mon, 16 Mar 2026 20:06:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1773716775; x=1774321575; 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=jjPd8hYb03Ftsdibhr+aMw0AWnG2dzFR9qnmX2QMSHk=; b=HP0tPOARz4AVg+nU+dQLdliv3gbLBE1W7dMxYtdFa6KKfj57ZZxwoDaIgh60MFvy1e SAuhFGzTAv/N2if3rk+0KWoXyO+CII+jwhKeFVMZyseL1GtCPnLXH5JPI2wA/bN79+uV f8qSu33FxWr6ACkz0ep9yEQDA4t5bsP9mLj4iOqOOT3GtPVXgY9iSMw4imkDfHIiXaNr OaRgUvRXqowEsSDzXjAtD8B7/RG9ulCCf88hDEjTMPQkQEPwm9sRSiFUGGAiBub8fzrI FPj/GV0C7+p1UHrNp+DPZzZzy3wCRo1NhmYiC0FnijDbpaptYP4m4dmLI5BJgeAR3dKr A7kQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773716775; x=1774321575; 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=jjPd8hYb03Ftsdibhr+aMw0AWnG2dzFR9qnmX2QMSHk=; b=JIrrEJB++J3Xz1/Ec2doq0f6ALcAvTTVpz8SPMsuIblzctCRa93JV3lIdAp4gojLiq g7nKoq5Brw+pvXOu9jSmpy4nL8P/0fKVZZ49He62oeD12LeihksoEXDSt5HXdoB/mAsD LTSwYhCR5UsQL+V3LRMxarTPBQbsB3QNZTtU7f6/qLUijilX3t3Vd9yzpYP7CBUu2CcE IofAdRTiye0WozE4jzmzp8NLy1kFLhdMrnnO3Ax9rib/PhnXN79hoBkAmzxZcMZQGhnw GAmN6QSjxkkY6mtpierhdzy8mtshM2HOGqVOj0SMeOrR1rvxLrOMSxgAMrLqdCrCL2Jq CPYw== X-Forwarded-Encrypted: i=1; AJvYcCVYEpDIHcs0j99UNu04IndJ2sbqAS+PjpFrK0coGx68COn9DDCcPx/pjIrwX1KrkrpDsv2HQyE8KjYo5yA=@vger.kernel.org X-Gm-Message-State: AOJu0Yw2JcqYqUnCBgooUquGfgziWXIvpCoNu/2vnzMCqCvDS6K2acJX hFPRsDBHTCt/DcBgOfrA+PJxazLyqOpWzIbD2xWFwOzAafbK92/bFl/jyNAZ+I3ygoZLZi45u14 vEgNgJrt5Eg== X-Received: from dlbrs10.prod.google.com ([2002:a05:7022:f68a:b0:128:cf1e:df72]) (user=irogers job=prod-delivery.src-stubby-dispatcher) by 2002:a05:7022:2207:b0:11d:c86c:652e with SMTP id a92af1059eb24-128f3d1bb6bmr8508921c88.5.1773716774841; Mon, 16 Mar 2026 20:06:14 -0700 (PDT) Date: Mon, 16 Mar 2026 20:05:58 -0700 In-Reply-To: <20260317030601.567422-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: <20260317030601.567422-1-irogers@google.com> X-Mailer: git-send-email 2.53.0.851.ga537e3e6e9-goog Message-ID: <20260317030601.567422-3-irogers@google.com> Subject: [PATCH v4 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 --- 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