diff mbox

[U-Boot,09/15] x86: Fix indirect jmp warning in zimage.c

Message ID 1351051486-6980-10-git-send-email-sjg@chromium.org
State Accepted, archived
Delegated to: Simon Glass
Headers show

Commit Message

Simon Glass Oct. 24, 2012, 4:04 a.m. UTC
This fixes the following warning:

zimage.c:312: Warning: indirect jmp without `*'

Also fixed these warnings to keep checkpatch quiet:

warning: arch/x86/lib/zimage.c,311: unnecessary whitespace before a quoted newline
warning: arch/x86/lib/zimage.c,312: unnecessary whitespace before a quoted newline
warning: arch/x86/lib/zimage.c,313: unnecessary whitespace before a quoted newline

Signed-off-by: Simon Glass <sjg@chromium.org>
---
 arch/x86/lib/zimage.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

Comments

Graeme Russ Oct. 24, 2012, 5:02 a.m. UTC | #1
Hi Simon,

On Wed, Oct 24, 2012 at 3:04 PM, Simon Glass <sjg@chromium.org> wrote:
> This fixes the following warning:
>
> zimage.c:312: Warning: indirect jmp without `*'
>
> Also fixed these warnings to keep checkpatch quiet:
>
> warning: arch/x86/lib/zimage.c,311: unnecessary whitespace before a quoted newline
> warning: arch/x86/lib/zimage.c,312: unnecessary whitespace before a quoted newline
> warning: arch/x86/lib/zimage.c,313: unnecessary whitespace before a quoted newline
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
>  arch/x86/lib/zimage.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/arch/x86/lib/zimage.c b/arch/x86/lib/zimage.c
> index a1366a1..7661a58 100644
> --- a/arch/x86/lib/zimage.c
> +++ b/arch/x86/lib/zimage.c
> @@ -308,9 +308,9 @@ void boot_zimage(void *setup_base, void *load_address)
>          * itself in arch/i386/cpu/cpu.c.
>          */
>         __asm__ __volatile__ (
> -       "movl $0, %%ebp         \n"
> -       "cli                    \n"
> -       "jmp %[kernel_entry]    \n"
> +       "movl $0, %%ebp\n"
> +       "cli\n"
> +       "jmp *%[kernel_entry]\n"
>         :: [kernel_entry]"a"(load_address),
>            [boot_params] "S"(setup_base),
>            "b"(0), "D"(0)

To be honest, I have never liked this implementation. I can't find it,
but I did have a patch that moved this into a function defined in a .S
file - much cleaner.

I'll have a poke around and see if I can find it again

Regards,

Graeme
diff mbox

Patch

diff --git a/arch/x86/lib/zimage.c b/arch/x86/lib/zimage.c
index a1366a1..7661a58 100644
--- a/arch/x86/lib/zimage.c
+++ b/arch/x86/lib/zimage.c
@@ -308,9 +308,9 @@  void boot_zimage(void *setup_base, void *load_address)
 	 * itself in arch/i386/cpu/cpu.c.
 	 */
 	__asm__ __volatile__ (
-	"movl $0, %%ebp		\n"
-	"cli			\n"
-	"jmp %[kernel_entry]	\n"
+	"movl $0, %%ebp\n"
+	"cli\n"
+	"jmp *%[kernel_entry]\n"
 	:: [kernel_entry]"a"(load_address),
 	   [boot_params] "S"(setup_base),
 	   "b"(0), "D"(0)