[U-Boot] [PATCH 0/14] Homogenise baud rate type to unsigned int

The global_data and bd_info structures for each board have different types for the baudrate and bi_baudrate fields. This series lines them all up to be the same.
There is some discussion on the list about using u32 instead of 'unsigned int'. These are equivalent on all current architectures, and other fields in global_data and bd_info do not use this. However I can change this if required.
Simon Glass (14): sh: Change bi_baudrate and global data baudrate to int avr32: Change bi_baudrate and global data baudrate to int m68k: Change bi_baudrate and global data baudrate to int microblaze: Change bi_baudrate and global data baudrate to int nios2: Change bi_baudrate and global data baudrate to int openrisc: Change bi_baudrate and global data baudrate to int powerpc: Change bi_baudrate and global data baudrate to int sparc: Change bi_baudrate and global data baudrate to int arm: Change global data baudrate to int blackfin: Change global data baudrate to int mips: Change global data baudrate to int nds32: Change global data baudrate to int x86: Change global data baudrate to int sandbox: Change global data baudrate to int
arch/arm/include/asm/global_data.h | 2 +- arch/arm/include/asm/u-boot.h | 2 +- arch/avr32/include/asm/global_data.h | 2 +- arch/avr32/include/asm/u-boot.h | 2 +- arch/blackfin/include/asm/global_data.h | 2 +- arch/blackfin/include/asm/u-boot.h | 2 +- arch/blackfin/lib/board.c | 2 +- arch/m68k/include/asm/global_data.h | 2 +- arch/m68k/include/asm/u-boot.h | 2 +- arch/microblaze/include/asm/global_data.h | 2 +- arch/microblaze/include/asm/u-boot.h | 2 +- arch/mips/include/asm/global_data.h | 2 +- arch/mips/include/asm/u-boot.h | 2 +- arch/nds32/include/asm/global_data.h | 2 +- arch/nds32/include/asm/u-boot.h | 2 +- arch/nios2/include/asm/global_data.h | 2 +- arch/nios2/include/asm/u-boot.h | 2 +- arch/openrisc/include/asm/global_data.h | 2 +- arch/openrisc/include/asm/u-boot.h | 2 +- arch/powerpc/include/asm/global_data.h | 2 +- arch/powerpc/include/asm/u-boot.h | 2 +- arch/sandbox/include/asm/global_data.h | 2 +- arch/sh/include/asm/global_data.h | 2 +- arch/sh/include/asm/u-boot.h | 2 +- arch/sparc/include/asm/global_data.h | 2 +- arch/sparc/include/asm/u-boot.h | 2 +- arch/x86/include/asm/global_data.h | 2 +- common/cmd_bdinfo.c | 26 +++++++++++++------------- 28 files changed, 40 insertions(+), 40 deletions(-)

These don't need to be longs, so change them.
Signed-off-by: Simon Glass sjg@chromium.org --- arch/sh/include/asm/global_data.h | 2 +- arch/sh/include/asm/u-boot.h | 2 +- common/cmd_bdinfo.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/sh/include/asm/global_data.h b/arch/sh/include/asm/global_data.h index 6e534ad..9a2c193 100644 --- a/arch/sh/include/asm/global_data.h +++ b/arch/sh/include/asm/global_data.h @@ -31,7 +31,7 @@ typedef struct global_data { bd_t *bd; unsigned long flags; - unsigned long baudrate; + unsigned int baudrate; unsigned long cpu_clk; /* CPU clock in Hz! */ unsigned long have_console; /* serial_init() was called */ #ifdef CONFIG_PRE_CONSOLE_BUFFER diff --git a/arch/sh/include/asm/u-boot.h b/arch/sh/include/asm/u-boot.h index 6c04daf..2c9c463 100644 --- a/arch/sh/include/asm/u-boot.h +++ b/arch/sh/include/asm/u-boot.h @@ -33,7 +33,7 @@ typedef struct bd_info { unsigned long bi_flashoffset; /* reserved area for startup monitor */ unsigned long bi_sramstart; /* start of SRAM memory */ unsigned long bi_sramsize; /* size of SRAM memory */ - unsigned long bi_baudrate; /* Console Baudrate */ + unsigned int bi_baudrate; /* Console Baudrate */ unsigned long bi_boot_params; /* where this board expects params */ } bd_t;
diff --git a/common/cmd_bdinfo.c b/common/cmd_bdinfo.c index 286c8c8..698826c 100644 --- a/common/cmd_bdinfo.c +++ b/common/cmd_bdinfo.c @@ -405,7 +405,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) print_eth(0); printf("ip_addr = %s\n", getenv("ipaddr")); #endif - printf("baudrate = %ld bps\n", (ulong)bd->bi_baudrate); + printf("baudrate = %u bps\n", bd->bi_baudrate); return 0; }

