Commit 1e3b91d6 authored by Ian Rogers's avatar Ian Rogers Committed by Arnaldo Carvalho de Melo
Browse files

perf disasm: Constify use of 'struct ins_op'



The 'struct ins_op' holds variables to function pointers that are read
but not written. Change uses to be for a "const struct ins_op *"
version to capture this immutability.

Reviewed-by: default avatarJames Clark <james.clark@linaro.org>
Signed-off-by: default avatarIan Rogers <irogers@google.com>
Cc: Aditya Bodkhe <aditya.b1@linux.ibm.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Albert Ou <aou@eecs.berkeley.edu>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Alexandre Ghiti <alex@ghiti.fr>
Cc: Athira Rajeev <atrajeev@linux.ibm.com>
Cc: Bill Wendling <morbo@google.com>
Cc: Dr. David Alan Gilbert <linux@treblig.org>
Cc: Guo Ren <guoren@kernel.org>
Cc: Howard Chu <howardchu95@gmail.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: John Garry <john.g.garry@oracle.com>
Cc: Julia Lawall <Julia.Lawall@inria.fr>
Cc: Justin Stitt <justinstitt@google.com>
Cc: Krzysztof Łopatowski <krzysztof.m.lopatowski@gmail.com>
Cc: Leo Yan <leo.yan@linux.dev>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Nathan Chancellor <nathan@kernel.org>
Cc: Nick Desaulniers <nick.desaulniers+lkml@gmail.com>
Cc: Palmer Dabbelt <palmer@dabbelt.com>
Cc: Paul Walmsley <pjw@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Sergei Trofimovich <slyich@gmail.com>
Cc: Shimin Guo <shimin.guo@skydio.com>
Cc: Suchit Karunakaran <suchitkarunakaran@gmail.com>
Cc: Thomas Falcon <thomas.falcon@intel.com>
Cc: Tianyou Li <tianyou.li@intel.com>
Cc: Will Deacon <will@kernel.org>
Cc: Zecheng Li <zecheng@google.com>
Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 57d26593
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -11,10 +11,10 @@ struct arm_annotate {
		jump_insn;
};

static struct ins_ops *arm__associate_instruction_ops(struct arch *arch, const char *name)
static const struct ins_ops *arm__associate_instruction_ops(struct arch *arch, const char *name)
{
	struct arm_annotate *arm = arch->priv;
	struct ins_ops *ops;
	const struct ins_ops *ops;
	regmatch_t match[2];

	if (!regexec(&arm->call_insn, name, 2, match, 0))
+3 −3
Original line number Diff line number Diff line
@@ -63,15 +63,15 @@ static int arm64_mov__parse(const struct arch *arch __maybe_unused,
static int mov__scnprintf(struct ins *ins, char *bf, size_t size,
			  struct ins_operands *ops, int max_ins_name);

static struct ins_ops arm64_mov_ops = {
static const struct ins_ops arm64_mov_ops = {
	.parse	   = arm64_mov__parse,
	.scnprintf = mov__scnprintf,
};

static struct ins_ops *arm64__associate_instruction_ops(struct arch *arch, const char *name)
static const struct ins_ops *arm64__associate_instruction_ops(struct arch *arch, const char *name)
{
	struct arm64_annotate *arm = arch->priv;
	struct ins_ops *ops;
	const struct ins_ops *ops;
	regmatch_t match[2];

	if (!regexec(&arm->jump_insn, name, 2, match, 0))
+3 −3
Original line number Diff line number Diff line
@@ -3,10 +3,10 @@

#include <linux/compiler.h>

static struct ins_ops *csky__associate_ins_ops(struct arch *arch,
static const struct ins_ops *csky__associate_ins_ops(struct arch *arch,
						     const char *name)
{
	struct ins_ops *ops = NULL;
	const struct ins_ops *ops = NULL;

	/* catch all kind of jumps */
	if (!strcmp(name, "bt") ||
+4 −4
Original line number Diff line number Diff line
@@ -51,7 +51,7 @@ static int loongarch_call__parse(const struct arch *arch, struct ins_operands *o
	return 0;
}

static struct ins_ops loongarch_call_ops = {
static const struct ins_ops loongarch_call_ops = {
	.parse	   = loongarch_call__parse,
	.scnprintf = call__scnprintf,
};
@@ -100,15 +100,15 @@ static int loongarch_jump__parse(const struct arch *arch, struct ins_operands *o
	return 0;
}

static struct ins_ops loongarch_jump_ops = {
static const struct ins_ops loongarch_jump_ops = {
	.parse	   = loongarch_jump__parse,
	.scnprintf = jump__scnprintf,
};

static
struct ins_ops *loongarch__associate_ins_ops(struct arch *arch, const char *name)
const struct ins_ops *loongarch__associate_ins_ops(struct arch *arch, const char *name)
{
	struct ins_ops *ops = NULL;
	const struct ins_ops *ops = NULL;

	if (!strcmp(name, "bl"))
		ops = &loongarch_call_ops;
+2 −2
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0

static
struct ins_ops *mips__associate_ins_ops(struct arch *arch, const char *name)
const struct ins_ops *mips__associate_ins_ops(struct arch *arch, const char *name)
{
	struct ins_ops *ops = NULL;
	const struct ins_ops *ops = NULL;

	if (!strncmp(name, "bal", 3) ||
	    !strncmp(name, "bgezal", 6) ||
Loading