summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Kconfig16
-rw-r--r--arch/arm/Kconfig52
-rw-r--r--arch/arm/boards/raspberry-pi/rpi-common.c2
-rw-r--r--arch/arm/mach-bcm283x/include/mach/mbox.h1
-rw-r--r--arch/arm/mach-omap/Kconfig2
-rw-r--r--arch/arm/mach-samsung/Kconfig4
-rw-r--r--arch/arm/mach-versatile/Kconfig2
-rw-r--r--arch/mips/Kconfig12
-rw-r--r--arch/ppc/Kconfig4
-rw-r--r--arch/riscv/Kconfig2
-rw-r--r--arch/x86/Kconfig4
-rw-r--r--commands/crc.c4
-rw-r--r--commands/firmwareload.c4
-rw-r--r--commands/memcpy.c20
-rw-r--r--commands/of_display_timings.c8
-rw-r--r--commands/of_dump.c6
-rw-r--r--commands/of_fixup_status.c2
-rw-r--r--commands/oftree.c4
-rw-r--r--common/Kconfig4
-rw-r--r--drivers/crypto/Kconfig2
-rw-r--r--drivers/i2c/Kconfig6
-rw-r--r--drivers/pinctrl/Kconfig2
-rw-r--r--drivers/usb/Kconfig13
-rw-r--r--drivers/usb/dwc3/core.c21
-rw-r--r--drivers/video/Kconfig2
-rw-r--r--drivers/video/of_display_timing.c15
-rw-r--r--drivers/w1/Kconfig4
-rw-r--r--fs/Kconfig10
-rw-r--r--fs/ramfs.c12
-rw-r--r--include/linux/kernel.h29
-rw-r--r--include/linux/limits.h35
-rw-r--r--lib/Kconfig10
-rw-r--r--lib/libfile.c18
-rw-r--r--scripts/Kconfig2
34 files changed, 171 insertions, 163 deletions
diff --git a/Kconfig b/Kconfig
index 2f2f1a6..29c3246 100644
--- a/Kconfig
+++ b/Kconfig
@@ -6,12 +6,12 @@ mainmenu "Barebox/$(ARCH) $(KERNELVERSION) Configuration"
source "arch/$(SRCARCH)/Kconfig"
-source common/Kconfig
-source commands/Kconfig
-source net/Kconfig
-source drivers/Kconfig
-source fs/Kconfig
-source lib/Kconfig
-source crypto/Kconfig
-source firmware/Kconfig
+source "common/Kconfig"
+source "commands/Kconfig"
+source "net/Kconfig"
+source "drivers/Kconfig"
+source "fs/Kconfig"
+source "lib/Kconfig"
+source "crypto/Kconfig"
+source "firmware/Kconfig"
source "scripts/Kconfig"
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 8565bbb..eccef92 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -275,32 +275,32 @@ config ARCH_QEMU
endchoice
-source arch/arm/cpu/Kconfig
-source arch/arm/mach-at91/Kconfig
-source arch/arm/mach-bcm283x/Kconfig
-source arch/arm/mach-clps711x/Kconfig
-source arch/arm/mach-davinci/Kconfig
-source arch/arm/mach-digic/Kconfig
-source arch/arm/mach-ep93xx/Kconfig
-source arch/arm/mach-highbank/Kconfig
-source arch/arm/mach-imx/Kconfig
-source arch/arm/mach-layerscape/Kconfig
-source arch/arm/mach-mxs/Kconfig
-source arch/arm/mach-mvebu/Kconfig
-source arch/arm/mach-netx/Kconfig
-source arch/arm/mach-nomadik/Kconfig
-source arch/arm/mach-omap/Kconfig
-source arch/arm/mach-pxa/Kconfig
-source arch/arm/mach-rockchip/Kconfig
-source arch/arm/mach-samsung/Kconfig
-source arch/arm/mach-socfpga/Kconfig
-source arch/arm/mach-versatile/Kconfig
-source arch/arm/mach-vexpress/Kconfig
-source arch/arm/mach-tegra/Kconfig
-source arch/arm/mach-uemd/Kconfig
-source arch/arm/mach-zynq/Kconfig
-source arch/arm/mach-qemu/Kconfig
-source arch/arm/mach-zynqmp/Kconfig
+source "arch/arm/cpu/Kconfig"
+source "arch/arm/mach-at91/Kconfig"
+source "arch/arm/mach-bcm283x/Kconfig"
+source "arch/arm/mach-clps711x/Kconfig"
+source "arch/arm/mach-davinci/Kconfig"
+source "arch/arm/mach-digic/Kconfig"
+source "arch/arm/mach-ep93xx/Kconfig"
+source "arch/arm/mach-highbank/Kconfig"
+source "arch/arm/mach-imx/Kconfig"
+source "arch/arm/mach-layerscape/Kconfig"
+source "arch/arm/mach-mxs/Kconfig"
+source "arch/arm/mach-mvebu/Kconfig"
+source "arch/arm/mach-netx/Kconfig"
+source "arch/arm/mach-nomadik/Kconfig"
+source "arch/arm/mach-omap/Kconfig"
+source "arch/arm/mach-pxa/Kconfig"
+source "arch/arm/mach-rockchip/Kconfig"
+source "arch/arm/mach-samsung/Kconfig"
+source "arch/arm/mach-socfpga/Kconfig"
+source "arch/arm/mach-versatile/Kconfig"
+source "arch/arm/mach-vexpress/Kconfig"
+source "arch/arm/mach-tegra/Kconfig"
+source "arch/arm/mach-uemd/Kconfig"
+source "arch/arm/mach-zynq/Kconfig"
+source "arch/arm/mach-qemu/Kconfig"
+source "arch/arm/mach-zynqmp/Kconfig"
config ARM_ASM_UNIFIED
bool
diff --git a/arch/arm/boards/raspberry-pi/rpi-common.c b/arch/arm/boards/raspberry-pi/rpi-common.c
index 60cea7f..bc877f8 100644
--- a/arch/arm/boards/raspberry-pi/rpi-common.c
+++ b/arch/arm/boards/raspberry-pi/rpi-common.c
@@ -197,6 +197,8 @@ const struct rpi_model rpi_models_new_scheme[] = {
RPI_MODEL(BCM2835_BOARD_REV_ZERO_W, "Zero W", rpi_b_plus_init),
RPI_MODEL(BCM2837B0_BOARD_REV_3B_PLUS, "Model 3 B+", rpi_b_plus_init ),
RPI_MODEL(BCM2837B0_BOARD_REV_3A_PLUS, "Nodel 3 A+", rpi_b_plus_init),
+ RPI_MODEL(0xf, "Unknown model", NULL),
+ RPI_MODEL(BCM2837B0_BOARD_REV_CM3_PLUS, "Compute Module 3+", NULL),
};
static int rpi_board_rev = 0;
diff --git a/arch/arm/mach-bcm283x/include/mach/mbox.h b/arch/arm/mach-bcm283x/include/mach/mbox.h
index e4f6cb6..6db961b 100644
--- a/arch/arm/mach-bcm283x/include/mach/mbox.h
+++ b/arch/arm/mach-bcm283x/include/mach/mbox.h
@@ -166,6 +166,7 @@ struct bcm2835_mbox_tag_hdr {
#define BCM2835_BOARD_REV_ZERO_W 0x0c
#define BCM2837B0_BOARD_REV_3B_PLUS 0x0d
#define BCM2837B0_BOARD_REV_3A_PLUS 0x0e
+#define BCM2837B0_BOARD_REV_CM3_PLUS 0x10
struct bcm2835_mbox_tag_get_board_rev {
struct bcm2835_mbox_tag_hdr tag_hdr;
diff --git a/arch/arm/mach-omap/Kconfig b/arch/arm/mach-omap/Kconfig
index 49ca0ee..e922880 100644
--- a/arch/arm/mach-omap/Kconfig
+++ b/arch/arm/mach-omap/Kconfig
@@ -193,7 +193,7 @@ config MACH_WAGO_PFC_AM35XX
endif
-source arch/arm/boards/phytec-som-am335x/Kconfig
+source "arch/arm/boards/phytec-som-am335x/Kconfig"
choice
prompt "Select OMAP board"
diff --git a/arch/arm/mach-samsung/Kconfig b/arch/arm/mach-samsung/Kconfig
index a2ddabf..fa1a3dd 100644
--- a/arch/arm/mach-samsung/Kconfig
+++ b/arch/arm/mach-samsung/Kconfig
@@ -73,7 +73,7 @@ config MACH_A9M2410DEV
endchoice
-source arch/arm/boards/friendlyarm-mini2440/Kconfig
+source "arch/arm/boards/friendlyarm-mini2440/Kconfig"
endmenu
@@ -106,7 +106,7 @@ endchoice
menu "Board specific settings"
-source arch/arm/boards/friendlyarm-tiny6410/Kconfig
+source "arch/arm/boards/friendlyarm-tiny6410/Kconfig"
endmenu
diff --git a/arch/arm/mach-versatile/Kconfig b/arch/arm/mach-versatile/Kconfig
index 3c5cced..95172cf 100644
--- a/arch/arm/mach-versatile/Kconfig
+++ b/arch/arm/mach-versatile/Kconfig
@@ -23,6 +23,6 @@ config MACH_VERSATILEPB_ARM1176
endchoice
-source arch/arm/boards/versatile/Kconfig
+source "arch/arm/boards/versatile/Kconfig"
endif
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index eab9452..a4070cf 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -109,12 +109,12 @@ config MACH_MIPS_XBURST
select GPIOLIB
endchoice
-source arch/mips/mach-malta/Kconfig
-source arch/mips/mach-ar231x/Kconfig
-source arch/mips/mach-ath79/Kconfig
-source arch/mips/mach-bcm47xx/Kconfig
-source arch/mips/mach-loongson/Kconfig
-source arch/mips/mach-xburst/Kconfig
+source "arch/mips/mach-malta/Kconfig"
+source "arch/mips/mach-ar231x/Kconfig"
+source "arch/mips/mach-ath79/Kconfig"
+source "arch/mips/mach-bcm47xx/Kconfig"
+source "arch/mips/mach-loongson/Kconfig"
+source "arch/mips/mach-xburst/Kconfig"
endmenu
diff --git a/arch/ppc/Kconfig b/arch/ppc/Kconfig
index 7a45ced..798f342 100644
--- a/arch/ppc/Kconfig
+++ b/arch/ppc/Kconfig
@@ -18,5 +18,5 @@ config ARCH_MPC85XX
bool "Freescale MPC85xx"
endchoice
-source arch/ppc/mach-mpc5xxx/Kconfig
-source arch/ppc/mach-mpc85xx/Kconfig
+source "arch/ppc/mach-mpc5xxx/Kconfig"
+source "arch/ppc/mach-mpc85xx/Kconfig"
diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
index c435cc8..16c3eec 100644
--- a/arch/riscv/Kconfig
+++ b/arch/riscv/Kconfig
@@ -62,7 +62,7 @@ config BUILTIN_DTB_NAME
string "DTB to build into the barebox image"
depends on BUILTIN_DTB
-source arch/riscv/mach-erizo/Kconfig
+source "arch/riscv/mach-erizo/Kconfig"
endmenu
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 3f91585..1793055 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -95,5 +95,5 @@ choice
endchoice
-source arch/x86/boot/Kconfig
-source arch/x86/mach-i386/Kconfig
+source "arch/x86/boot/Kconfig"
+source "arch/x86/mach-i386/Kconfig"
diff --git a/commands/crc.c b/commands/crc.c
index edb1fb1..580521d 100644
--- a/commands/crc.c
+++ b/commands/crc.c
@@ -138,8 +138,8 @@ BAREBOX_CMD_HELP_OPT ("-F FILE", "Use file to compare.")
#endif
BAREBOX_CMD_HELP_OPT ("-v CRC", "Verify")
BAREBOX_CMD_HELP_OPT ("-V FILE", "Verify with CRC read from FILE")
-BAREBOX_CMD_HELP_OPT ("-r <var>", "Set <var> to the checksum result\n")
-BAREBOX_CMD_HELP_OPT ("-s <var>", "Set <var> to the data size\n")
+BAREBOX_CMD_HELP_OPT ("-r <var>", "Set <var> to the checksum result")
+BAREBOX_CMD_HELP_OPT ("-s <var>", "Set <var> to the data size")
BAREBOX_CMD_HELP_END
BAREBOX_CMD_START(crc32)
diff --git a/commands/firmwareload.c b/commands/firmwareload.c
index 071f25b..dbd43e0 100644
--- a/commands/firmwareload.c
+++ b/commands/firmwareload.c
@@ -55,8 +55,8 @@ static int do_firmwareload(int argc, char *argv[])
BAREBOX_CMD_HELP_START(firmwareload)
BAREBOX_CMD_HELP_TEXT("Options:")
-BAREBOX_CMD_HELP_OPT("-t <target>", "define the firmware handler by name\n")
-BAREBOX_CMD_HELP_OPT("-l\t", "list devices capable of firmware loading\n")
+BAREBOX_CMD_HELP_OPT("-t <target>", "define the firmware handler by name")
+BAREBOX_CMD_HELP_OPT("-l\t", "list devices capable of firmware loading")
BAREBOX_CMD_HELP_END
BAREBOX_CMD_START(firmwareload)
diff --git a/commands/memcpy.c b/commands/memcpy.c
index ddaf767..ef25fb7 100644
--- a/commands/memcpy.c
+++ b/commands/memcpy.c
@@ -84,9 +84,9 @@ static int do_memcpy(int argc, char *argv[])
buf = xmalloc(RW_BUF_SIZE);
while (count > 0) {
- int now, r, w, tmp;
+ int now, r;
- now = min((loff_t)RW_BUF_SIZE, count);
+ now = min_t(loff_t, RW_BUF_SIZE, count);
r = read(sourcefd, buf, now);
if (r < 0) {
@@ -97,19 +97,9 @@ static int do_memcpy(int argc, char *argv[])
if (!r)
break;
- tmp = 0;
- now = r;
- while (now) {
- w = write(destfd, buf + tmp, now);
- if (w < 0) {
- perror("write");
- goto out;
- }
- if (!w)
- break;
-
- now -= w;
- tmp += w;
+ if (write_full(destfd, buf, r) < 0) {
+ perror("write");
+ goto out;
}
count -= r;
diff --git a/commands/of_display_timings.c b/commands/of_display_timings.c
index ccf2db0..365ff80 100644
--- a/commands/of_display_timings.c
+++ b/commands/of_display_timings.c
@@ -148,10 +148,10 @@ static int do_of_display_timings(int argc, char *argv[])
BAREBOX_CMD_HELP_START(of_display_timings)
BAREBOX_CMD_HELP_TEXT("Options:")
-BAREBOX_CMD_HELP_OPT("-l", "list path of all available display-timings\n")
-BAREBOX_CMD_HELP_OPT("-s", "list path of all selected display-timings\n")
-BAREBOX_CMD_HELP_OPT("-S path", "select display-timings and register oftree fixup\n")
-BAREBOX_CMD_HELP_OPT("-f dtb", "work on dtb. Has no effect on -s option\n")
+BAREBOX_CMD_HELP_OPT("-l", "list path of all available display-timings")
+BAREBOX_CMD_HELP_OPT("-s", "list path of all selected display-timings")
+BAREBOX_CMD_HELP_OPT("-S path", "select display-timings and register oftree fixup")
+BAREBOX_CMD_HELP_OPT("-f dtb", "work on dtb. Has no effect on -s option")
BAREBOX_CMD_HELP_END
BAREBOX_CMD_START(of_display_timings)
diff --git a/commands/of_dump.c b/commands/of_dump.c
index 7bec0b9..06b8e9f 100644
--- a/commands/of_dump.c
+++ b/commands/of_dump.c
@@ -139,9 +139,9 @@ out:
BAREBOX_CMD_HELP_START(of_dump)
BAREBOX_CMD_HELP_TEXT("Options:")
-BAREBOX_CMD_HELP_OPT ("-f dtb", "work on dtb instead of internal devicetree\n")
-BAREBOX_CMD_HELP_OPT ("-F", "return fixed devicetree\n")
-BAREBOX_CMD_HELP_OPT ("-n", "Print node names only, no properties\n")
+BAREBOX_CMD_HELP_OPT ("-f dtb", "work on dtb instead of internal devicetree")
+BAREBOX_CMD_HELP_OPT ("-F", "return fixed devicetree")
+BAREBOX_CMD_HELP_OPT ("-n", "Print node names only, no properties")
BAREBOX_CMD_HELP_END
BAREBOX_CMD_START(of_dump)
diff --git a/commands/of_fixup_status.c b/commands/of_fixup_status.c
index 9a4a619..e0da429 100644
--- a/commands/of_fixup_status.c
+++ b/commands/of_fixup_status.c
@@ -59,7 +59,7 @@ static int do_of_fixup_status(int argc, char *argv[])
BAREBOX_CMD_HELP_START(of_fixup_status)
BAREBOX_CMD_HELP_TEXT("Options:")
BAREBOX_CMD_HELP_OPT("-d", "disable node")
-BAREBOX_CMD_HELP_OPT("path", "Node path\n")
+BAREBOX_CMD_HELP_OPT("path", "Node path")
BAREBOX_CMD_HELP_TEXT("Register a fixup to enable or disable a device tree node.")
BAREBOX_CMD_HELP_TEXT("Nodes are enabled on default. Disabled with -d.")
BAREBOX_CMD_HELP_END
diff --git a/commands/oftree.c b/commands/oftree.c
index 26a47bb..299c2ed 100644
--- a/commands/oftree.c
+++ b/commands/oftree.c
@@ -123,8 +123,8 @@ out:
BAREBOX_CMD_HELP_START(oftree)
BAREBOX_CMD_HELP_TEXT("Options:")
-BAREBOX_CMD_HELP_OPT ("-l <DTB>", "Load <DTB> to internal devicetree\n")
-BAREBOX_CMD_HELP_OPT ("-s <DTB>", "save internal devicetree to <DTB>\n")
+BAREBOX_CMD_HELP_OPT ("-l <DTB>", "Load <DTB> to internal devicetree")
+BAREBOX_CMD_HELP_OPT ("-s <DTB>", "save internal devicetree to <DTB>")
BAREBOX_CMD_HELP_OPT ("-p", "probe devices from stored device tree")
BAREBOX_CMD_HELP_END
diff --git a/common/Kconfig b/common/Kconfig
index 9c1b01d..7832df5 100644
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -764,13 +764,13 @@ config PBL_CONSOLE
must be running at the address it's linked at and bss must
be cleared. On ARM that would be after setup_c().
-source common/ratp/Kconfig
+source "common/ratp/Kconfig"
config PARTITION
bool
prompt "Enable Partitions"
-source common/partitions/Kconfig
+source "common/partitions/Kconfig"
config ENV_HANDLING
select CRC32
diff --git a/drivers/crypto/Kconfig b/drivers/crypto/Kconfig
index d1687e3..b2709f0 100644
--- a/drivers/crypto/Kconfig
+++ b/drivers/crypto/Kconfig
@@ -4,6 +4,6 @@ menuconfig CRYPTO_HW
if CRYPTO_HW
-source drivers/crypto/caam/Kconfig
+source "drivers/crypto/caam/Kconfig"
endif
diff --git a/drivers/i2c/Kconfig b/drivers/i2c/Kconfig
index fc314ec..0bd8be0 100644
--- a/drivers/i2c/Kconfig
+++ b/drivers/i2c/Kconfig
@@ -3,8 +3,8 @@ menuconfig I2C
if I2C
-source drivers/i2c/algos/Kconfig
-source drivers/i2c/busses/Kconfig
+source "drivers/i2c/algos/Kconfig"
+source "drivers/i2c/busses/Kconfig"
config I2C_MUX
tristate "I2C bus multiplexing support"
@@ -13,7 +13,7 @@ config I2C_MUX
handle multiplexed I2C bus topologies, by presenting each
multiplexed segment as a I2C adapter.
-source drivers/i2c/muxes/Kconfig
+source "drivers/i2c/muxes/Kconfig"
endif
diff --git a/drivers/pinctrl/Kconfig b/drivers/pinctrl/Kconfig
index 45c3b35..46badee 100644
--- a/drivers/pinctrl/Kconfig
+++ b/drivers/pinctrl/Kconfig
@@ -83,7 +83,7 @@ config PINCTRL_TEGRA_XUSB
The pinmux controller found on the Tegra 124 line of SoCs used for
the SerDes lanes.
-source drivers/pinctrl/mvebu/Kconfig
+source "drivers/pinctrl/mvebu/Kconfig"
config PINCTRL_VF610
bool
diff --git a/drivers/usb/Kconfig b/drivers/usb/Kconfig
index 8ff3d18..99eff1c 100644
--- a/drivers/usb/Kconfig
+++ b/drivers/usb/Kconfig
@@ -7,21 +7,20 @@ menuconfig USB_HOST
if USB_HOST
-source drivers/usb/imx/Kconfig
+source "drivers/usb/imx/Kconfig"
source "drivers/usb/dwc3/Kconfig"
-source drivers/usb/host/Kconfig
+source "drivers/usb/host/Kconfig"
-source drivers/usb/otg/Kconfig
+source "drivers/usb/otg/Kconfig"
-source drivers/usb/storage/Kconfig
+source "drivers/usb/storage/Kconfig"
source "drivers/usb/misc/Kconfig"
endif
-source drivers/usb/gadget/Kconfig
-
-source drivers/usb/musb/Kconfig
+source "drivers/usb/gadget/Kconfig"
+source "drivers/usb/musb/Kconfig"
diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
index 2e7031a..60fd631 100644
--- a/drivers/usb/dwc3/core.c
+++ b/drivers/usb/dwc3/core.c
@@ -663,6 +663,25 @@ static void dwc3_check_params(struct dwc3 *dwc)
}
}
+static void dwc3_coresoft_reset(struct dwc3 *dwc)
+{
+ u32 reg;
+
+ reg = dwc3_readl(dwc->regs, DWC3_GCTL);
+ reg |= DWC3_GCTL_CORESOFTRESET;
+ dwc3_writel(dwc->regs, DWC3_GCTL, reg);
+
+ /*
+ * Similar reset sequence in U-Boot has a 100ms delay here. In
+ * practice reset sequence seem to work as expected even
+ * without a delay.
+ */
+
+ reg = dwc3_readl(dwc->regs, DWC3_GCTL);
+ reg &= ~DWC3_GCTL_CORESOFTRESET;
+ dwc3_writel(dwc->regs, DWC3_GCTL, reg);
+}
+
static int dwc3_probe(struct device_d *dev)
{
struct dwc3 *dwc;
@@ -695,6 +714,8 @@ static int dwc3_probe(struct device_d *dev)
if (ret)
return ret;
+ dwc3_coresoft_reset(dwc);
+
dwc3_cache_hwparams(dwc);
ret = dwc3_core_init(dwc);
diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index 79de32c..a26bace 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -96,7 +96,7 @@ config DRIVER_VIDEO_BCM283X
help
Add support for the BCM283X/VideoCore frame buffer device.
-source drivers/video/imx-ipu-v3/Kconfig
+source "drivers/video/imx-ipu-v3/Kconfig"
config DRIVER_VIDEO_SIMPLEFB
bool "Simple framebuffer support"
diff --git a/drivers/video/of_display_timing.c b/drivers/video/of_display_timing.c
index 20f9354..17d8823 100644
--- a/drivers/video/of_display_timing.c
+++ b/drivers/video/of_display_timing.c
@@ -14,7 +14,8 @@
void display_timings_release(struct display_timings *disp)
{
- free(disp->modes);
+ if (disp->modes)
+ free(disp->modes);
free(disp);
}
EXPORT_SYMBOL_GPL(display_timings_release);
@@ -43,7 +44,7 @@ static int parse_timing_property(const struct device_node *np, const char *name,
}
cells = length / sizeof(u32);
- if (cells == 1) {
+ if ((cells == 1) || (cells == 3)) {
ret = of_property_read_u32(np, name, res);
} else {
pr_err("%s: illegal timing specification in %s\n",
@@ -129,7 +130,7 @@ struct display_timings *of_get_display_timings(struct device_node *np)
if (!entry) {
pr_err("%s: no timing specifications given\n",
np->full_name);
- goto entryfail;
+ goto fail;
}
pr_debug("%s: using %s as default timing\n",
@@ -141,7 +142,7 @@ struct display_timings *of_get_display_timings(struct device_node *np)
if (disp->num_modes == 0) {
/* should never happen, as entry was already found above */
pr_err("%s: no timings specified\n", np->full_name);
- goto entryfail;
+ goto fail;
}
disp->modes = xzalloc(sizeof(struct fb_videomode) * disp->num_modes);
@@ -163,7 +164,7 @@ struct display_timings *of_get_display_timings(struct device_node *np)
*/
pr_err("%s: error in timing %d\n",
np->full_name, disp->num_modes + 1);
- goto timingfail;
+ goto fail;
}
mode->name = xstrdup(entry->name);
@@ -180,10 +181,8 @@ struct display_timings *of_get_display_timings(struct device_node *np)
return disp;
-timingfail:
+fail:
display_timings_release(disp);
-entryfail:
- free(disp);
return NULL;
}
diff --git a/drivers/w1/Kconfig b/drivers/w1/Kconfig
index dbc1e3c..4a16197 100644
--- a/drivers/w1/Kconfig
+++ b/drivers/w1/Kconfig
@@ -8,8 +8,8 @@ menuconfig W1
if W1
-source drivers/w1/masters/Kconfig
-source drivers/w1/slaves/Kconfig
+source "drivers/w1/masters/Kconfig"
+source "drivers/w1/slaves/Kconfig"
config W1_DUAL_SEARCH
bool "dual search"
diff --git a/fs/Kconfig b/fs/Kconfig
index 76a3846..e3a9532 100644
--- a/fs/Kconfig
+++ b/fs/Kconfig
@@ -25,7 +25,7 @@ config FS_CRAMFS
select ZLIB
prompt "cramfs support"
-source fs/ext4/Kconfig
+source "fs/ext4/Kconfig"
config FS_RAMFS
bool
@@ -70,8 +70,8 @@ config FS_EFIVARFS
help
This filesystem driver provides access to EFI variables.
-source fs/fat/Kconfig
-source fs/ubifs/Kconfig
+source "fs/fat/Kconfig"
+source "fs/ubifs/Kconfig"
config FS_BPKFS
bool
@@ -106,8 +106,8 @@ config FS_SMHFS
located on a debugging host connected to the target running
Barebox
-source fs/pstore/Kconfig
-source fs/squashfs/Kconfig
+source "fs/pstore/Kconfig"
+source "fs/squashfs/Kconfig"
config FS_RATP
bool
diff --git a/fs/ramfs.c b/fs/ramfs.c
index 3046afe..7e7dc7a 100644
--- a/fs/ramfs.c
+++ b/fs/ramfs.c
@@ -43,8 +43,6 @@ struct ramfs_inode {
char *symlink;
ulong mode;
- struct handle_d *handle;
-
ulong size;
struct ramfs_chunk *data;
@@ -101,8 +99,6 @@ static struct inode *ramfs_get_inode(struct super_block *sb, const struct inode
return inode;
}
-static int chunks = 0;
-
static struct ramfs_chunk *ramfs_get_chunk(void)
{
struct ramfs_chunk *data = malloc(sizeof(struct ramfs_chunk));
@@ -115,7 +111,6 @@ static struct ramfs_chunk *ramfs_get_chunk(void)
return NULL;
}
data->next = NULL;
- chunks++;
return data;
}
@@ -124,7 +119,6 @@ static void ramfs_put_chunk(struct ramfs_chunk *data)
{
free(data->data);
free(data);
- chunks--;
}
/* ---------------------------------------------------------------*/
@@ -137,10 +131,8 @@ ramfs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode)
if (!inode)
return -ENOSPC;
- if (inode) {
- d_instantiate(dentry, inode);
- dget(dentry); /* Extra count - pin the dentry in core */
- }
+ d_instantiate(dentry, inode);
+ dget(dentry); /* Extra count - pin the dentry in core */
return 0;
}
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 849c079..b320f7e 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -1,36 +1,11 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _LINUX_KERNEL_H
#define _LINUX_KERNEL_H
#include <linux/compiler.h>
#include <linux/bug.h>
#include <linux/barebox-wrapper.h>
-
-#define USHRT_MAX ((u16)(~0U))
-#define SHRT_MAX ((s16)(USHRT_MAX>>1))
-#define SHRT_MIN ((s16)(-SHRT_MAX - 1))
-#define INT_MAX ((int)(~0U>>1))
-#define INT_MIN (-INT_MAX - 1)
-#define UINT_MAX (~0U)
-#define LONG_MAX ((long)(~0UL>>1))
-#define LONG_MIN (-LONG_MAX - 1)
-#define ULONG_MAX (~0UL)
-#define LLONG_MAX ((long long)(~0ULL>>1))
-#define LLONG_MIN (-LLONG_MAX - 1)
-#define ULLONG_MAX (~0ULL)
-#define SIZE_MAX (~(size_t)0)
-
-#define U8_MAX ((u8)~0U)
-#define S8_MAX ((s8)(U8_MAX>>1))
-#define S8_MIN ((s8)(-S8_MAX - 1))
-#define U16_MAX ((u16)~0U)
-#define S16_MAX ((s16)(U16_MAX>>1))
-#define S16_MIN ((s16)(-S16_MAX - 1))
-#define U32_MAX ((u32)~0U)
-#define S32_MAX ((s32)(U32_MAX>>1))
-#define S32_MIN ((s32)(-S32_MAX - 1))
-#define U64_MAX ((u64)~0ULL)
-#define S64_MAX ((s64)(U64_MAX>>1))
-#define S64_MIN ((s64)(-S64_MAX - 1))
+#include <linux/limits.h>
#define ALIGN(x, a) __ALIGN_MASK(x, (typeof(x))(a) - 1)
#define ALIGN_DOWN(x, a) ALIGN((x) - ((a) - 1), (a))
diff --git a/include/linux/limits.h b/include/linux/limits.h
new file mode 100644
index 0000000..bda9c94
--- /dev/null
+++ b/include/linux/limits.h
@@ -0,0 +1,35 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _LINUX_LIMITS_H
+#define _LINUX_LIMITS_H
+
+#include <linux/types.h>
+
+#define USHRT_MAX ((unsigned short)~0U)
+#define SHRT_MAX ((short)(USHRT_MAX >> 1))
+#define SHRT_MIN ((short)(-SHRT_MAX - 1))
+#define INT_MAX ((int)(~0U >> 1))
+#define INT_MIN (-INT_MAX - 1)
+#define UINT_MAX (~0U)
+#define LONG_MAX ((long)(~0UL >> 1))
+#define LONG_MIN (-LONG_MAX - 1)
+#define ULONG_MAX (~0UL)
+#define LLONG_MAX ((long long)(~0ULL >> 1))
+#define LLONG_MIN (-LLONG_MAX - 1)
+#define ULLONG_MAX (~0ULL)
+#define SIZE_MAX (~(size_t)0)
+#define PHYS_ADDR_MAX (~(phys_addr_t)0)
+
+#define U8_MAX ((u8)~0U)
+#define S8_MAX ((s8)(U8_MAX >> 1))
+#define S8_MIN ((s8)(-S8_MAX - 1))
+#define U16_MAX ((u16)~0U)
+#define S16_MAX ((s16)(U16_MAX >> 1))
+#define S16_MIN ((s16)(-S16_MAX - 1))
+#define U32_MAX ((u32)~0U)
+#define S32_MAX ((s32)(U32_MAX >> 1))
+#define S32_MIN ((s32)(-S32_MAX - 1))
+#define U64_MAX ((u64)~0ULL)
+#define S64_MAX ((s64)(U64_MAX >> 1))
+#define S64_MIN ((s64)(-S64_MAX - 1))
+
+#endif /* _LINUX_LIMITS_H */
diff --git a/lib/Kconfig b/lib/Kconfig
index 150d63b..27f6246 100644
--- a/lib/Kconfig
+++ b/lib/Kconfig
@@ -63,7 +63,7 @@ config GENERIC_FIND_NEXT_BIT
config PROCESS_ESCAPE_SEQUENCE
def_bool n
-source lib/lzo/Kconfig
+source "lib/lzo/Kconfig"
config BCH
bool
@@ -129,13 +129,13 @@ config CRC8
when they need to do cyclic redundancy check according CRC8
algorithm. Module will be called crc8.
-source lib/gui/Kconfig
+source "lib/gui/Kconfig"
-source lib/fonts/Kconfig
+source "lib/fonts/Kconfig"
-source lib/logo/Kconfig
+source "lib/logo/Kconfig"
-source lib/bootstrap/Kconfig
+source "lib/bootstrap/Kconfig"
config PRINTF_UUID
bool
diff --git a/lib/libfile.c b/lib/libfile.c
index 0897492..eb12d15 100644
--- a/lib/libfile.c
+++ b/lib/libfile.c
@@ -323,10 +323,9 @@ int copy_file(const char *src, const char *dst, int verbose)
{
char *rw_buf = NULL;
int srcfd = 0, dstfd = 0;
- int r, w;
+ int r;
int ret = 1, err1 = 0;
int mode;
- void *buf;
int total = 0;
struct stat srcstat, dststat;
@@ -370,18 +369,13 @@ int copy_file(const char *src, const char *dst, int verbose)
if (!r)
break;
- buf = rw_buf;
- while (r) {
- w = write(dstfd, buf, r);
- if (w < 0) {
- perror("write");
- goto out;
- }
- buf += w;
- r -= w;
- total += w;
+ if (write_full(dstfd, rw_buf, r) < 0) {
+ perror("write");
+ goto out;
}
+ total += r;
+
if (verbose) {
if (srcstat.st_size && srcstat.st_size != FILESIZE_MAX)
show_progress(total);
diff --git a/scripts/Kconfig b/scripts/Kconfig
index 14a577a..20530b9 100644
--- a/scripts/Kconfig
+++ b/scripts/Kconfig
@@ -10,7 +10,7 @@ config COMPILE_HOST_TOOLS
This is usefull for compile coverage testing and for packaging the
host tools.
-source scripts/imx/Kconfig
+source "scripts/imx/Kconfig"
config MVEBU_HOSTTOOLS
bool "mvebu hosttools" if COMPILE_HOST_TOOLS