All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v2] blackfin: Fix using gd->baudrate before setting its value
@ 2013-07-01  5:16 Axel Lin
  2013-07-01 10:56 ` Sonic Zhang
  0 siblings, 1 reply; 4+ messages in thread
From: Axel Lin @ 2013-07-01  5:16 UTC (permalink / raw)
  To: u-boot

Current code uses gd->baudrate before setting its value.
Besides, I got below build warning which is introduced by
commit ddb5c5be "blackfin: add baudrate to bdinfo".

board.c:235:3: warning: passing argument 1 of 'simple_strtoul' makes pointer from integer without a cast [enabled by default]
include/vsprintf.h:27:7: note: expected 'const char *' but argument is of type 'unsigned int'

This patch ensures we get the baudrate setting before using it.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
v2: The change is based on Sonic 's suggestion:
    move "gd->bd->bi_baudrate = gd->baudrate;" into init_baudrate()

 arch/blackfin/lib/board.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/blackfin/lib/board.c b/arch/blackfin/lib/board.c
index f1d5547..460c97d 100644
--- a/arch/blackfin/lib/board.c
+++ b/arch/blackfin/lib/board.c
@@ -63,6 +63,7 @@ static int display_banner(void)
 static int init_baudrate(void)
 {
 	gd->baudrate = getenv_ulong("baudrate", 10, CONFIG_BAUDRATE);
+	gd->bd->bi_baudrate = gd->baudrate;
 	return 0;
 }
 
@@ -231,8 +232,6 @@ static int global_board_data_init(void)
 	bd->bi_sclk = get_sclk();
 	bd->bi_memstart = CONFIG_SYS_SDRAM_BASE;
 	bd->bi_memsize = CONFIG_SYS_MAX_RAM_SIZE;
-	bd->bi_baudrate = (gd->baudrate > 0)
-		? simple_strtoul(gd->baudrate, NULL, 10) : CONFIG_BAUDRATE;
 
 	return 0;
 }
-- 
1.8.1.2

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

* [U-Boot] [PATCH v2] blackfin: Fix using gd->baudrate before setting its value
  2013-07-01  5:16 [U-Boot] [PATCH v2] blackfin: Fix using gd->baudrate before setting its value Axel Lin
@ 2013-07-01 10:56 ` Sonic Zhang
  2013-07-14  7:05   ` Axel Lin
  0 siblings, 1 reply; 4+ messages in thread
From: Sonic Zhang @ 2013-07-01 10:56 UTC (permalink / raw)
  To: u-boot

Acked-by: Sonic Zhang<sonic.zhang@analog.com>

On Mon, Jul 1, 2013 at 1:16 PM, Axel Lin <axel.lin@ingics.com> wrote:
> Current code uses gd->baudrate before setting its value.
> Besides, I got below build warning which is introduced by
> commit ddb5c5be "blackfin: add baudrate to bdinfo".
>
> board.c:235:3: warning: passing argument 1 of 'simple_strtoul' makes pointer from integer without a cast [enabled by default]
> include/vsprintf.h:27:7: note: expected 'const char *' but argument is of type 'unsigned int'
>
> This patch ensures we get the baudrate setting before using it.
>
> Signed-off-by: Axel Lin <axel.lin@ingics.com>
> ---
> v2: The change is based on Sonic 's suggestion:
>     move "gd->bd->bi_baudrate = gd->baudrate;" into init_baudrate()
>
>  arch/blackfin/lib/board.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/arch/blackfin/lib/board.c b/arch/blackfin/lib/board.c
> index f1d5547..460c97d 100644
> --- a/arch/blackfin/lib/board.c
> +++ b/arch/blackfin/lib/board.c
> @@ -63,6 +63,7 @@ static int display_banner(void)
>  static int init_baudrate(void)
>  {
>         gd->baudrate = getenv_ulong("baudrate", 10, CONFIG_BAUDRATE);
> +       gd->bd->bi_baudrate = gd->baudrate;
>         return 0;
>  }
>
> @@ -231,8 +232,6 @@ static int global_board_data_init(void)
>         bd->bi_sclk = get_sclk();
>         bd->bi_memstart = CONFIG_SYS_SDRAM_BASE;
>         bd->bi_memsize = CONFIG_SYS_MAX_RAM_SIZE;
> -       bd->bi_baudrate = (gd->baudrate > 0)
> -               ? simple_strtoul(gd->baudrate, NULL, 10) : CONFIG_BAUDRATE;
>
>         return 0;
>  }
> --
> 1.8.1.2
>
>
>
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot

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

* [U-Boot] [PATCH v2] blackfin: Fix using gd->baudrate before setting its value
  2013-07-01 10:56 ` Sonic Zhang
@ 2013-07-14  7:05   ` Axel Lin
  2013-07-15  2:51     ` Zhang, Sonic
  0 siblings, 1 reply; 4+ messages in thread
From: Axel Lin @ 2013-07-14  7:05 UTC (permalink / raw)
  To: u-boot

2013/7/1 Sonic Zhang <sonic.adi@gmail.com>:
> Acked-by: Sonic Zhang<sonic.zhang@analog.com>

hi Sonic,
I thought you will pick up this patch, but now I got your ACK and I have
no idea who will take this patch.

Just wondering if this patch should be applied for v2013.07?

Regards,
Axel

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

* [U-Boot] [PATCH v2] blackfin: Fix using gd->baudrate before setting its value
  2013-07-14  7:05   ` Axel Lin
@ 2013-07-15  2:51     ` Zhang, Sonic
  0 siblings, 0 replies; 4+ messages in thread
From: Zhang, Sonic @ 2013-07-15  2:51 UTC (permalink / raw)
  To: u-boot

Hi Axel,

It is in the blackfin u-boot next tree.

Regards,

Sonic

>-----Original Message-----
>From: Axel Lin [mailto:axel.lin at ingics.com]
>Sent: Sunday, July 14, 2013 3:06 PM
>To: Sonic Zhang
>Cc: Zhang, Sonic; Tom Rini; Marek Vasut; Bob Liu; U-Boot
>Subject: Re: [U-Boot] [PATCH v2] blackfin: Fix using gd->baudrate before setting
>its value
>
>2013/7/1 Sonic Zhang <sonic.adi@gmail.com>:
>> Acked-by: Sonic Zhang<sonic.zhang@analog.com>
>
>hi Sonic,
>I thought you will pick up this patch, but now I got your ACK and I have no idea
>who will take this patch.
>
>Just wondering if this patch should be applied for v2013.07?
>
>Regards,
>Axel

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

end of thread, other threads:[~2013-07-15  2:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-01  5:16 [U-Boot] [PATCH v2] blackfin: Fix using gd->baudrate before setting its value Axel Lin
2013-07-01 10:56 ` Sonic Zhang
2013-07-14  7:05   ` Axel Lin
2013-07-15  2:51     ` Zhang, Sonic

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.