* [PATCH] LoongArch: Fix unsigned function returning negative constant
@ 2022-05-24 2:47 Haowen Bai
2022-05-24 3:04 ` Huacai Chen
0 siblings, 1 reply; 3+ messages in thread
From: Haowen Bai @ 2022-05-24 2:47 UTC (permalink / raw)
To: Ard Biesheuvel, Huacai Chen; +Cc: Haowen Bai, linux-efi, linux-kernel
The function set_virtual_map has an unsigned return type, but returns a
negative constant to indicate an error condition. So we change unsigned
to int.
Signed-off-by: Haowen Bai <baihaowen@meizu.com>
---
arch/loongarch/kernel/efi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/loongarch/kernel/efi.c b/arch/loongarch/kernel/efi.c
index 69ebdd4220ec..f9fdeb1ae358 100644
--- a/arch/loongarch/kernel/efi.c
+++ b/arch/loongarch/kernel/efi.c
@@ -102,7 +102,7 @@ static void __init fix_efi_mapping(void)
* in @memory_map whose EFI_MEMORY_RUNTIME attribute is set. Those descriptors
* are also copied to @runtime_map, and their total count is returned in @count.
*/
-static unsigned int __init set_virtual_map(void)
+static int __init set_virtual_map(void)
{
int count = 0;
unsigned int size;
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] LoongArch: Fix unsigned function returning negative constant
2022-05-24 2:47 [PATCH] LoongArch: Fix unsigned function returning negative constant Haowen Bai
@ 2022-05-24 3:04 ` Huacai Chen
2022-05-24 4:02 ` Huacai Chen
0 siblings, 1 reply; 3+ messages in thread
From: Huacai Chen @ 2022-05-24 3:04 UTC (permalink / raw)
To: Haowen Bai; +Cc: Ard Biesheuvel, linux-efi, LKML
Hi, Haowen,
On Tue, May 24, 2022 at 10:47 AM Haowen Bai <baihaowen@meizu.com> wrote:
>
> The function set_virtual_map has an unsigned return type, but returns a
> negative constant to indicate an error condition. So we change unsigned
> to int.
Your patch is correct, but original hasn't been upstream, I don't
know how to handle it.
Huacai
>
> Signed-off-by: Haowen Bai <baihaowen@meizu.com>
> ---
> arch/loongarch/kernel/efi.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/loongarch/kernel/efi.c b/arch/loongarch/kernel/efi.c
> index 69ebdd4220ec..f9fdeb1ae358 100644
> --- a/arch/loongarch/kernel/efi.c
> +++ b/arch/loongarch/kernel/efi.c
> @@ -102,7 +102,7 @@ static void __init fix_efi_mapping(void)
> * in @memory_map whose EFI_MEMORY_RUNTIME attribute is set. Those descriptors
> * are also copied to @runtime_map, and their total count is returned in @count.
> */
> -static unsigned int __init set_virtual_map(void)
> +static int __init set_virtual_map(void)
> {
> int count = 0;
> unsigned int size;
> --
> 2.7.4
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] LoongArch: Fix unsigned function returning negative constant
2022-05-24 3:04 ` Huacai Chen
@ 2022-05-24 4:02 ` Huacai Chen
0 siblings, 0 replies; 3+ messages in thread
From: Huacai Chen @ 2022-05-24 4:02 UTC (permalink / raw)
To: Haowen Bai; +Cc: Ard Biesheuvel, linux-efi, LKML
On Tue, May 24, 2022 at 11:04 AM Huacai Chen <chenhuacai@kernel.org> wrote:
>
> Hi, Haowen,
>
> On Tue, May 24, 2022 at 10:47 AM Haowen Bai <baihaowen@meizu.com> wrote:
> >
> > The function set_virtual_map has an unsigned return type, but returns a
> > negative constant to indicate an error condition. So we change unsigned
> > to int.
> Your patch is correct, but original hasn't been upstream, I don't
> know how to handle it.
I've squash your patch to the original one and add a Co-developed-by:,
not sure it is the best solution. Thanks.
>
> Huacai
> >
> > Signed-off-by: Haowen Bai <baihaowen@meizu.com>
> > ---
> > arch/loongarch/kernel/efi.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/arch/loongarch/kernel/efi.c b/arch/loongarch/kernel/efi.c
> > index 69ebdd4220ec..f9fdeb1ae358 100644
> > --- a/arch/loongarch/kernel/efi.c
> > +++ b/arch/loongarch/kernel/efi.c
> > @@ -102,7 +102,7 @@ static void __init fix_efi_mapping(void)
> > * in @memory_map whose EFI_MEMORY_RUNTIME attribute is set. Those descriptors
> > * are also copied to @runtime_map, and their total count is returned in @count.
> > */
> > -static unsigned int __init set_virtual_map(void)
> > +static int __init set_virtual_map(void)
> > {
> > int count = 0;
> > unsigned int size;
> > --
> > 2.7.4
> >
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-05-24 4:02 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-24 2:47 [PATCH] LoongArch: Fix unsigned function returning negative constant Haowen Bai
2022-05-24 3:04 ` Huacai Chen
2022-05-24 4:02 ` Huacai Chen
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.