These don't need to be longs, so change them.
Signed-off-by: Simon Glass sjg@chromium.org --- arch/avr32/include/asm/global_data.h | 2 +- arch/avr32/include/asm/u-boot.h | 2 +- common/cmd_bdinfo.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/avr32/include/asm/global_data.h b/arch/avr32/include/asm/global_data.h index 7878bb1..bf661e2 100644 --- a/arch/avr32/include/asm/global_data.h +++ b/arch/avr32/include/asm/global_data.h @@ -33,7 +33,7 @@ typedef struct global_data { bd_t *bd; unsigned long flags; - unsigned long baudrate; + unsigned int baudrate; unsigned long stack_end; /* highest stack address */ unsigned long have_console; /* serial_init() was called */ #ifdef CONFIG_PRE_CONSOLE_BUFFER diff --git a/arch/avr32/include/asm/u-boot.h b/arch/avr32/include/asm/u-boot.h index 1d2959a..97bbbde 100644 --- a/arch/avr32/include/asm/u-boot.h +++ b/arch/avr32/include/asm/u-boot.h @@ -23,7 +23,7 @@ #define __ASM_U_BOOT_H__ 1
typedef struct bd_info { - unsigned long bi_baudrate; + unsigned int bi_baudrate; unsigned char bi_phy_id[4]; unsigned long bi_board_number; void *bi_boot_params; diff --git a/common/cmd_bdinfo.c b/common/cmd_bdinfo.c index 698826c..138693e 100644 --- a/common/cmd_bdinfo.c +++ b/common/cmd_bdinfo.c @@ -344,7 +344,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
print_eth(0); printf("ip_addr = %s\n", getenv("ipaddr")); - printf("baudrate = %lu bps\n", bd->bi_baudrate); + printf("baudrate = %u bps\n", bd->bi_baudrate);
return 0; }

On 13.10.2012 02:21, Simon Glass wrote:
These don't need to be longs, so change them.
Signed-off-by: Simon Glass sjg@chromium.org
Acked-by: Andreas Bießmann andreas.devel@googlemail.com
arch/avr32/include/asm/global_data.h | 2 +- arch/avr32/include/asm/u-boot.h | 2 +- common/cmd_bdinfo.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)

These don't need to be longs, so change them.
Signed-off-by: Simon Glass sjg@chromium.org --- arch/m68k/include/asm/global_data.h | 2 +- arch/m68k/include/asm/u-boot.h | 2 +- common/cmd_bdinfo.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/m68k/include/asm/global_data.h b/arch/m68k/include/asm/global_data.h index cd55b83..0cdb11c 100644 --- a/arch/m68k/include/asm/global_data.h +++ b/arch/m68k/include/asm/global_data.h @@ -34,7 +34,7 @@ typedef struct global_data { bd_t *bd; unsigned long flags; - unsigned long baudrate; + unsigned int baudrate; unsigned long cpu_clk; /* CPU clock in Hz! */ unsigned long bus_clk; #ifdef CONFIG_PCI diff --git a/arch/m68k/include/asm/u-boot.h b/arch/m68k/include/asm/u-boot.h index 973c9ee..8c7c554 100644 --- a/arch/m68k/include/asm/u-boot.h +++ b/arch/m68k/include/asm/u-boot.h @@ -58,7 +58,7 @@ typedef struct bd_info { unsigned long bi_vcofreq; /* vco Freq in MHz */ unsigned long bi_flbfreq; /* Flexbus Freq in MHz */ #endif - unsigned long bi_baudrate; /* Console Baudrate */ + unsigned int bi_baudrate; /* Console Baudrate */ } bd_t;
#endif /* __ASSEMBLY__ */ diff --git a/common/cmd_bdinfo.c b/common/cmd_bdinfo.c index 138693e..d6f14ab 100644 --- a/common/cmd_bdinfo.c +++ b/common/cmd_bdinfo.c @@ -277,7 +277,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
printf("ip_addr = %s\n", getenv("ipaddr")); #endif - printf("baudrate = %ld bps\n", bd->bi_baudrate); + printf("baudrate = %u bps\n", bd->bi_baudrate);
return 0; }

