2023-09-19 09:13:03

by Tiezhu Yang

[permalink] [raw]
Subject: [PATCH v1] LoongArch: Remove dead code in relocate_new_kernel

The initial aim is to silence the following objtool warning:

arch/loongarch/kernel/relocate_kernel.o: warning: objtool: relocate_new_kernel+0x74: unreachable instruction

There are two adjacent "b" instructions, the second one is unreachable,
it is dead code, just remove it.

Co-developed-by: Jinyang He <[email protected]>
Signed-off-by: Jinyang He <[email protected]>
Co-developed-by: Youling Tang <[email protected]>
Signed-off-by: Youling Tang <[email protected]>
Signed-off-by: Tiezhu Yang <[email protected]>
---
arch/loongarch/kernel/relocate_kernel.S | 1 -
1 file changed, 1 deletion(-)

diff --git a/arch/loongarch/kernel/relocate_kernel.S b/arch/loongarch/kernel/relocate_kernel.S
index d132525..f49f6b0 100644
--- a/arch/loongarch/kernel/relocate_kernel.S
+++ b/arch/loongarch/kernel/relocate_kernel.S
@@ -72,7 +72,6 @@ copy_word:
LONG_ADDI s5, s5, -1
beqz s5, process_entry
b copy_word
- b process_entry

done:
ibar 0
--
2.1.0


2023-09-19 09:35:44

by Jinyang He

[permalink] [raw]
Subject: Re: [PATCH v1] LoongArch: Remove dead code in relocate_new_kernel

Not need my tag. Youling found that before, and simply talked about it
to me.

Thanks.


On 2023-09-19 17:07, Tiezhu Yang wrote:
> The initial aim is to silence the following objtool warning:
>
> arch/loongarch/kernel/relocate_kernel.o: warning: objtool: relocate_new_kernel+0x74: unreachable instruction
>
> There are two adjacent "b" instructions, the second one is unreachable,
> it is dead code, just remove it.
>
> Co-developed-by: Jinyang He <[email protected]>
> Signed-off-by: Jinyang He <[email protected]>
> Co-developed-by: Youling Tang <[email protected]>
> Signed-off-by: Youling Tang <[email protected]>
> Signed-off-by: Tiezhu Yang <[email protected]>
> ---
> arch/loongarch/kernel/relocate_kernel.S | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/arch/loongarch/kernel/relocate_kernel.S b/arch/loongarch/kernel/relocate_kernel.S
> index d132525..f49f6b0 100644
> --- a/arch/loongarch/kernel/relocate_kernel.S
> +++ b/arch/loongarch/kernel/relocate_kernel.S
> @@ -72,7 +72,6 @@ copy_word:
> LONG_ADDI s5, s5, -1
> beqz s5, process_entry
> b copy_word
> - b process_entry
>
> done:
> ibar 0

2023-09-20 06:32:43

by Huacai Chen

[permalink] [raw]
Subject: Re: [PATCH v1] LoongArch: Remove dead code in relocate_new_kernel

Queued for loongarch-next, thanks.

Huacai

On Tue, Sep 19, 2023 at 5:24 PM Jinyang He <[email protected]> wrote:
>
> Not need my tag. Youling found that before, and simply talked about it
> to me.
>
> Thanks.
>
>
> On 2023-09-19 17:07, Tiezhu Yang wrote:
> > The initial aim is to silence the following objtool warning:
> >
> > arch/loongarch/kernel/relocate_kernel.o: warning: objtool: relocate_new_kernel+0x74: unreachable instruction
> >
> > There are two adjacent "b" instructions, the second one is unreachable,
> > it is dead code, just remove it.
> >
> > Co-developed-by: Jinyang He <[email protected]>
> > Signed-off-by: Jinyang He <[email protected]>
> > Co-developed-by: Youling Tang <[email protected]>
> > Signed-off-by: Youling Tang <[email protected]>
> > Signed-off-by: Tiezhu Yang <[email protected]>
> > ---
> > arch/loongarch/kernel/relocate_kernel.S | 1 -
> > 1 file changed, 1 deletion(-)
> >
> > diff --git a/arch/loongarch/kernel/relocate_kernel.S b/arch/loongarch/kernel/relocate_kernel.S
> > index d132525..f49f6b0 100644
> > --- a/arch/loongarch/kernel/relocate_kernel.S
> > +++ b/arch/loongarch/kernel/relocate_kernel.S
> > @@ -72,7 +72,6 @@ copy_word:
> > LONG_ADDI s5, s5, -1
> > beqz s5, process_entry
> > b copy_word
> > - b process_entry
> >
> > done:
> > ibar 0
>
>