From: Andrew Jones <ajones@ventanamicro.com>
To: Huang Borong <huangborong@bosc.ac.cn>
Cc: palmer@dabbelt.com, alistair.francis@wdc.com, bmeng.cn@gmail.com,
liwei1518@gmail.com, dbarboza@ventanamicro.com,
zhiwei_liu@linux.alibaba.com, qemu-riscv@nongnu.org,
qemu-devel@nongnu.org
Subject: Re: [PATCH v1] hw/intc/riscv_aplic: Remove redundant masking of hart_idx in riscv_aplic_msi_send()
Date: Tue, 14 Jan 2025 16:43:03 +0100 [thread overview]
Message-ID: <20250114-7c4508bf00bdc4455c3bcf49@orel> (raw)
In-Reply-To: <20250114025320.52696-1-huangborong@bosc.ac.cn>
Drop "in riscv_aplic_msi_send()" from the patch summary to make it more
concise.
On Tue, Jan 14, 2025 at 10:53:19AM +0800, Huang Borong wrote:
> The line "hart_idx &= APLIC_xMSICFGADDR_PPN_LHX_MASK(lhxw);" was removed
This just states what we can easily read from the patch.
> because the same operation is performed later in the address calculation.
This is useful information that should stay in the commit message.
> This change improves code clarity and avoids unnecessary operations.
You don't need to justify removing redundant lines of code, you just need
to justify that they're actually redundant.
Daniel's point about the log message is important and should be pointed
out in the commit message.
Thanks,
drew
>
> Signed-off-by: Huang Borong <huangborong@bosc.ac.cn>
> ---
> hw/intc/riscv_aplic.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/hw/intc/riscv_aplic.c b/hw/intc/riscv_aplic.c
> index 4866649115..0974c6a5db 100644
> --- a/hw/intc/riscv_aplic.c
> +++ b/hw/intc/riscv_aplic.c
> @@ -421,7 +421,6 @@ static void riscv_aplic_msi_send(RISCVAPLICState *aplic,
> APLIC_xMSICFGADDRH_HHXW_MASK;
>
> group_idx = hart_idx >> lhxw;
> - hart_idx &= APLIC_xMSICFGADDR_PPN_LHX_MASK(lhxw);
>
> addr = msicfgaddr;
> addr |= ((uint64_t)(msicfgaddrH & APLIC_xMSICFGADDRH_BAPPN_MASK)) << 32;
> --
> 2.34.1
>
>
prev parent reply other threads:[~2025-01-14 15:43 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-14 2:53 [PATCH v1] hw/intc/riscv_aplic: Remove redundant masking of hart_idx in riscv_aplic_msi_send() Huang Borong
2025-01-14 13:08 ` Daniel Henrique Barboza
2025-01-14 15:43 ` Andrew Jones [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250114-7c4508bf00bdc4455c3bcf49@orel \
--to=ajones@ventanamicro.com \
--cc=alistair.francis@wdc.com \
--cc=bmeng.cn@gmail.com \
--cc=dbarboza@ventanamicro.com \
--cc=huangborong@bosc.ac.cn \
--cc=liwei1518@gmail.com \
--cc=palmer@dabbelt.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-riscv@nongnu.org \
--cc=zhiwei_liu@linux.alibaba.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.