All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] spl: atf: Fix clang -Wasm-operand-widths warning
@ 2022-09-26 20:47 Alistair Delva
  2022-10-11 13:56 ` Tom Rini
  0 siblings, 1 reply; 2+ messages in thread
From: Alistair Delva @ 2022-09-26 20:47 UTC (permalink / raw)
  To: u-boot; +Cc: Kever Yang, Michael Walle, Simon Glass, Tom Rini, Nick Desaulniers

common/spl/spl_atf.c:187:51: warning: value size does not match register
  size specified by the constraint and modifier [-Wasm-operand-widths]
    __asm__ __volatile__("msr DAIF, %0\n\t" : : "r" (daif) : "memory");
                                                     ^
common/spl/spl_atf.c:187:34: note: use constraint modifier "w"
    __asm__ __volatile__("msr DAIF, %0\n\t" : : "r" (daif) : "memory");
                                    ^~
                                    %w0

Use %x0 to match what Linux does in <asm/sysreg.h> write_sysreg().

Signed-off-by: Alistair Delva <adelva@google.com>
Cc: Kever Yang <kever.yang@rock-chips.com>
Cc: Michael Walle <michael@walle.cc>
Cc: Simon Glass <sjg@chromium.org>
Cc: Tom Rini <trini@konsulko.com>
Cc: Nick Desaulniers <ndesaulniers@google.com>
---
 common/spl/spl_atf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/spl/spl_atf.c b/common/spl/spl_atf.c
index e1b68dd561..bae5c010c8 100644
--- a/common/spl/spl_atf.c
+++ b/common/spl/spl_atf.c
@@ -184,7 +184,7 @@ __weak struct bl_params *bl2_plat_get_bl31_params_v2(uintptr_t bl32_entry,
 
 static inline void raw_write_daif(unsigned int daif)
 {
-	__asm__ __volatile__("msr DAIF, %0\n\t" : : "r" (daif) : "memory");
+	__asm__ __volatile__("msr DAIF, %x0\n\t" : : "r" (daif) : "memory");
 }
 
 typedef void (*atf_entry_t)(struct bl31_params *params, void *plat_params);
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] spl: atf: Fix clang -Wasm-operand-widths warning
  2022-09-26 20:47 [PATCH] spl: atf: Fix clang -Wasm-operand-widths warning Alistair Delva
@ 2022-10-11 13:56 ` Tom Rini
  0 siblings, 0 replies; 2+ messages in thread
From: Tom Rini @ 2022-10-11 13:56 UTC (permalink / raw)
  To: Alistair Delva
  Cc: u-boot, Kever Yang, Michael Walle, Simon Glass, Nick Desaulniers

[-- Attachment #1: Type: text/plain, Size: 967 bytes --]

On Mon, Sep 26, 2022 at 08:47:55PM +0000, Alistair Delva wrote:

> common/spl/spl_atf.c:187:51: warning: value size does not match register
>   size specified by the constraint and modifier [-Wasm-operand-widths]
>     __asm__ __volatile__("msr DAIF, %0\n\t" : : "r" (daif) : "memory");
>                                                      ^
> common/spl/spl_atf.c:187:34: note: use constraint modifier "w"
>     __asm__ __volatile__("msr DAIF, %0\n\t" : : "r" (daif) : "memory");
>                                     ^~
>                                     %w0
> 
> Use %x0 to match what Linux does in <asm/sysreg.h> write_sysreg().
> 
> Signed-off-by: Alistair Delva <adelva@google.com>
> Cc: Kever Yang <kever.yang@rock-chips.com>
> Cc: Michael Walle <michael@walle.cc>
> Cc: Simon Glass <sjg@chromium.org>
> Cc: Tom Rini <trini@konsulko.com>
> Cc: Nick Desaulniers <ndesaulniers@google.com>

Applied to u-boot/master, thanks!

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-10-11 13:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-26 20:47 [PATCH] spl: atf: Fix clang -Wasm-operand-widths warning Alistair Delva
2022-10-11 13:56 ` Tom Rini

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.