linux/kernel.h: sync min, max, min3, max3 macros with Linux
authorMasahiro Yamada <yamada.m@jp.panasonic.com>
Thu, 6 Nov 2014 18:03:31 +0000 (03:03 +0900)
committerTom Rini <trini@ti.com>
Sun, 23 Nov 2014 11:48:30 +0000 (06:48 -0500)
commitb41411954d4ccf6ddaa581178462017557b82b5d
treef9439432d8dfa1073b0ba7b84f8289c4a9835c5f
parent111396ccb9a8d3e1f0e9d9921d3dbd6c7a70423f
linux/kernel.h: sync min, max, min3, max3 macros with Linux

U-Boot has never cared about the type when we get max/min of two
values, but Linux Kernel does.  This commit gets min, max, min3, max3
macros synced with the kernel introducing type checks.

Many of references of those macros must be fixed to suppress warnings.
We have two options:
 - Use min, max, min3, max3 only when the arguments have the same type
   (or add casts to the arguments)
 - Use min_t/max_t instead with the appropriate type for the first
   argument

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Pavel Machek <pavel@denx.de>
Acked-by: Lukasz Majewski <l.majewski@samsung.com>
Tested-by: Lukasz Majewski <l.majewski@samsung.com>
[trini: Fixup arch/blackfin/lib/string.c]
Signed-off-by: Tom Rini <trini@ti.com>
54 files changed:
arch/arm/cpu/arm1176/tnetv107x/clock.c
arch/arm/cpu/armv7/exynos/clock.c
arch/arm/cpu/armv7/exynos/spl_boot.c
arch/arm/cpu/armv7/tegra20/display.c
arch/avr32/cpu/at32ap700x/clk.c
arch/blackfin/cpu/jtag-console.c
arch/blackfin/lib/string.c
arch/powerpc/cpu/mpc85xx/tlb.c
arch/powerpc/cpu/ppc4xx/44x_spd_ddr2.c
arch/powerpc/lib/bootm.c
arch/sandbox/cpu/start.c
arch/x86/cpu/coreboot/pci.c
arch/x86/cpu/coreboot/sdram.c
board/freescale/common/sys_eeprom.c
board/gdsys/p1022/controlcenterd-id.c
board/imgtec/malta/malta.c
common/cmd_elf.c
common/cmd_sf.c
common/env_nand.c
common/fdt_support.c
common/lcd.c
common/usb_hub.c
drivers/block/ahci.c
drivers/ddr/fsl/ctrl_regs.c
drivers/ddr/fsl/lc_common_dimm_params.c
drivers/ddr/fsl/main.c
drivers/dfu/dfu.c
drivers/i2c/fsl_i2c.c
drivers/misc/cros_ec_spi.c
drivers/mmc/fsl_esdhc.c
drivers/mmc/pxa_mmc_gen.c
drivers/mtd/nand/denali_spl.c
drivers/mtd/spi/sandbox.c
drivers/mtd/spi/sf_ops.c
drivers/net/netconsole.c
drivers/pci/pci.c
drivers/pci/pci_auto.c
drivers/serial/usbtty.c
drivers/spi/fsl_espi.c
drivers/spi/mxc_spi.c
drivers/spi/spi-uclass.c
drivers/tpm/tpm_tis_lpc.c
drivers/usb/gadget/composite.c
drivers/usb/gadget/designware_udc.c
drivers/usb/gadget/pxa27x_udc.c
drivers/usb/gadget/s3c_udc_otg_xfer_dma.c
drivers/usb/host/dwc2.c
drivers/usb/host/ehci-hcd.c
drivers/usb/host/xhci-ring.c
drivers/usb/host/xhci.c
drivers/video/cfb_console.c
fs/ext4/dev.c
fs/fat/fat.c
include/linux/kernel.h