From c251736e8f94442ec3bb04d437404229900a66d7 Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Sun, 17 May 2020 21:14:39 +0900 Subject: arch: include from Many architectures duplicate the same fixed type definitions as in . Include from , and remove the duplicated code. Note: Linux commit 0c79a8e29b5f ("asm/types.h: Remove include/asm-generic/int-l64.h") unified the kernel space definition into int-ll64.h. Barebox also adopts int-ll64. Signed-off-by: Masahiro Yamada Signed-off-by: Sascha Hauer --- arch/arm/include/asm/types.h | 48 +----------------------- arch/nios2/include/asm/int-ll64.h | 78 --------------------------------------- arch/nios2/include/asm/types.h | 2 +- arch/openrisc/include/asm/types.h | 48 +----------------------- arch/powerpc/include/asm/types.h | 35 +----------------- arch/riscv/include/asm/types.h | 42 +-------------------- arch/sandbox/include/asm/types.h | 42 +-------------------- arch/x86/include/asm/types.h | 42 +-------------------- 8 files changed, 11 insertions(+), 326 deletions(-) delete mode 100644 arch/nios2/include/asm/int-ll64.h (limited to 'arch') diff --git a/arch/arm/include/asm/types.h b/arch/arm/include/asm/types.h index 9c21066882..22b9642655 100644 --- a/arch/arm/include/asm/types.h +++ b/arch/arm/include/asm/types.h @@ -1,52 +1,6 @@ #ifndef __ASM_ARM_TYPES_H #define __ASM_ARM_TYPES_H -#ifndef __ASSEMBLY__ - -/* - * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the - * header files exported to user space - */ - -typedef __signed__ char __s8; -typedef unsigned char __u8; - -typedef __signed__ short __s16; -typedef unsigned short __u16; - -typedef __signed__ int __s32; -typedef unsigned int __u32; - -#if defined(__GNUC__) && !defined(__STRICT_ANSI__) -typedef __signed__ long long __s64; -typedef unsigned long long __u64; -#endif - -#endif /* __ASSEMBLY__ */ - -/* - * These aren't exported outside the kernel to avoid name space clashes - */ -#ifdef __KERNEL__ - -#include - -#ifndef __ASSEMBLY__ - -typedef signed char s8; -typedef unsigned char u8; - -typedef signed short s16; -typedef unsigned short u16; - -typedef signed int s32; -typedef unsigned int u32; - -typedef signed long long s64; -typedef unsigned long long u64; - -#endif /* __ASSEMBLY__ */ - -#endif /* __KERNEL__ */ +#include #endif diff --git a/arch/nios2/include/asm/int-ll64.h b/arch/nios2/include/asm/int-ll64.h deleted file mode 100644 index f394147c07..0000000000 --- a/arch/nios2/include/asm/int-ll64.h +++ /dev/null @@ -1,78 +0,0 @@ -/* - * asm-generic/int-ll64.h - * - * Integer declarations for architectures which use "long long" - * for 64-bit types. - */ - -#ifndef _ASM_GENERIC_INT_LL64_H -#define _ASM_GENERIC_INT_LL64_H - -#include - -#ifndef __ASSEMBLY__ -/* - * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the - * header files exported to user space - */ - -typedef __signed__ char __s8; -typedef unsigned char __u8; - -typedef __signed__ short __s16; -typedef unsigned short __u16; - -typedef __signed__ int __s32; -typedef unsigned int __u32; - -#ifdef __GNUC__ -__extension__ typedef __signed__ long long __s64; -__extension__ typedef unsigned long long __u64; -#else -typedef __signed__ long long __s64; -typedef unsigned long long __u64; -#endif - -#endif /* __ASSEMBLY__ */ - -#ifdef __KERNEL__ - -#ifndef __ASSEMBLY__ - -typedef signed char s8; -typedef unsigned char u8; - -typedef signed short s16; -typedef unsigned short u16; - -typedef signed int s32; -typedef unsigned int u32; - -typedef signed long long s64; -typedef unsigned long long u64; - -#define S8_C(x) x -#define U8_C(x) x ## U -#define S16_C(x) x -#define U16_C(x) x ## U -#define S32_C(x) x -#define U32_C(x) x ## U -#define S64_C(x) x ## LL -#define U64_C(x) x ## ULL - -#else /* __ASSEMBLY__ */ - -#define S8_C(x) x -#define U8_C(x) x -#define S16_C(x) x -#define U16_C(x) x -#define S32_C(x) x -#define U32_C(x) x -#define S64_C(x) x -#define U64_C(x) x - -#endif /* __ASSEMBLY__ */ - -#endif /* __KERNEL__ */ - -#endif /* _ASM_GENERIC_INT_LL64_H */ diff --git a/arch/nios2/include/asm/types.h b/arch/nios2/include/asm/types.h index 0067ea83c1..380ad340c3 100644 --- a/arch/nios2/include/asm/types.h +++ b/arch/nios2/include/asm/types.h @@ -1,6 +1,6 @@ #ifndef __ASM_TYPES_H #define __ASM_TYPES_H -#include +#include #endif diff --git a/arch/openrisc/include/asm/types.h b/arch/openrisc/include/asm/types.h index 8ee6bb00f9..21a45b74cd 100644 --- a/arch/openrisc/include/asm/types.h +++ b/arch/openrisc/include/asm/types.h @@ -16,52 +16,6 @@ #ifndef _ASM_TYPES_H #define _ASM_TYPES_H -/* - * This file is never included by application software unless - * explicitly requested (e.g., via linux/types.h) in which case the - * application is Linux specific so (user-) name space pollution is - * not a major issue. However, for interoperability, libraries still - * need to be careful to avoid a name clashes. - */ - -/* - * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the - * header files exported to user space - */ - -typedef __signed__ char __s8; -typedef unsigned char __u8; - -typedef __signed__ short __s16; -typedef unsigned short __u16; - -typedef __signed__ int __s32; -typedef unsigned int __u32; - -#if defined(__GNUC__) -__extension__ typedef __signed__ long long __s64; -__extension__ typedef unsigned long long __u64; -#endif - -/* - * These aren't exported outside the kernel to avoid name space clashes - */ -#ifdef __KERNEL__ - -typedef signed char s8; -typedef unsigned char u8; - -typedef signed short s16; -typedef unsigned short u16; - -typedef signed int s32; -typedef unsigned int u32; - -typedef signed long long s64; -typedef unsigned long long u64; - -#include - -#endif /* __KERNEL__ */ +#include #endif /* _ASM_TYPES_H */ diff --git a/arch/powerpc/include/asm/types.h b/arch/powerpc/include/asm/types.h index 2d3ce0a283..f3d41905ca 100644 --- a/arch/powerpc/include/asm/types.h +++ b/arch/powerpc/include/asm/types.h @@ -1,45 +1,14 @@ #ifndef _PPC_TYPES_H #define _PPC_TYPES_H -#ifndef __ASSEMBLY__ - -typedef __signed__ char __s8; -typedef unsigned char __u8; - -typedef __signed__ short __s16; -typedef unsigned short __u16; +#include -typedef __signed__ int __s32; -typedef unsigned int __u32; - -#if defined(__GNUC__) && !defined(__STRICT_ANSI__) -typedef __signed__ long long __s64; -typedef unsigned long long __u64; -#endif +#ifndef __ASSEMBLY__ typedef struct { __u32 u[4]; } __attribute((aligned(16))) vector128; -#ifdef __KERNEL__ -/* - * These aren't exported outside the kernel to avoid name space clashes - */ -typedef signed char s8; -typedef unsigned char u8; - -typedef signed short s16; -typedef unsigned short u16; - -typedef signed int s32; -typedef unsigned int u32; - -typedef signed long long s64; -typedef unsigned long long u64; - -#include - -#endif /* __KERNEL__ */ #endif /* __ASSEMBLY__ */ #endif diff --git a/arch/riscv/include/asm/types.h b/arch/riscv/include/asm/types.h index 8200a03349..af37d7738c 100644 --- a/arch/riscv/include/asm/types.h +++ b/arch/riscv/include/asm/types.h @@ -1,6 +1,8 @@ #ifndef __ASM_RISCV_TYPES_H #define __ASM_RISCV_TYPES_H +#include + #ifdef __riscv64 /* * This is used in dlmalloc. On RISCV64 we need it to be 64 bit @@ -15,44 +17,4 @@ #endif -/* - * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the - * header files exported to user space - */ - -typedef __signed__ char __s8; -typedef unsigned char __u8; - -typedef __signed__ short __s16; -typedef unsigned short __u16; - -typedef __signed__ int __s32; -typedef unsigned int __u32; - -#if defined(__GNUC__) && !defined(__STRICT_ANSI__) -typedef __signed__ long long __s64; -typedef unsigned long long __u64; -#endif - -/* - * These aren't exported outside the kernel to avoid name space clashes - */ -#ifdef __KERNEL__ - -typedef signed char s8; -typedef unsigned char u8; - -typedef signed short s16; -typedef unsigned short u16; - -typedef signed int s32; -typedef unsigned int u32; - -typedef signed long long s64; -typedef unsigned long long u64; - -#include - -#endif /* __KERNEL__ */ - #endif /* __ASM_RISCV_TYPES_H */ diff --git a/arch/sandbox/include/asm/types.h b/arch/sandbox/include/asm/types.h index 8426de4cc2..3e4a8f7ba3 100644 --- a/arch/sandbox/include/asm/types.h +++ b/arch/sandbox/include/asm/types.h @@ -1,6 +1,8 @@ #ifndef __ASM_I386_TYPES_H #define __ASM_I386_TYPES_H +#include + #ifdef __x86_64__ /* * This is used in dlmalloc. On X86_64 we need it to be @@ -16,44 +18,4 @@ #endif -/* - * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the - * header files exported to user space - */ - -typedef __signed__ char __s8; -typedef unsigned char __u8; - -typedef __signed__ short __s16; -typedef unsigned short __u16; - -typedef __signed__ int __s32; -typedef unsigned int __u32; - -#if defined(__GNUC__) && !defined(__STRICT_ANSI__) -typedef __signed__ long long __s64; -typedef unsigned long long __u64; -#endif - -/* - * These aren't exported outside the kernel to avoid name space clashes - */ -#ifdef __KERNEL__ - -typedef signed char s8; -typedef unsigned char u8; - -typedef signed short s16; -typedef unsigned short u16; - -typedef signed int s32; -typedef unsigned int u32; - -typedef signed long long s64; -typedef unsigned long long u64; - -#include - -#endif /* __KERNEL__ */ - #endif diff --git a/arch/x86/include/asm/types.h b/arch/x86/include/asm/types.h index e57ae2c8cf..17947b2ff3 100644 --- a/arch/x86/include/asm/types.h +++ b/arch/x86/include/asm/types.h @@ -1,6 +1,8 @@ #ifndef __ASM_I386_TYPES_H #define __ASM_I386_TYPES_H +#include + #ifndef __ASSEMBLY__ #ifdef __x86_64__ @@ -18,46 +20,6 @@ #endif -/* - * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the - * header files exported to user space - */ - -typedef __signed__ char __s8; -typedef unsigned char __u8; - -typedef __signed__ short __s16; -typedef unsigned short __u16; - -typedef __signed__ int __s32; -typedef unsigned int __u32; - -#if defined(__GNUC__) && !defined(__STRICT_ANSI__) -typedef __signed__ long long __s64; -typedef unsigned long long __u64; -#endif - -/* - * These aren't exported outside the kernel to avoid name space clashes - */ -#ifdef __KERNEL__ - -typedef signed char s8; -typedef unsigned char u8; - -typedef signed short s16; -typedef unsigned short u16; - -typedef signed int s32; -typedef unsigned int u32; - -typedef signed long long s64; -typedef unsigned long long u64; - -#include - -#endif /* __KERNEL__ */ - #endif #endif -- cgit v1.2.3 From c31193cc31a352428c6bee93a013da193cf4c325 Mon Sep 17 00:00:00 2001 From: Robert Karszniewicz Date: Thu, 14 May 2020 15:04:21 +0200 Subject: ARM: dts: imx6: phycard: remove baseboard compatible This devicetree isn't baseboard-specific, so keep it compatible at SOM-level. Signed-off-by: Robert Karszniewicz Signed-off-by: Sascha Hauer --- arch/arm/dts/imx6q-phytec-phycard.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch') diff --git a/arch/arm/dts/imx6q-phytec-phycard.dts b/arch/arm/dts/imx6q-phytec-phycard.dts index c06461c2c7..b0e47e9b62 100644 --- a/arch/arm/dts/imx6q-phytec-phycard.dts +++ b/arch/arm/dts/imx6q-phytec-phycard.dts @@ -16,7 +16,7 @@ / { model = "PHYTEC phyCARD-i.MX6 Quad"; - compatible = "phytec,imx6q-pbaa03", "phytec,imx6q-pcaaxl3", "fsl,imx6q"; + compatible = "phytec,imx6q-pcaaxl3", "fsl,imx6q"; chosen { stdout-path = &uart3; -- cgit v1.2.3 From 202b6151d8737c11e4be0f9bc1f1146c02b9b930 Mon Sep 17 00:00:00 2001 From: Ahmad Fatoum Date: Sun, 17 May 2020 20:20:39 +0200 Subject: treewide: replace commas with semicolons where appropriate Found by searching drivers/ arch/ common/ and lib/ for /^\s+[^."/\*\[\s\{\(A-Z][^\[\{\(]*=[^\{\(]+,$/ Because the comma has the lowest precedence in C, this shouldn't result in any functional change. Signed-off-by: Ahmad Fatoum Signed-off-by: Sascha Hauer --- arch/arm/boards/eukrea_cpuimx35/eukrea_cpuimx35.c | 2 +- arch/arm/mach-imx/iim.c | 8 ++++---- arch/nios2/lib/libgcc.c | 21 +++++++++++---------- drivers/i2c/busses/i2c-imx-early.c | 2 +- drivers/i2c/busses/i2c-imx.c | 2 +- drivers/i2c/busses/i2c-omap.c | 2 +- drivers/mci/stm32_sdmmc2.c | 4 ++-- drivers/net/usb/usbnet.c | 10 +++++----- 8 files changed, 26 insertions(+), 25 deletions(-) (limited to 'arch') diff --git a/arch/arm/boards/eukrea_cpuimx35/eukrea_cpuimx35.c b/arch/arm/boards/eukrea_cpuimx35/eukrea_cpuimx35.c index 220a484bde..558bc07912 100644 --- a/arch/arm/boards/eukrea_cpuimx35/eukrea_cpuimx35.c +++ b/arch/arm/boards/eukrea_cpuimx35/eukrea_cpuimx35.c @@ -242,7 +242,7 @@ static int eukrea_cpuimx35_core_init(void) reg = writel(reg, MX35_CCM_BASE_ADDR + MX35_CCM_CGR0); reg = readl(MX35_CCM_BASE_ADDR + MX35_CCM_CGR1); reg |= 0x3 << MX35_CCM_CGR1_FEC_SHIFT; - reg |= 0x3 << MX35_CCM_CGR1_I2C1_SHIFT, + reg |= 0x3 << MX35_CCM_CGR1_I2C1_SHIFT; reg = writel(reg, MX35_CCM_BASE_ADDR + MX35_CCM_CGR1); reg = readl(MX35_CCM_BASE_ADDR + MX35_CCM_CGR2); reg |= 0x3 << MX35_CCM_CGR2_USB_SHIFT; diff --git a/arch/arm/mach-imx/iim.c b/arch/arm/mach-imx/iim.c index 207e1879c3..2f9ffbd271 100644 --- a/arch/arm/mach-imx/iim.c +++ b/arch/arm/mach-imx/iim.c @@ -329,10 +329,10 @@ static int imx_iim_add_bank(struct iim_priv *iim, int num, int nregs) iim->bank[num] = bank; - bank->map_config.reg_bits = 8, - bank->map_config.val_bits = 8, - bank->map_config.reg_stride = 1, - bank->map_config.max_register = (nregs - 1), + bank->map_config.reg_bits = 8; + bank->map_config.val_bits = 8; + bank->map_config.reg_stride = 1; + bank->map_config.max_register = (nregs - 1); bank->map_config.name = xasprintf("bank%d", num); bank->map = regmap_init(&iim->dev, &imx_iim_regmap_bus, bank, &bank->map_config); diff --git a/arch/nios2/lib/libgcc.c b/arch/nios2/lib/libgcc.c index abf93fdd71..814df73310 100644 --- a/arch/nios2/lib/libgcc.c +++ b/arch/nios2/lib/libgcc.c @@ -319,15 +319,15 @@ DWtype __divdi3(DWtype u, DWtype v) DWunion vv = {.ll = v}; DWtype w; - if (uu.s.high < 0) - c = ~c, - - uu.ll = -uu.ll; - - if (vv.s.high < 0) - c = ~c, + if (uu.s.high < 0) { + c = ~c; + uu.ll = -uu.ll; + } - vv.ll = -vv.ll; + if (vv.s.high < 0) { + c = ~c; + vv.ll = -vv.ll; + } w = __udivmoddi4(uu.ll, vv.ll, (UDWtype *) 0); @@ -366,9 +366,10 @@ DWtype __moddi3(DWtype u, DWtype v) DWunion vv = {.ll = v}; DWtype w; - if (uu.s.high < 0) - c = ~c, + if (uu.s.high < 0) { + c = ~c; uu.ll = -uu.ll; + } if (vv.s.high < 0) vv.ll = -vv.ll; diff --git a/drivers/i2c/busses/i2c-imx-early.c b/drivers/i2c/busses/i2c-imx-early.c index 26922c1044..472e4be83a 100644 --- a/drivers/i2c/busses/i2c-imx-early.c +++ b/drivers/i2c/busses/i2c-imx-early.c @@ -282,7 +282,7 @@ fail0: i2c_fsl_stop(fsl_i2c); /* Disable I2C controller, and force our state to stopped */ - temp = fsl_i2c->i2cr_ien_opcode ^ I2CR_IEN, + temp = fsl_i2c->i2cr_ien_opcode ^ I2CR_IEN; fsl_i2c_write_reg(temp, fsl_i2c, FSL_I2C_I2CR); return (ret < 0) ? ret : num; diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c index 6911f803b2..7d25ed3af5 100644 --- a/drivers/i2c/busses/i2c-imx.c +++ b/drivers/i2c/busses/i2c-imx.c @@ -511,7 +511,7 @@ fail0: i2c_fsl_stop(adapter); /* Disable I2C controller, and force our state to stopped */ - temp = i2c_fsl->hwdata->i2cr_ien_opcode ^ I2CR_IEN, + temp = i2c_fsl->hwdata->i2cr_ien_opcode ^ I2CR_IEN; fsl_i2c_write_reg(temp, i2c_fsl, FSL_I2C_I2CR); return (result < 0) ? result : num; diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c index bdb34ca1b4..d3f525f333 100644 --- a/drivers/i2c/busses/i2c-omap.c +++ b/drivers/i2c/busses/i2c-omap.c @@ -1176,7 +1176,7 @@ i2c_omap_probe(struct device_d *pdev) omap_i2c_idle(i2c_omap); - i2c_omap->adapter.master_xfer = omap_i2c_xfer, + i2c_omap->adapter.master_xfer = omap_i2c_xfer; i2c_omap->adapter.nr = pdev->id; i2c_omap->adapter.dev.parent = pdev; i2c_omap->adapter.dev.device_node = pdev->device_node; diff --git a/drivers/mci/stm32_sdmmc2.c b/drivers/mci/stm32_sdmmc2.c index 3ce3bb0f89..da2dc592ad 100644 --- a/drivers/mci/stm32_sdmmc2.c +++ b/drivers/mci/stm32_sdmmc2.c @@ -586,8 +586,8 @@ static int stm32_sdmmc2_probe(struct amba_device *adev, priv->dev = dev; mci = &priv->mci; - mci->send_cmd = stm32_sdmmc2_send_cmd, - mci->set_ios = stm32_sdmmc2_set_ios, + mci->send_cmd = stm32_sdmmc2_send_cmd; + mci->set_ios = stm32_sdmmc2_set_ios; mci->init = stm32_sdmmc2_reset; mci->hw_dev = dev; diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c index 406b8c964f..7397034586 100644 --- a/drivers/net/usb/usbnet.c +++ b/drivers/net/usb/usbnet.c @@ -198,11 +198,11 @@ int usbnet_probe(struct usb_device *usbdev, const struct usb_device_id *prod) edev = &undev->edev; undev->udev = usbdev; - edev->open = usbnet_open, - edev->init = usbnet_init, - edev->send = usbnet_send, - edev->recv = usbnet_recv, - edev->halt = usbnet_halt, + edev->open = usbnet_open; + edev->init = usbnet_init; + edev->send = usbnet_send; + edev->recv = usbnet_recv; + edev->halt = usbnet_halt; edev->priv = undev; edev->parent = &usbdev->dev; -- cgit v1.2.3 From 34d18aaa2a47522a8b607fb2e61c79f5b10ecb9a Mon Sep 17 00:00:00 2001 From: Antony Pavlov Date: Wed, 3 Jun 2020 09:20:32 +0300 Subject: MIPS: correctly work with disabled CONFIG_MMU There are some issues with CONFIG_MMU=n in MIPS configuration (e.g. qemu-malta_defconfig): * "Cannot request SDRAM region for stack" error message on start; * empty kseg1_ram0 region in the iomem command output. The patch fixes the problems by forcing KSEG1 memory region usage for CONFIG_MMU=n MIPS configurations. Signed-off-by: Antony Pavlov Signed-off-by: Sascha Hauer --- arch/mips/include/asm/io.h | 6 +++++- arch/mips/lib/reloc.c | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'arch') diff --git a/arch/mips/include/asm/io.h b/arch/mips/include/asm/io.h index c155199430..4df9853680 100644 --- a/arch/mips/include/asm/io.h +++ b/arch/mips/include/asm/io.h @@ -39,7 +39,11 @@ static inline unsigned long virt_to_phys(const void *address) */ static inline void *phys_to_virt(unsigned long address) { - return (void *)CKSEG0ADDR(address); + if (IS_ENABLED(CONFIG_MMU)) { + return (void *)CKSEG0ADDR(address); + } + + return (void *)CKSEG1ADDR(address); } #define IO_SPACE_LIMIT 0 diff --git a/arch/mips/lib/reloc.c b/arch/mips/lib/reloc.c index 4b0e252352..b084a88be7 100644 --- a/arch/mips/lib/reloc.c +++ b/arch/mips/lib/reloc.c @@ -120,7 +120,11 @@ void relocate_code(void *fdt, u32 fdt_size, u32 ram_size) length = __bss_stop - __image_start; relocaddr = ALIGN_DOWN(ram_size - length, SZ_64K); - relocaddr = KSEG0ADDR(relocaddr); + if (IS_ENABLED(CONFIG_MMU)) { + relocaddr = KSEG0ADDR(relocaddr); + } else { + relocaddr = KSEG1ADDR(relocaddr); + } new_stack = relocaddr - MALLOC_SIZE - 16; /* -- cgit v1.2.3