These don't need to be longs, so change them.
Signed-off-by: Simon Glass sjg@chromium.org --- arch/microblaze/include/asm/global_data.h | 2 +- arch/microblaze/include/asm/u-boot.h | 2 +- common/cmd_bdinfo.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/microblaze/include/asm/global_data.h b/arch/microblaze/include/asm/global_data.h index de3b8db..2111c7c 100644 --- a/arch/microblaze/include/asm/global_data.h +++ b/arch/microblaze/include/asm/global_data.h @@ -35,7 +35,7 @@ typedef struct global_data { bd_t *bd; unsigned long flags; - unsigned long baudrate; + unsigned int baudrate; unsigned long have_console; /* serial_init() was called */ #ifdef CONFIG_PRE_CONSOLE_BUFFER unsigned long precon_buf_idx; /* Pre-Console buffer index */ diff --git a/arch/microblaze/include/asm/u-boot.h b/arch/microblaze/include/asm/u-boot.h index a0b1dbf..8d00658 100644 --- a/arch/microblaze/include/asm/u-boot.h +++ b/arch/microblaze/include/asm/u-boot.h @@ -40,7 +40,7 @@ typedef struct bd_info { unsigned long bi_flashoffset; /* reserved area for startup monitor */ unsigned long bi_sramstart; /* start of SRAM memory */ unsigned long bi_sramsize; /* size of SRAM memory */ - unsigned long bi_baudrate; /* Console Baudrate */ + unsigned int bi_baudrate; /* Console Baudrate */ } bd_t;
/* For image.h:image_check_target_arch() */ diff --git a/common/cmd_bdinfo.c b/common/cmd_bdinfo.c index d6f14ab..447c0a2 100644 --- a/common/cmd_bdinfo.c +++ b/common/cmd_bdinfo.c @@ -198,7 +198,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) print_eth(0); printf("ip_addr = %s\n", getenv("ipaddr")); #endif - printf("baudrate = %ld bps\n", (ulong)bd->bi_baudrate); + printf("baudrate = %u bps\n", (ulong)bd->bi_baudrate); return 0; }

These don't need to be longs, so change them.
Signed-off-by: Simon Glass sjg@chromium.org --- arch/nios2/include/asm/global_data.h | 2 +- arch/nios2/include/asm/u-boot.h | 2 +- common/cmd_bdinfo.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/nios2/include/asm/global_data.h b/arch/nios2/include/asm/global_data.h index 3b0d9e6..413b485 100644 --- a/arch/nios2/include/asm/global_data.h +++ b/arch/nios2/include/asm/global_data.h @@ -26,7 +26,7 @@ typedef struct global_data { bd_t *bd; unsigned long flags; - unsigned long baudrate; + unsigned int baudrate; unsigned long cpu_clk; /* CPU clock in Hz! */ unsigned long have_console; /* serial_init() was called */ #ifdef CONFIG_PRE_CONSOLE_BUFFER diff --git a/arch/nios2/include/asm/u-boot.h b/arch/nios2/include/asm/u-boot.h index 315ef8b..e591237 100644 --- a/arch/nios2/include/asm/u-boot.h +++ b/arch/nios2/include/asm/u-boot.h @@ -39,7 +39,7 @@ typedef struct bd_info { unsigned long bi_flashoffset; /* reserved area for startup monitor */ unsigned long bi_sramstart; /* start of SRAM memory */ unsigned long bi_sramsize; /* size of SRAM memory */ - unsigned long bi_baudrate; /* Console Baudrate */ + unsigned int bi_baudrate; /* Console Baudrate */ } bd_t;
/* For image.h:image_check_target_arch() */ diff --git a/common/cmd_bdinfo.c b/common/cmd_bdinfo.c index 447c0a2..899a216 100644 --- a/common/cmd_bdinfo.c +++ b/common/cmd_bdinfo.c @@ -175,7 +175,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) printf("ip_addr = %s\n", getenv("ipaddr")); #endif
- printf("baudrate = %ld bps\n", bd->bi_baudrate); + printf("baudrate = %u bps\n", bd->bi_baudrate);
return 0; }

