diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2021-11-15 14:21:13 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2021-11-15 14:21:13 +0100 |
commit | 42cdd1452a51ca970a6cda76e3bdbe4f04d6e13f (patch) | |
tree | e977baadd93fd72759c1c0b96aee77090950b39b /common | |
parent | 71f347dadfd9d19b57c4bda1ff446add38081e92 (diff) | |
parent | f1d33492703334c6a8c813c4af546a1d6d87c385 (diff) | |
download | barebox-42cdd1452a51ca970a6cda76e3bdbe4f04d6e13f.tar.gz barebox-42cdd1452a51ca970a6cda76e3bdbe4f04d6e13f.tar.xz |
Merge branch 'for-next/misc'
Diffstat (limited to 'common')
-rw-r--r-- | common/bootchooser.c | 2 | ||||
-rw-r--r-- | common/optee.c | 2 | ||||
-rw-r--r-- | common/startup.c | 70 | ||||
-rw-r--r-- | common/state/backend_bucket_direct.c | 2 | ||||
-rw-r--r-- | common/state/backend_storage.c | 2 | ||||
-rw-r--r-- | common/state/state_variables.c | 2 |
6 files changed, 6 insertions, 74 deletions
diff --git a/common/bootchooser.c b/common/bootchooser.c index 2f22e03c47..75dfbc6166 100644 --- a/common/bootchooser.c +++ b/common/bootchooser.c @@ -13,7 +13,7 @@ #include <libfile.h> #include <common.h> #include <malloc.h> -#include <printk.h> +#include <linux/printk.h> #include <xfuncs.h> #include <envfs.h> #include <errno.h> diff --git a/common/optee.c b/common/optee.c index d542dde118..b460fbcd01 100644 --- a/common/optee.c +++ b/common/optee.c @@ -3,7 +3,7 @@ #define pr_fmt(fmt) "optee: " fmt #include <tee/optee.h> -#include <printk.h> +#include <linux/printk.h> #include <asm-generic/errno.h> int optee_verify_header(struct optee_header *hdr) diff --git a/common/startup.c b/common/startup.c index f72902fc53..f53b73f81a 100644 --- a/common/startup.c +++ b/common/startup.c @@ -68,70 +68,6 @@ static int mount_root(void) fs_initcall(mount_root); #endif -#ifdef CONFIG_ENV_HANDLING -static bool region_overlap(loff_t starta, loff_t lena, - loff_t startb, loff_t lenb) -{ - if (starta + lena <= startb) - return 0; - if (startb + lenb <= starta) - return 0; - return 1; -} - -static int check_overlap(const char *path) -{ - struct cdev *cenv, *cdisk, *cpart; - const char *name; - - name = devpath_to_name(path); - - if (name == path) - /* - * no /dev/ in front, so *path is some file. No need to - * check further. - */ - return 0; - - cenv = cdev_by_name(name); - if (!cenv) - return -EINVAL; - - if (cenv->mtd) - return 0; - - cdisk = cenv->master; - - if (!cdisk) - return 0; - - list_for_each_entry(cpart, &cdisk->partitions, partition_entry) { - if (cpart == cenv) - continue; - - if (region_overlap(cpart->offset, cpart->size, - cenv->offset, cenv->size)) - goto conflict; - } - - return 0; - -conflict: - pr_err("Environment partition (0x%08llx-0x%08llx) " - "overlaps with partition %s (0x%08llx-0x%08llx), not using it\n", - cenv->offset, cenv->offset + cenv->size - 1, - cpart->name, - cpart->offset, cpart->offset + cpart->size - 1); - - return -EINVAL; -} -#else -static int check_overlap(const char *path) -{ - return 0; -} -#endif - static int load_environment(void) { const char *default_environment_path; @@ -143,11 +79,7 @@ static int load_environment(void) defaultenv_load("/env", 0); if (IS_ENABLED(CONFIG_ENV_HANDLING)) { - ret = check_overlap(default_environment_path); - if (ret) - default_environment_path_set(NULL); - else - envfs_load(default_environment_path, "/env", 0); + envfs_load(default_environment_path, "/env", 0); } else { if (IS_ENABLED(CONFIG_DEFAULT_ENVIRONMENT)) pr_notice("No support for persistent environment. Using default environment\n"); diff --git a/common/state/backend_bucket_direct.c b/common/state/backend_bucket_direct.c index 4522f0170f..517aec6063 100644 --- a/common/state/backend_bucket_direct.c +++ b/common/state/backend_bucket_direct.c @@ -17,7 +17,7 @@ #include <libfile.h> #include <linux/kernel.h> #include <malloc.h> -#include <printk.h> +#include <linux/printk.h> #include "state.h" diff --git a/common/state/backend_storage.c b/common/state/backend_storage.c index fe7e89e8fb..7fc7acfdcb 100644 --- a/common/state/backend_storage.c +++ b/common/state/backend_storage.c @@ -21,7 +21,7 @@ #include <linux/mtd/mtd-abi.h> #include <sys/stat.h> #include <malloc.h> -#include <printk.h> +#include <linux/printk.h> #include "state.h" diff --git a/common/state/state_variables.c b/common/state/state_variables.c index 66c66f38bd..f112c60bf6 100644 --- a/common/state/state_variables.c +++ b/common/state/state_variables.c @@ -21,7 +21,7 @@ #include <linux/types.h> #include <malloc.h> #include <net.h> -#include <printk.h> +#include <linux/printk.h> #include <of.h> #include <stdio.h> |