[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v4 02/42] xen/riscv: address violation of MISRA C Rule 20.12 in csr_write64()
- To: Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>
- From: Baptiste Le Duc <baptiste.le-duc@xxxxxxxxxx>
- Date: Wed, 18 Nov 2026 10:50:08 +0100
- Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References:Feedback-ID"
- Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx, Romain Caritey <Romain.Caritey@xxxxxxxxxxxxx>, Alistair Francis <alistair.francis@xxxxxxx>, Baptiste Le Duc <baptiste.le-duc@xxxxxxxxxx>, Connor Davis <connojdavis@xxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, Roger Pau Monné <roger@xxxxxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>
- Delivery-date: Wed, 18 Nov 2026 09:50:36 +0000
- Feedback-id: default:8631fc262581453bbf619ec5b2062170:Sweego
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On Fri, 13 Nov 2026 16:48:23 +0100, Oleksii Kurochko
<oleksii.kurochko@xxxxxxxxx> wrote:
> csr_write64() uses its csr parameter both as an operand of ## (to form the
> name of the CSR holding the upper half on RV32) and in ordinary,
> macro-expanded context. As the CSR_* constants are macros themselves, this
> violates MISRA C Rule 20.12.
>
> Make csr_write64() take the CSR name without the CSR_ prefix and paste the
> prefix as well, so that the parameter is used as an operand of ## only.
>
> [...]
Reviewed-by: Baptiste Le Duc <baptiste.le-duc@xxxxxxxxxx>
--
Baptiste Le Duc <baptiste.le-duc@xxxxxxxxxx>
|