These don't need to be longs, so change them.
Signed-off-by: Simon Glass sjg@chromium.org --- arch/openrisc/include/asm/global_data.h | 2 +- arch/openrisc/include/asm/u-boot.h | 2 +- common/cmd_bdinfo.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/openrisc/include/asm/global_data.h b/arch/openrisc/include/asm/global_data.h index 6a0c0cc..96f3f1c 100644 --- a/arch/openrisc/include/asm/global_data.h +++ b/arch/openrisc/include/asm/global_data.h @@ -35,7 +35,7 @@ typedef struct global_data { bd_t *bd; unsigned long flags; - unsigned long baudrate; + unsigned int baudrate; unsigned long cpu_clk; /* CPU clock in Hz! */ unsigned long have_console; /* serial_init() was called */ phys_size_t ram_size; /* RAM size */ diff --git a/arch/openrisc/include/asm/u-boot.h b/arch/openrisc/include/asm/u-boot.h index 76b8132..f2f31d3 100644 --- a/arch/openrisc/include/asm/u-boot.h +++ b/arch/openrisc/include/asm/u-boot.h @@ -32,7 +32,7 @@ #define _U_BOOT_H_
typedef struct bd_info { - unsigned long bi_baudrate; /* serial console baudrate */ + unsigned int bi_baudrate; /* serial console baudrate */ unsigned long bi_arch_number; /* unique id for this board */ unsigned long bi_boot_params; /* where this board expects params */ unsigned long bi_memstart; /* start of DRAM memory */ diff --git a/common/cmd_bdinfo.c b/common/cmd_bdinfo.c index 899a216..5af60e8 100644 --- a/common/cmd_bdinfo.c +++ b/common/cmd_bdinfo.c @@ -509,7 +509,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) printf("ip_addr = %s\n", getenv("ipaddr")); #endif
- printf("baudrate = %ld bps\n", bd->bi_baudrate); + printf("baudrate = %u bps\n", bd->bi_baudrate);
return 0; }

