diff mbox

[U-Boot,v4,11/27] x86: Change stub example to use asm-generic/sections.h

Message ID 1331777784-8528-12-git-send-email-sjg@chromium.org
State Changes Requested, archived
Headers show

Commit Message

Simon Glass March 15, 2012, 2:16 a.m. UTC
We can use the declarations of __bss_start and _end from this header
instead of declaring them locally.

Signed-off-by: Simon Glass <sjg@chromium.org>
---
Changes in v4:
- Use asm/sections.h instead of asm-generic/sections.h

 examples/standalone/stubs.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

Comments

Graeme Russ March 15, 2012, 2:29 a.m. UTC | #1
Hi Simon,

On Thu, Mar 15, 2012 at 1:16 PM, Simon Glass <sjg@chromium.org> wrote:
> We can use the declarations of __bss_start and _end from this header
> instead of declaring them locally.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
> Changes in v4:
> - Use asm/sections.h instead of asm-generic/sections.h
>
>  examples/standalone/stubs.c |    7 +++----
>  1 files changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/examples/standalone/stubs.c b/examples/standalone/stubs.c
> index 15e9afc..8fb1765 100644
> --- a/examples/standalone/stubs.c
> +++ b/examples/standalone/stubs.c
> @@ -217,16 +217,15 @@ void __attribute__((unused)) dummy(void)
>  #include <_exports.h>
>  }
>
> -extern unsigned long __bss_start, _end;
> +#include <asm/sections.h>
>
>  void app_startup(char * const *argv)
>  {
> -       unsigned char * cp = (unsigned char *) &__bss_start;
> +       char *cp = __bss_start;
>
>        /* Zero out BSS */
> -       while (cp < (unsigned char *)&_end) {
> +       while (cp < _end)
>                *cp++ = 0;
> -       }
>
>  #if defined(CONFIG_X86)
>        /* x86 does not have a dedicated register for passing global_data */
> --
> 1.7.7.3
>

Does not look like x86 to me - looks like common code

Regards,

Graeme
Simon Glass March 15, 2012, 2:44 a.m. UTC | #2
Hi Graeme,

On Wed, Mar 14, 2012 at 7:29 PM, Graeme Russ <graeme.russ@gmail.com> wrote:
> Hi Simon,
>
> On Thu, Mar 15, 2012 at 1:16 PM, Simon Glass <sjg@chromium.org> wrote:
>> We can use the declarations of __bss_start and _end from this header
>> instead of declaring them locally.
>>
>> Signed-off-by: Simon Glass <sjg@chromium.org>
>> ---
>> Changes in v4:
>> - Use asm/sections.h instead of asm-generic/sections.h
>>
>>  examples/standalone/stubs.c |    7 +++----
>>  1 files changed, 3 insertions(+), 4 deletions(-)
>>
>> diff --git a/examples/standalone/stubs.c b/examples/standalone/stubs.c
>> index 15e9afc..8fb1765 100644
>> --- a/examples/standalone/stubs.c
>> +++ b/examples/standalone/stubs.c
>> @@ -217,16 +217,15 @@ void __attribute__((unused)) dummy(void)
>>  #include <_exports.h>
>>  }
>>
>> -extern unsigned long __bss_start, _end;
>> +#include <asm/sections.h>
>>
>>  void app_startup(char * const *argv)
>>  {
>> -       unsigned char * cp = (unsigned char *) &__bss_start;
>> +       char *cp = __bss_start;
>>
>>        /* Zero out BSS */
>> -       while (cp < (unsigned char *)&_end) {
>> +       while (cp < _end)
>>                *cp++ = 0;
>> -       }
>>
>>  #if defined(CONFIG_X86)
>>        /* x86 does not have a dedicated register for passing global_data */
>> --
>> 1.7.7.3
>>
>
> Does not look like x86 to me - looks like common code

Yes that tag is wrong. Should I re-issue the patch?

Regards,
Simon

>
> Regards,
>
> Graeme
Graeme Russ March 15, 2012, 2:48 a.m. UTC | #3
Hi Simon,

On Thu, Mar 15, 2012 at 1:44 PM, Simon Glass <sjg@chromium.org> wrote:
> Hi Graeme,
>
> On Wed, Mar 14, 2012 at 7:29 PM, Graeme Russ <graeme.russ@gmail.com> wrote:
>> Hi Simon,
>>
>>
>> Does not look like x86 to me - looks like common code
>
> Yes that tag is wrong. Should I re-issue the patch?

Yes, but wait until you rev the whole series

Regards,

Graeme
diff mbox

Patch

diff --git a/examples/standalone/stubs.c b/examples/standalone/stubs.c
index 15e9afc..8fb1765 100644
--- a/examples/standalone/stubs.c
+++ b/examples/standalone/stubs.c
@@ -217,16 +217,15 @@  void __attribute__((unused)) dummy(void)
 #include <_exports.h>
 }
 
-extern unsigned long __bss_start, _end;
+#include <asm/sections.h>
 
 void app_startup(char * const *argv)
 {
-	unsigned char * cp = (unsigned char *) &__bss_start;
+	char *cp = __bss_start;
 
 	/* Zero out BSS */
-	while (cp < (unsigned char *)&_end) {
+	while (cp < _end)
 		*cp++ = 0;
-	}
 
 #if defined(CONFIG_X86)
 	/* x86 does not have a dedicated register for passing global_data */