[U-Boot] [PATCH v3 0/6] Collect utility macros to include/linux/kernel.h synced with Linux

Masahiro Yamada yamada.m at jp.panasonic.com
Thu Nov 6 19:03:25 CET 2014


We have imported useful macros from Linux scattering them
to various places.

In include/common.h are min, max, min3, max3, ARRAY_SIZE, ALIGN,
container_of, DIV_ROUND_UP, roundup, etc.
In include/linux/compat.h are min_t, max_t, round_up, round_down,
etc.
We also have duplicated defines of min_t in some *.c files.

I'd like to create include/linux/kernel.h and arrange
sprinkled Linux-originated macros in order.
I believe this work will be helpful when we import more macros
or sync include/linux/kenrel.h in the future.

I confirmed clean output of buildman.

No section: 'make-flags'
boards.cfg is up to date. Nothing to do.
Summary of 7 commits for 1175 boards (8 threads, 1 job per thread)
01: arm: interrupt_init: set sp in IRQ/FIQ modes
     nios2: +   nios2-generic
        sh: +   rsk7269 rsk7264 rsk7203
  blackfin: +   bf609-ezkit
       arm: +   maxbcm smdkv310 snow smdk5250 smdk5420 origen odroid db-mv784mp-gp s5pc210_universal trats peach-pit arndale trats2
   powerpc: +   TQM834x
02: replace DIV_ROUND with DIV_ROUND_CLOSEST
03: include/common.h: remove DIV_ROUND definition
04: include: move various macros to include/linux/kernel.h
05: linux/kernel.h: import more macros
06: linux/kernel.h: add typechecking to roundup macro
07: linux/kernel.h: sync min, max, min3, max3 macros with Linux


Changes in v3:
  - Move also mult_frac

Changes in v2:
 - Fix a typo:  s/introduing/introducing/
 - Change arch/arm/cpu/arm1176/tnetv107x/clock.c
     #define MAXPOSTDIV    8UL  seems better than adding a cast.

Masahiro Yamada (6):
  replace DIV_ROUND with DIV_ROUND_CLOSEST
  include/common.h: remove DIV_ROUND definition
  include: move various macros to include/linux/kernel.h
  linux/kernel.h: import more macros
  linux/kernel.h: add typechecking to roundup macro
  linux/kernel.h: sync min, max, min3, max3 macros with Linux

 arch/arm/cpu/arm1176/tnetv107x/clock.c        |   4 +-
 arch/arm/cpu/arm926ejs/mxs/spl_power_init.c   |   3 +-
 arch/arm/cpu/armv7/bcm281xx/clk-core.h        |   4 -
 arch/arm/cpu/armv7/exynos/clock.c             |   4 +-
 arch/arm/cpu/armv7/omap-common/abb.c          |   6 +-
 arch/arm/cpu/armv7/tegra20/display.c          |   4 +-
 arch/avr32/cpu/at32ap700x/clk.c               |   2 +-
 arch/blackfin/cpu/jtag-console.c              |   2 +-
 arch/blackfin/lib/string.c                    |   2 +-
 arch/mips/cpu/mips32/au1x00/au1x00_usb_ohci.c |   2 -
 arch/powerpc/cpu/mpc5xxx/usb_ohci.c           |   2 -
 arch/powerpc/cpu/mpc85xx/tlb.c                |   2 +-
 arch/powerpc/cpu/ppc4xx/44x_spd_ddr2.c        |  32 ++--
 arch/powerpc/cpu/ppc4xx/usb_ohci.c            |   2 -
 arch/powerpc/lib/bootm.c                      |   2 +-
 arch/sandbox/cpu/start.c                      |   2 +-
 arch/x86/cpu/coreboot/pci.c                   |   2 +-
 arch/x86/cpu/coreboot/sdram.c                 |   2 +-
 board/freescale/common/sys_eeprom.c           |   6 +-
 board/gdsys/p1022/controlcenterd-id.c         |   5 +-
 board/imgtec/malta/malta.c                    |   2 +-
 common/cmd_elf.c                              |  12 +-
 common/cmd_sf.c                               |  16 +-
 common/env_nand.c                             |   4 +-
 common/fdt_support.c                          |   3 +-
 common/lcd.c                                  |   6 +-
 common/usb_hub.c                              |   3 +-
 drivers/block/ahci.c                          |   2 +-
 drivers/ddr/fsl/ctrl_regs.c                   |  22 +--
 drivers/ddr/fsl/lc_common_dimm_params.c       |  62 ++++---
 drivers/ddr/fsl/main.c                        |   3 +-
 drivers/dfu/dfu.c                             |   2 +-
 drivers/i2c/fsl_i2c.c                         |   2 +-
 drivers/misc/cros_ec_spi.c                    |   2 +-
 drivers/misc/mxc_ocotp.c                      |   4 +-
 drivers/mmc/fsl_esdhc.c                       |   2 +-
 drivers/mmc/pxa_mmc_gen.c                     |   6 +-
 drivers/mtd/nand/denali_spl.c                 |   2 +-
 drivers/mtd/spi/sandbox.c                     |   2 +-
 drivers/mtd/spi/sf_ops.c                      |   5 +-
 drivers/net/netconsole.c                      |   2 +-
 drivers/pci/pci.c                             |   6 +-
 drivers/pci/pci_auto.c                        |   2 +-
 drivers/serial/usbtty.c                       |   2 +-
 drivers/spi/fsl_espi.c                        |   4 +-
 drivers/spi/mxc_spi.c                         |   2 +-
 drivers/spi/spi-uclass.c                      |   2 +-
 drivers/tpm/tpm_tis_lpc.c                     |   2 +-
 drivers/usb/gadget/composite.c                |   4 +-
 drivers/usb/gadget/designware_udc.c           |   4 +-
 drivers/usb/gadget/pxa27x_udc.c               |   3 +-
 drivers/usb/gadget/s3c_udc_otg_xfer_dma.c     |   4 +-
 drivers/usb/host/dwc2.c                       |  14 +-
 drivers/usb/host/ehci-hcd.c                   |   2 +-
 drivers/usb/host/isp116x-hcd.c                |   6 -
 drivers/usb/host/ohci-hcd.c                   |   3 -
 drivers/usb/host/ohci-s3c24xx.c               |   3 -
 drivers/usb/host/r8a66597-hcd.c               |   3 -
 drivers/usb/host/xhci-ring.c                  |   2 +-
 drivers/usb/host/xhci.c                       |   2 +-
 drivers/usb/musb/musb_hcd.h                   |   3 -
 drivers/video/ati_radeon_fb.c                 |   5 -
 drivers/video/cfb_console.c                   |  18 +-
 fs/ext4/dev.c                                 |  13 +-
 fs/fat/fat.c                                  |   2 +-
 fs/ubifs/ubifs.h                              |   4 -
 include/common.h                              |  90 +---------
 include/linux/compat.h                        |  54 ------
 include/linux/kernel.h                        | 245 ++++++++++++++++++++++++++
 lib/strmhz.c                                  |   4 +-
 lib/vsprintf.c                                |   3 -
 71 files changed, 430 insertions(+), 335 deletions(-)
 create mode 100644 include/linux/kernel.h

-- 
1.9.1



More information about the U-Boot mailing list