These don't need to be longs, so change them.
Signed-off-by: Simon Glass sjg@chromium.org --- arch/powerpc/include/asm/global_data.h | 2 +- arch/powerpc/include/asm/u-boot.h | 2 +- common/cmd_bdinfo.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/powerpc/include/asm/global_data.h b/arch/powerpc/include/asm/global_data.h index 5a5877f..374fc6d 100644 --- a/arch/powerpc/include/asm/global_data.h +++ b/arch/powerpc/include/asm/global_data.h @@ -38,7 +38,7 @@ typedef struct global_data { bd_t *bd; unsigned long flags; - unsigned long baudrate; + unsigned int baudrate; unsigned long cpu_clk; /* CPU clock in Hz! */ unsigned long bus_clk; #if defined(CONFIG_8xx) diff --git a/arch/powerpc/include/asm/u-boot.h b/arch/powerpc/include/asm/u-boot.h index b2fa2b5..7229a98 100644 --- a/arch/powerpc/include/asm/u-boot.h +++ b/arch/powerpc/include/asm/u-boot.h @@ -81,7 +81,7 @@ typedef struct bd_info { unsigned long bi_ipbfreq; /* IPB Bus Freq, in MHz */ unsigned long bi_pcifreq; /* PCI Bus Freq, in MHz */ #endif - unsigned long bi_baudrate; /* Console Baudrate */ + unsigned int bi_baudrate; /* Console Baudrate */ #if defined(CONFIG_405) || \ defined(CONFIG_405GP) || \ defined(CONFIG_405CR) || \ diff --git a/common/cmd_bdinfo.c b/common/cmd_bdinfo.c index 5af60e8..6b2f914 100644 --- a/common/cmd_bdinfo.c +++ b/common/cmd_bdinfo.c @@ -148,7 +148,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) print_mhz("ethspeed", bd->bi_ethspeed); #endif printf("IP addr = %s\n", getenv("ipaddr")); - printf("baudrate = %6ld bps\n", bd->bi_baudrate); + printf("baudrate = %6u bps\n", bd->bi_baudrate); print_num("relocaddr", gd->relocaddr); return 0; }

These don't need to be longs, so change them.
Signed-off-by: Simon Glass sjg@chromium.org --- arch/sparc/include/asm/global_data.h | 2 +- arch/sparc/include/asm/u-boot.h | 2 +- common/cmd_bdinfo.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/sparc/include/asm/global_data.h b/arch/sparc/include/asm/global_data.h index 93d3cc0..aa63b35 100644 --- a/arch/sparc/include/asm/global_data.h +++ b/arch/sparc/include/asm/global_data.h @@ -40,7 +40,7 @@ typedef struct global_data { bd_t *bd; unsigned long flags; - unsigned long baudrate; + unsigned int baudrate; unsigned long cpu_clk; /* CPU clock in Hz! */ unsigned long bus_clk;
diff --git a/arch/sparc/include/asm/u-boot.h b/arch/sparc/include/asm/u-boot.h index 8d01118..04c05d4 100644 --- a/arch/sparc/include/asm/u-boot.h +++ b/arch/sparc/include/asm/u-boot.h @@ -54,7 +54,7 @@ typedef struct bd_info { unsigned short bi_ethspeed; /* Ethernet speed in Mbps */ unsigned long bi_intfreq; /* Internal Freq, in MHz */ unsigned long bi_busfreq; /* Bus Freq, in MHz */ - unsigned long bi_baudrate; /* Console Baudrate */ + unsigned int bi_baudrate; /* Console Baudrate */ } bd_t;
#endif /* __ASSEMBLY__ */ diff --git a/common/cmd_bdinfo.c b/common/cmd_bdinfo.c index 6b2f914..ca05985 100644 --- a/common/cmd_bdinfo.c +++ b/common/cmd_bdinfo.c @@ -231,7 +231,7 @@ int do_bdinfo(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) print_eth(0); printf("ip_addr = %s\n", getenv("ipaddr")); #endif - printf("baudrate = %6ld bps\n", bd->bi_baudrate); + printf("baudrate = %6u bps\n", bd->bi_baudrate); return 0; }

This does not need to be a long, so change it.
Also adjust bi_baudrate to be unsigned.
Signed-off-by: Simon Glass sjg@chromium.org --- arch/arm/include/asm/global_data.h | 2 +- arch/arm/include/asm/u-boot.h | 2 +- common/cmd_bdinfo.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/arm/include/asm/global_data.h b/arch/arm/include/asm/global_data.h index f8088fe..2b9af93 100644 --- a/arch/arm/include/asm/global_data.h +++ b/arch/arm/include/asm/global_data.h @@ -34,7 +34,7 @@ typedef struct global_data { bd_t *bd; unsigned long flags; - unsigned long baudrate; + unsigned int baudrate; unsigned long have_console; /* serial_init() was called */ #ifdef CONFIG_PRE_CONSOLE_BUFFER unsigned long precon_buf_idx; /* Pre-Console buffer index */ diff --git a/arch/arm/include/asm/u-boot.h b/arch/arm/include/asm/u-boot.h index eac3800..2ba98bc 100644 --- a/arch/arm/include/asm/u-boot.h +++ b/arch/arm/include/asm/u-boot.h @@ -37,7 +37,7 @@ #define _U_BOOT_H_ 1
typedef struct bd_info { - int bi_baudrate; /* serial console baudrate */ + unsigned int bi_baudrate; /* serial console baudrate */ ulong bi_arch_number; /* unique id for this board */ ulong bi_boot_params; /* where this board expects params */ unsigned long bi_arm_freq; /* arm frequency */ diff --git a/common/cmd_bdinfo.c b/common/cmd_bdinfo.c index ca05985..7686996 100644 --- a/common/cmd_bdinfo.c +++ b/common/cmd_bdinfo.c @@ -369,7 +369,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) print_eth(0); printf("ip_addr = %s\n", getenv("ipaddr")); #endif - printf("baudrate = %d bps\n", bd->bi_baudrate); + printf("baudrate = %u bps\n", bd->bi_baudrate); #if !(defined(CONFIG_SYS_ICACHE_OFF) && defined(CONFIG_SYS_DCACHE_OFF)) print_num("TLB addr", gd->tlb_addr); #endif

This doesn't need to be a long, so change it.
Also adjust bi_baudrate to be unsigned.
Signed-off-by: Simon Glass sjg@chromium.org --- arch/blackfin/include/asm/global_data.h | 2 +- arch/blackfin/include/asm/u-boot.h | 2 +- arch/blackfin/lib/board.c | 2 +- common/cmd_bdinfo.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/arch/blackfin/include/asm/global_data.h b/arch/blackfin/include/asm/global_data.h index 290a9e7..d91e5a4 100644 --- a/arch/blackfin/include/asm/global_data.h +++ b/arch/blackfin/include/asm/global_data.h @@ -41,7 +41,7 @@ typedef struct global_data { bd_t *bd; unsigned long flags; unsigned long board_type; - unsigned long baudrate; + unsigned int baudrate; unsigned long have_console; /* serial_init() was called */ #ifdef CONFIG_PRE_CONSOLE_BUFFER unsigned long precon_buf_idx; /* Pre-Console buffer index */ diff --git a/arch/blackfin/include/asm/u-boot.h b/arch/blackfin/include/asm/u-boot.h index df81183..7abd6c2 100644 --- a/arch/blackfin/include/asm/u-boot.h +++ b/arch/blackfin/include/asm/u-boot.h @@ -29,7 +29,7 @@ #define _U_BOOT_H_ 1
typedef struct bd_info { - int bi_baudrate; /* serial console baudrate */ + unsigned int bi_baudrate; /* serial console baudrate */ unsigned long bi_boot_params; /* where this board expects params */ unsigned long bi_memstart; /* start of DRAM memory */ phys_size_t bi_memsize; /* size of DRAM memory in bytes */ diff --git a/arch/blackfin/lib/board.c b/arch/blackfin/lib/board.c index e47b606..9fbbea0 100644 --- a/arch/blackfin/lib/board.c +++ b/arch/blackfin/lib/board.c @@ -78,7 +78,7 @@ static void display_global_data(void) printf(" gd: %p\n", gd); printf(" |-flags: %lx\n", gd->flags); printf(" |-board_type: %lx\n", gd->board_type); - printf(" |-baudrate: %lu\n", gd->baudrate); + printf(" |-baudrate: %u\n", gd->baudrate); printf(" |-have_console: %lx\n", gd->have_console); printf(" |-ram_size: %lx\n", gd->ram_size); printf(" |-env_addr: %lx\n", gd->env_addr); diff --git a/common/cmd_bdinfo.c b/common/cmd_bdinfo.c index 7686996..bc737d0 100644 --- a/common/cmd_bdinfo.c +++ b/common/cmd_bdinfo.c @@ -304,7 +304,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
print_eth(0); printf("ip_addr = %s\n", getenv("ipaddr")); - printf("baudrate = %d bps\n", bd->bi_baudrate); + printf("baudrate = %u bps\n", bd->bi_baudrate);
return 0; }

This doesn't need to be a long, so change it.
Also adjust bi_baudrate to be unsigned.
Signed-off-by: Simon Glass sjg@chromium.org --- arch/mips/include/asm/global_data.h | 2 +- arch/mips/include/asm/u-boot.h | 2 +- common/cmd_bdinfo.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/mips/include/asm/global_data.h b/arch/mips/include/asm/global_data.h index 6e2cdc7..a735a8a 100644 --- a/arch/mips/include/asm/global_data.h +++ b/arch/mips/include/asm/global_data.h @@ -48,7 +48,7 @@ typedef struct global_data { unsigned long tbl; unsigned long lastinc; #endif - unsigned long baudrate; + unsigned int baudrate; unsigned long have_console; /* serial_init() was called */ #ifdef CONFIG_PRE_CONSOLE_BUFFER unsigned long precon_buf_idx; /* Pre-Console buffer index */ diff --git a/arch/mips/include/asm/u-boot.h b/arch/mips/include/asm/u-boot.h index 590649a..5fa4a6a 100644 --- a/arch/mips/include/asm/u-boot.h +++ b/arch/mips/include/asm/u-boot.h @@ -32,7 +32,7 @@ #define _U_BOOT_H_ 1
typedef struct bd_info { - int bi_baudrate; /* serial console baudrate */ + unsigned int bi_baudrate; /* serial console baudrate */ unsigned long bi_arch_number; /* unique id for this board */ unsigned long bi_boot_params; /* where this board expects params */ unsigned long bi_memstart; /* start of DRAM memory */ diff --git a/common/cmd_bdinfo.c b/common/cmd_bdinfo.c index bc737d0..aca54d1 100644 --- a/common/cmd_bdinfo.c +++ b/common/cmd_bdinfo.c @@ -324,7 +324,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
print_eth(0); printf("ip_addr = %s\n", getenv("ipaddr")); - printf("baudrate = %d bps\n", bd->bi_baudrate); + printf("baudrate = %u bps\n", bd->bi_baudrate);
return 0; }

This doesn't need to be a long, so change it.
Also adjust bi_baudrate to be unsigned.
Signed-off-by: Simon Glass sjg@chromium.org --- arch/nds32/include/asm/global_data.h | 2 +- arch/nds32/include/asm/u-boot.h | 2 +- common/cmd_bdinfo.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/nds32/include/asm/global_data.h b/arch/nds32/include/asm/global_data.h index 94bd4c2..b1feb2c 100644 --- a/arch/nds32/include/asm/global_data.h +++ b/arch/nds32/include/asm/global_data.h @@ -44,7 +44,7 @@ typedef struct global_data { bd_t *bd; unsigned long flags; - unsigned long baudrate; + unsigned int baudrate; unsigned long have_console; /* serial_init() was called */
unsigned long reloc_off; /* Relocation Offset */ diff --git a/arch/nds32/include/asm/u-boot.h b/arch/nds32/include/asm/u-boot.h index b533fea..7b8d8e4 100644 --- a/arch/nds32/include/asm/u-boot.h +++ b/arch/nds32/include/asm/u-boot.h @@ -39,7 +39,7 @@ #include <environment.h>
typedef struct bd_info { - int bi_baudrate; /* serial console baudrate */ + unsigned int bi_baudrate; /* serial console baudrate */ unsigned long bi_arch_number; /* unique id for this board */ unsigned long bi_boot_params; /* where this board expects params */ unsigned long bi_memstart; /* start of DRAM memory */ diff --git a/common/cmd_bdinfo.c b/common/cmd_bdinfo.c index aca54d1..656c565 100644 --- a/common/cmd_bdinfo.c +++ b/common/cmd_bdinfo.c @@ -487,7 +487,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) print_eth(0); printf("ip_addr = %s\n", getenv("ipaddr")); #endif - printf("baudrate = %d bps\n", bd->bi_baudrate); + printf("baudrate = %u bps\n", bd->bi_baudrate);
return 0; }

This doesn't need to be a long, so change it.
Signed-off-by: Simon Glass sjg@chromium.org --- arch/x86/include/asm/global_data.h | 2 +- common/cmd_bdinfo.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/x86/include/asm/global_data.h b/arch/x86/include/asm/global_data.h index 6d29c0b..bce999f 100644 --- a/arch/x86/include/asm/global_data.h +++ b/arch/x86/include/asm/global_data.h @@ -38,7 +38,7 @@ typedef struct global_data { unsigned long gd_addr; /* Location of Global Data */ bd_t *bd; unsigned long flags; - unsigned long baudrate; + unsigned int baudrate; unsigned long have_console; /* serial_init() was called */ #ifdef CONFIG_PRE_CONSOLE_BUFFER unsigned long precon_buf_idx; /* Pre-Console buffer index */ diff --git a/common/cmd_bdinfo.c b/common/cmd_bdinfo.c index 656c565..48cdd16 100644 --- a/common/cmd_bdinfo.c +++ b/common/cmd_bdinfo.c @@ -439,7 +439,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) printf("ip_addr = %s\n", getenv("ipaddr")); print_mhz("ethspeed", bd->bi_ethspeed); #endif - printf("baudrate = %d bps\n", bd->bi_baudrate); + printf("baudrate = %u bps\n", bd->bi_baudrate);
return 0; }

This doesn't need to be a long, so change it.
Signed-off-by: Simon Glass sjg@chromium.org --- arch/sandbox/include/asm/global_data.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/sandbox/include/asm/global_data.h b/arch/sandbox/include/asm/global_data.h index 581fd2f..78a751d 100644 --- a/arch/sandbox/include/asm/global_data.h +++ b/arch/sandbox/include/asm/global_data.h @@ -36,7 +36,7 @@ typedef struct global_data { bd_t *bd; unsigned long flags; - unsigned long baudrate; + unsigned int baudrate; unsigned long have_console; /* serial_init() was called */ unsigned long env_addr; /* Address of Environment struct */ unsigned long env_valid; /* Checksum of Environment valid? */

On Fri, Oct 12, 2012 at 05:21:07PM -0700, Simon Glass wrote:
The global_data and bd_info structures for each board have different types for the baudrate and bi_baudrate fields. This series lines them all up to be the same.
There is some discussion on the list about using u32 instead of 'unsigned int'. These are equivalent on all current architectures, and other fields in global_data and bd_info do not use this. However I can change this if required.
Simon Glass (14): sh: Change bi_baudrate and global data baudrate to int avr32: Change bi_baudrate and global data baudrate to int m68k: Change bi_baudrate and global data baudrate to int microblaze: Change bi_baudrate and global data baudrate to int nios2: Change bi_baudrate and global data baudrate to int openrisc: Change bi_baudrate and global data baudrate to int powerpc: Change bi_baudrate and global data baudrate to int sparc: Change bi_baudrate and global data baudrate to int arm: Change global data baudrate to int blackfin: Change global data baudrate to int mips: Change global data baudrate to int nds32: Change global data baudrate to int x86: Change global data baudrate to int sandbox: Change global data baudrate to int
arch/arm/include/asm/global_data.h | 2 +- arch/arm/include/asm/u-boot.h | 2 +- arch/avr32/include/asm/global_data.h | 2 +- arch/avr32/include/asm/u-boot.h | 2 +- arch/blackfin/include/asm/global_data.h | 2 +- arch/blackfin/include/asm/u-boot.h | 2 +- arch/blackfin/lib/board.c | 2 +- arch/m68k/include/asm/global_data.h | 2 +- arch/m68k/include/asm/u-boot.h | 2 +- arch/microblaze/include/asm/global_data.h | 2 +- arch/microblaze/include/asm/u-boot.h | 2 +- arch/mips/include/asm/global_data.h | 2 +- arch/mips/include/asm/u-boot.h | 2 +- arch/nds32/include/asm/global_data.h | 2 +- arch/nds32/include/asm/u-boot.h | 2 +- arch/nios2/include/asm/global_data.h | 2 +- arch/nios2/include/asm/u-boot.h | 2 +- arch/openrisc/include/asm/global_data.h | 2 +- arch/openrisc/include/asm/u-boot.h | 2 +- arch/powerpc/include/asm/global_data.h | 2 +- arch/powerpc/include/asm/u-boot.h | 2 +- arch/sandbox/include/asm/global_data.h | 2 +- arch/sh/include/asm/global_data.h | 2 +- arch/sh/include/asm/u-boot.h | 2 +- arch/sparc/include/asm/global_data.h | 2 +- arch/sparc/include/asm/u-boot.h | 2 +- arch/x86/include/asm/global_data.h | 2 +- common/cmd_bdinfo.c | 26 +++++++++++++------------- 28 files changed, 40 insertions(+), 40 deletions(-)
Applied to u-boot/master, thanks!
participants (3)
-
Andreas Bießmann
-
Simon Glass
-
Tom Rini