[U-Boot] [PATCH v2 00/32] Initial sparse fix series

Kim Phillips kim.phillips at freescale.com
Tue Oct 30 00:34:22 CET 2012


[v2 summary: zero inter-commit build errors on all power, arm,
and mips boards (which means some patches got merged into patch #1),
checkpatch fixes, and postponement of the libfdt changes, primarily
to get the bulk of these in during this merge window]

This 25-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., 
a couple of endianness bugs are found in of_bus_default_translate()
and fdt_get_base_address() (not includeded in this v2 series - fixes
pending libfdt patch for dtc).

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.  It comes with the side effect
of breaking many builds, because u-boot has various places where
attributes were being defined differently, so it includes fixes for those.

Patches 2-5 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 without redefined warnings.

Patches 6-7 are general sparse fixes to common powerpc areas.

Patches 8-10 are general sparse fixes to common header areas (e.g.,
patch 8 changes the long-standing u-boot image header types to __be32,
as per u-boot image definition).

Patches 11-12 addresses sparse fixes for the net subsystem.

Patches 13-14 do the same for lib/.

Patches 15-17 for Power Arch's mpc8xxx, 83xx, and 85xx subsystems.

Last but not least, patches 18-25 attempt to clean up various drivers.

Note that the two libfdt patches present in series one are omitted here
for u-boot merge window, they will be resubmitted after dtc have merged
a libfdt-dependent patch.

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.

fyi, I've pushed the series onto the u-boot-mpc83xx tree,
'sparsefixes' branch:

http://git.denx.de/u-boot.git/?p=u-boot/u-boot-mpc83xx.git;a=shortlog;h=refs/heads/sparsefixes

All power, arm, mips boards tested.

Thanks,

Kim


Kim Phillips (25):
  include/linux/byteorder: import latest endian definitions from linux
  include/linux/compat.h: fix warning: preprocessor token
    {__iomem,__user} 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/extable.c: sparse fix
  arch/powerpc/lib/board.c,*traps.c: sparse fixes
  include/image.h: sparse fixes
  common/cmd_*.c: sparse fixes
  common/misc: sparse fixes
  net/: sparse fixes
  drivers/net/: sparse fixes
  lib/zlib: sparse fixes
  lib/vsprintf.c: sparse fixes
  arch/powerpc/cpu/mpc8xxx/: 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/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: checkpatch fixes

 arch/arm/cpu/arm1176/tnetv107x/clock.c             |   4 -
 arch/powerpc/cpu/74xx_7xx/traps.c                  |  28 +-
 arch/powerpc/cpu/mpc512x/traps.c                   | 110 ++++----
 arch/powerpc/cpu/mpc5xx/traps.c                    |   6 +-
 arch/powerpc/cpu/mpc5xxx/traps.c                   |  29 +-
 arch/powerpc/cpu/mpc8220/traps.c                   | 119 ++++----
 arch/powerpc/cpu/mpc824x/traps.c                   |  29 +-
 arch/powerpc/cpu/mpc8260/traps.c                   |  29 +-
 arch/powerpc/cpu/mpc83xx/fdt.c                     |   6 +-
 arch/powerpc/cpu/mpc83xx/speed.c                   |   4 +-
 arch/powerpc/cpu/mpc83xx/traps.c                   |  29 +-
 arch/powerpc/cpu/mpc85xx/cpu_init.c                |   2 +-
 arch/powerpc/cpu/mpc85xx/fsl_corenet_serdes.c      |   2 +-
 arch/powerpc/cpu/mpc85xx/traps.c                   |  36 +--
 arch/powerpc/cpu/mpc86xx/traps.c                   |  27 +-
 arch/powerpc/cpu/mpc8xx/traps.c                    |  29 +-
 arch/powerpc/cpu/mpc8xxx/cpu.c                     |   9 +-
 arch/powerpc/cpu/mpc8xxx/ddr/ctrl_regs.c           |   2 +-
 .../cpu/mpc8xxx/ddr/lc_common_dimm_params.c        |   4 +-
 arch/powerpc/cpu/mpc8xxx/fsl_lbc.c                 |   2 +-
 arch/powerpc/cpu/ppc4xx/traps.c                    |  26 +-
 arch/powerpc/include/asm/io.h                      |   1 -
 arch/powerpc/include/asm/ppc4xx-sdram.h            |   2 +-
 arch/powerpc/lib/board.c                           |  12 +-
 arch/powerpc/lib/bootm.c                           |   2 +-
 arch/powerpc/lib/extable.c                         |   5 +-
 board/freescale/common/ngpixis.c                   |  12 +-
 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                                 |  31 ++-
 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                                   |  21 +-
 common/cmd_flash.c                                 |   6 +-
 common/cmd_help.c                                  |   2 +-
 common/cmd_i2c.c                                   |  20 +-
 common/cmd_irq.c                                   |   3 +-
 common/cmd_itest.c                                 |   4 +-
 common/cmd_load.c                                  | 303 ++++++++++-----------
 common/cmd_mdio.c                                  |  20 +-
 common/cmd_mem.c                                   |  25 +-
 common/cmd_misc.c                                  |   6 +-
 common/cmd_mmc.c                                   |   6 +-
 common/cmd_mp.c                                    |  22 +-
 common/cmd_mtdparts.c                              |  26 +-
 common/cmd_nand.c                                  |  19 +-
 common/cmd_net.c                                   |  76 +++---
 common/cmd_nvedit.c                                |  25 +-
 common/cmd_pci.c                                   |  17 +-
 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                                  |  13 +-
 common/command.c                                   |   9 +-
 common/dlmalloc.c                                  |  36 +--
 common/hush.c                                      |  31 ++-
 common/image.c                                     |   8 +-
 common/main.c                                      |  10 +-
 common/update.c                                    |   1 +
 common/usb_storage.c                               |  20 +-
 common/xyzModem.c                                  |   6 +-
 drivers/block/fsl_sata.c                           |  81 +-----
 drivers/block/fsl_sata.h                           |  13 +-
 drivers/block/sata_sil.c                           |  13 +-
 drivers/gpio/mpc83xx_gpio.c                        |   4 +-
 drivers/input/input.c                              |   2 +-
 drivers/mmc/fsl_esdhc.c                            |   4 +-
 drivers/mmc/mmc.c                                  |  37 +--
 drivers/mtd/cfi_flash.c                            |  22 +-
 drivers/mtd/nand/nand_base.c                       |  13 +-
 drivers/mtd/nand/nand_ecc.c                        |   1 +
 drivers/mtd/ubi/crc32.c                            |  12 +-
 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/macb.c                                 |   2 -
 drivers/net/phy/atheros.c                          |   2 +-
 drivers/net/phy/phy.c                              |  19 +-
 drivers/net/phy/vitesse.c                          |   2 +-
 drivers/net/smc91111.c                             |   2 -
 drivers/net/vsc7385.c                              |   1 +
 drivers/serial/s3c64xx.c                           |   2 -
 drivers/serial/serial_ns16550.c                    |  42 ++-
 fs/yaffs2/ydirectenv.h                             |   2 -
 include/common.h                                   |   4 -
 include/image.h                                    |  15 +-
 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/mtd/mtd-abi.h                        |   2 +
 include/linux/stddef.h                             |   2 +
 include/linux/unaligned/generic.h                  |   3 -
 include/net.h                                      |   9 +-
 include/u-boot/zlib.h                              |   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 +
 117 files changed, 1052 insertions(+), 1087 deletions(-)

-- 
1.8.0




More information about the U-Boot mailing list