qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v1 25/43] target/loongarch: Add LoongArch CSR instruction


From: yangxiaojuan
Subject: Re: [PATCH v1 25/43] target/loongarch: Add LoongArch CSR instruction
Date: Mon, 18 Apr 2022 20:38:29 +0800
User-agent: Mozilla/5.0 (X11; Linux loongarch64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0


On 2022/4/16 上午9:04, Richard Henderson wrote:
+int cpu_csr_offset(unsigned csr_num);
...
+static const uint64_t csr_offsets[] = {

There's no reason for this array to be uint64_t.
It really should match the function.
Yes,  we shoud do this.

If we use 'int', we may get a warning:
../target/loongarch/csr_helper.c:49:30: warning: overflow in implicit constant conversion [-Woverflow]
      [LOONGARCH_CSR_CPUID] = offsetof(CPUState, cpu_index)
                                                ^~~~~~~~
How about use 'long'?  I had tested it no warning.

Thanks.
Xiaojuan

reply via email to

[Prev in Thread] Current Thread [Next in Thread]