
This 32-patch series only begins to address making u-boot source more 'sparseable,' or sparse-clean, ultimately to catch type, address space, and endianness mismatches and generally improve code quality. E.g., in this initial dose whose main purpose is to reduce the output volume to workable levels, a couple of endianness bugs are found and fixed in of_bus_default_translate() and fdt_get_base_address(). See [PATCH 14/32] common/fdt_support.c: sparse fixes.
Patch 1 adds endianness attributes to byteorder.h helpers, e.g., cpu_to_be32(). This is required for correct operation and prevents sparse from emitting false-positives.
Patches 2-6 fix issues where u-boot had imported linux header code and the importer simply force-#defined sparse-specific attributes to nothing, to allow u-boot to build.
Patches 7-10 are general sparse fixes to common header areas.
Patch 11 is too, which also changes the long-standing u-boot image header types to __be32, as per u-boot image definition.
Patches 12-14 address further misc. sparse issues in common/.
Patches 15-16 do the same for the net subsystem.
Patches 17-18 do the same for lib/.
Patch 19 for include/fdt.h.
Patches 20-23 for Power Arch's mpc8xxx, 83xx, and 85xx subsystems.
Last but not least, patches 24-32 attempt to clean up various drivers.
Note that there are two libfdt dependencies:
1. commits aa28b89b "libfdt: Add helpers for 64-bit integer properties" and commit 786ed04 "libfdt: Add support for appending the values to a existing property", currently sitting in u-boot-fdt/next. This series is based on today's mainline u-boot/next with those two patches pre-applied.
2. potential upstream dtc change dependencies, due to having to attribute base device tree header types to __be32 in include/libfdt. See patch 19/32 "include/fdt.h: sparse fixes". It is unknown whether such changes would be welcome to dtc (but there's a way to find out :).
For authors of new patches not willing to sift through the still quite large sparse output for their board/platform, though interested in what sparse has to say about their new code, it is recommended to build with make C=1 after changes such that sparse output will only include newly built code.
For your convenience, I've pushed the series onto the u-boot-mpc83xx tree, 'sparsefixes' branch [1]. The branch includes libfdt dependency #1 mentioned above.
Build-tested in both endians :). Please help test.
Thanks,
Kim
[1] see http://git.denx.de/u-boot.git/?p=u-boot/u-boot-mpc83xx.git;a=shortlog;h=refs...
Kim Phillips (32): include/linux/byteorder: import latest endian definitions from linux include/linux/compat.h: fix warning: preprocessor token __iomem redefined include/linux/unaligned/generic.h: fix warning: preprocessor token __force redefined include/linux/stddef.h: avoid 'warning: preprocessor token offsetof redefined' arch/powerpc/include/asm/io.h: fix warning: preprocessor token __iomem redefined arch/powerpc/lib/bootm.c: fix noinline attribute arch/powerpc/lib/extable.c: sparse fix arch/powerpc/lib/board.c,*traps.c: sparse fixes include/common.h: sparse fix include/command.h: sparse fix include/image.h: sparse fixes common/cmd_*.c: sparse fixes common/misc: sparse fixes common/fdt_support.c: sparse fixes net/: sparse fixes drivers/net/: sparse fixes lib/zlib: sparse fixes lib/vsprintf.c: sparse fixes include/fdt.h: sparse fixes arch/powerpc/cpu/mpc8xxx/: sparse fixes arch/powerpc/cpu/mpc85xx/fdt.c: sparse fixes powerpc/mpc85xx: sparse fixes powerpc/mpc83xx: sparse fixes drivers/block/: sparse fixes drivers/gpio/mpc83xx_gpio.c: sparse fixes drivers/input/input.c: sparse fix drivers/i2c/fsl_i2c.c: sparse fix drivers/mmc/mmc.c: sparse fixes drivers/mmc/fsl_esdhc.c: sparse fixes drivers/mtd/cfi_flash.c: sparse fixes drivers/mtd/nand: sparse fixes drivers/serial/serial_ns16550.c: sparse fixes
arch/powerpc/cpu/74xx_7xx/traps.c | 6 +- arch/powerpc/cpu/mpc512x/traps.c | 6 +- arch/powerpc/cpu/mpc5xx/traps.c | 6 +- arch/powerpc/cpu/mpc5xxx/traps.c | 6 +- arch/powerpc/cpu/mpc8220/traps.c | 6 +- arch/powerpc/cpu/mpc824x/traps.c | 6 +- arch/powerpc/cpu/mpc8260/traps.c | 6 +- arch/powerpc/cpu/mpc83xx/fdt.c | 4 +- arch/powerpc/cpu/mpc83xx/speed.c | 4 +- arch/powerpc/cpu/mpc83xx/traps.c | 6 +- arch/powerpc/cpu/mpc85xx/cpu_init.c | 2 +- arch/powerpc/cpu/mpc85xx/fdt.c | 57 +++++---- arch/powerpc/cpu/mpc85xx/fsl_corenet_serdes.c | 2 +- arch/powerpc/cpu/mpc85xx/traps.c | 6 +- arch/powerpc/cpu/mpc86xx/traps.c | 6 +- arch/powerpc/cpu/mpc8xx/traps.c | 6 +- arch/powerpc/cpu/mpc8xxx/cpu.c | 8 +- arch/powerpc/cpu/mpc8xxx/ddr/ctrl_regs.c | 2 +- .../cpu/mpc8xxx/ddr/lc_common_dimm_params.c | 4 +- arch/powerpc/cpu/mpc8xxx/fdt.c | 3 +- arch/powerpc/cpu/mpc8xxx/fsl_lbc.c | 2 +- arch/powerpc/cpu/ppc4xx/traps.c | 6 +- arch/powerpc/include/asm/io.h | 1 - arch/powerpc/lib/board.c | 12 +- arch/powerpc/lib/bootm.c | 2 +- arch/powerpc/lib/extable.c | 2 +- board/freescale/common/ngpixis.c | 10 +- board/freescale/mpc8313erdb/mpc8313erdb.c | 24 ++-- board/freescale/mpc8568mds/bcsr.c | 8 +- board/freescale/mpc8569mds/bcsr.c | 8 +- common/cmd_boot.c | 5 +- common/cmd_bootm.c | 27 +++-- common/cmd_console.c | 2 +- common/cmd_date.c | 2 +- common/cmd_echo.c | 2 +- common/cmd_exit.c | 2 +- common/cmd_fat.c | 5 +- common/cmd_fdt.c | 19 +-- common/cmd_flash.c | 6 +- common/cmd_help.c | 2 +- common/cmd_i2c.c | 18 +-- common/cmd_irq.c | 2 +- common/cmd_itest.c | 4 +- common/cmd_load.c | 44 +++---- common/cmd_mdio.c | 20 +-- common/cmd_mem.c | 25 ++-- common/cmd_misc.c | 2 +- common/cmd_mmc.c | 6 +- common/cmd_mp.c | 20 ++- common/cmd_mtdparts.c | 28 +++-- common/cmd_nand.c | 17 +-- common/cmd_net.c | 8 +- common/cmd_nvedit.c | 23 ++-- common/cmd_pci.c | 15 ++- common/cmd_reginfo.c | 3 +- common/cmd_sata.c | 4 +- common/cmd_setexpr.c | 2 +- common/cmd_source.c | 11 +- common/cmd_test.c | 6 +- common/cmd_usb.c | 30 ++--- common/cmd_version.c | 2 +- common/cmd_ximg.c | 11 +- common/command.c | 9 +- common/console.c | 2 +- common/dlmalloc.c | 36 +++--- common/fdt_support.c | 78 ++++++------ common/hush.c | 30 ++--- common/image.c | 8 +- common/main.c | 6 +- common/update.c | 1 + common/usb_storage.c | 20 +-- common/xyzModem.c | 6 +- drivers/block/fsl_sata.c | 79 ++---------- drivers/block/fsl_sata.h | 12 +- drivers/block/sata_sil.c | 13 +- drivers/gpio/mpc83xx_gpio.c | 4 +- drivers/i2c/fsl_i2c.c | 2 +- drivers/input/input.c | 2 +- drivers/mmc/fsl_esdhc.c | 4 +- drivers/mmc/mmc.c | 37 +++--- drivers/mtd/cfi_flash.c | 20 +-- drivers/mtd/nand/nand_base.c | 9 +- drivers/mtd/nand/nand_ecc.c | 1 + drivers/net/fm/eth.c | 2 +- drivers/net/fm/p1023.c | 2 +- drivers/net/fm/p4080.c | 2 +- drivers/net/fm/p5020.c | 2 +- drivers/net/fm/tgec_phy.c | 10 +- drivers/net/phy/atheros.c | 2 +- drivers/net/phy/phy.c | 19 +-- drivers/net/phy/vitesse.c | 2 +- drivers/net/vsc7385.c | 1 + drivers/qe/qe.h | 34 +++--- drivers/serial/serial_ns16550.c | 12 +- include/command.h | 2 +- include/common.h | 4 - include/fdt.h | 33 ++--- include/fdt_support.h | 4 +- include/image.h | 15 +-- include/libfdt.h | 4 +- include/linux/byteorder/big_endian.h | 135 ++++++++++++++------- include/linux/byteorder/little_endian.h | 133 +++++++++++++------- include/linux/byteorder/swab.h | 6 +- include/linux/compat.h | 3 - include/linux/stddef.h | 2 + include/linux/unaligned/generic.h | 3 - include/net.h | 9 +- include/u-boot/zlib.h | 2 +- lib/libfdt/fdt.c | 2 +- lib/libfdt/fdt_ro.c | 2 +- lib/libfdt/fdt_rw.c | 4 +- lib/libfdt/fdt_sw.c | 4 +- lib/libfdt/fdt_wip.c | 2 +- lib/vsprintf.c | 4 +- lib/zlib/adler32.c | 5 +- lib/zlib/inffast.c | 5 +- lib/zlib/inflate.c | 29 ++--- lib/zlib/inftrees.c | 10 +- lib/zlib/zutil.c | 10 +- net/arp.c | 6 +- net/bootp.c | 6 +- net/net.c | 2 +- net/ping.h | 3 - net/tftp.h | 3 + 124 files changed, 789 insertions(+), 730 deletions(-)