From 6f03770daccaffc39a4ce61854ab126020374112 Mon Sep 17 00:00:00 2001 From: Bin Meng Date: Tue, 19 Jan 2021 10:52:03 +0800 Subject: [PATCH] target/riscv: Declare csr_ops[] with a known size MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit csr_ops[] is currently declared with an unknown size in cpu.h. Since the array size is known, let's do a complete declaration. Signed-off-by: Bin Meng Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Alistair Francis Message-id: 1611024723-14293-1-git-send-email-bmeng.cn@gmail.com Signed-off-by: Alistair Francis --- target/riscv/cpu.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h index 02758ae0eb..419a21478c 100644 --- a/target/riscv/cpu.h +++ b/target/riscv/cpu.h @@ -487,7 +487,7 @@ enum { }; /* CSR function table */ -extern riscv_csr_operations csr_ops[]; +extern riscv_csr_operations csr_ops[CSR_TABLE_SIZE]; void riscv_get_csr_ops(int csrno, riscv_csr_operations *ops); void riscv_set_csr_ops(int csrno, riscv_csr_operations *ops);