[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+V-a8thghtOuzSQ1gW9-_KCswtTpYyN09QbrYDMTnW79TOCNw@mail.gmail.com>
Date: Mon, 4 Dec 2023 20:32:10 +0000
From: "Lad, Prabhakar" <prabhakar.csengg@...il.com>
To: Charlie Jenkins <charlie@...osinc.com>
Cc: Paul Walmsley <paul.walmsley@...ive.com>,
Palmer Dabbelt <palmer@...belt.com>,
Albert Ou <aou@...s.berkeley.edu>, Ron Economos <re@...z.net>,
Samuel Holland <samuel.holland@...ive.com>,
Andreas Schwab <schwab@...ux-m68k.org>,
linux-riscv@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4 2/2] riscv: Correct type casting in module loading
On Mon, Nov 27, 2023 at 10:08 PM Charlie Jenkins <charlie@...osinc.com> wrote:
>
> Use __le16 with le16_to_cpu.
>
> Fixes: 8fd6c5142395 ("riscv: Add remaining module relocations")
> Signed-off-by: Charlie Jenkins <charlie@...osinc.com>
> Reviewed-by: Samuel Holland <samuel.holland@...ive.com>
> Tested-by: Samuel Holland <samuel.holland@...ive.com>
> ---
> arch/riscv/kernel/module.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
Tested-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@...renesas.com> #On
RZ/Five SMARC EVK
Cheers,
Prabhakar
> diff --git a/arch/riscv/kernel/module.c b/arch/riscv/kernel/module.c
> index 53593fe58cd8..aac019ed63b1 100644
> --- a/arch/riscv/kernel/module.c
> +++ b/arch/riscv/kernel/module.c
> @@ -55,7 +55,7 @@ static bool riscv_insn_valid_32bit_offset(ptrdiff_t val)
>
> static int riscv_insn_rmw(void *location, u32 keep, u32 set)
> {
> - u16 *parcel = location;
> + __le16 *parcel = location;
> u32 insn = (u32)le16_to_cpu(parcel[0]) | (u32)le16_to_cpu(parcel[1]) << 16;
>
> insn &= keep;
> @@ -68,7 +68,7 @@ static int riscv_insn_rmw(void *location, u32 keep, u32 set)
>
> static int riscv_insn_rvc_rmw(void *location, u16 keep, u16 set)
> {
> - u16 *parcel = location;
> + __le16 *parcel = location;
> u16 insn = le16_to_cpu(*parcel);
>
> insn &= keep;
>
> --
> 2.42.0
>
>
> _______________________________________________
> linux-riscv mailing list
> linux-riscv@...ts.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-riscv
Powered by blists - more mailing lists